-
Notifications
You must be signed in to change notification settings - Fork 0
/
DeckTester.java
56 lines (48 loc) · 1.75 KB
/
DeckTester.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/**
* This is a class that tests the Deck class.
*/
public class DeckTester {
/**
* The main method in this class checks the Deck operations for consistency.
* @param args is not used.
*/
public static void main(String[] args) {
String[] ranks = {"jack", "queen", "king"};
String[] suits = {"blue", "red"};
int[] pointValues = {11, 12, 13};
Deck d = new Deck(ranks, suits, pointValues);
System.out.println("**** Original Deck Methods ****");
System.out.println(" toString:\n" + d.toString());
System.out.println(" isEmpty: " + d.isEmpty());
System.out.println(" size: " + d.size());
System.out.println();
System.out.println();
System.out.println("**** Deal a Card ****");
System.out.println(" deal: " + d.deal());
System.out.println();
System.out.println();
System.out.println("**** Deck Methods After 1 Card Dealt ****");
System.out.println(" toString:\n" + d.toString());
System.out.println(" isEmpty: " + d.isEmpty());
System.out.println(" size: " + d.size());
System.out.println();
System.out.println();
System.out.println("**** Deal Remaining 5 Cards ****");
for (int i = 0; i < 5; i++) {
System.out.println(" deal: " + d.deal());
}
System.out.println();
System.out.println();
System.out.println("**** Deck Methods After All Cards Dealt ****");
System.out.println(" toString:\n" + d.toString());
System.out.println(" isEmpty: " + d.isEmpty());
System.out.println(" size: " + d.size());
System.out.println();
System.out.println();
System.out.println("**** Deal a Card From Empty Deck ****");
System.out.println(" deal: " + d.deal());
System.out.println();
System.out.println();
/* *** TO BE COMPLETED IN ACTIVITY 4 *** */
}
}