-
Notifications
You must be signed in to change notification settings - Fork 0
/
DeckTester.java
54 lines (53 loc) · 2.19 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
/**
* 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[] normalranks = {"2", "3", "4", "5", "6", "7", "9", "10", "Jack", "Queen", "King", "Ace"};
String[] normalsuits = {"Clubs", "Diamonds", "Hearts", "Spades"};
String[] smallranks = {"A", "B", "C"};
String[] smallsuits = {"Giraffes", "Lions"};
String[] jacksonranks = {"A", "B", "C"};
String[] jacksonsuits = {"Thriller", "Bad", "Dangerous"};
Deck normal = new Deck(normalranks, normalsuits);
Deck small = new Deck(smallranks, smallsuits);
Deck jackson = new Deck(jacksonranks, jacksonsuits);
System.out.println(normal.size());
System.out.println(normal.deal());
System.out.println(normal.deal());
System.out.println(normal.deal());
System.out.println(normal.deal());
System.out.println(normal.deal());
System.out.println(normal.deal());
System.out.println(normal.deal());
System.out.println(normal.isEmpty());
System.out.println(normal.toString());
System.out.print('\n');
System.out.println(small.size());
System.out.println(small.deal());
System.out.println(small.deal());
System.out.println(small.deal());
System.out.println(small.deal());
System.out.println(small.deal());
System.out.println(small.deal());
System.out.println(small.deal());
System.out.println(small.isEmpty());
System.out.println(small.toString());
System.out.print('\n');
System.out.println(jackson.size());
System.out.println(jackson.deal());
System.out.println(jackson.deal());
System.out.println(jackson.deal());
System.out.println(jackson.deal());
System.out.println(jackson.deal());
System.out.println(jackson.deal());
System.out.println(jackson.deal());
System.out.println(jackson.isEmpty());
System.out.println(jackson.toString());
System.out.print('\n');
}
}