Sample Run
assignment description
This file contains several examples of output:
- Output for the TestDeck program.
(It should say PASS for every test; it should never say FAIL.)
- Output for the Crazy8s program.
(This is an example!
Each time you run the program it'll be different.)
TestDeck
Deck Tests
----------
A new deck
Deck has correct number of cards: PASS
Deck has no duplicates: PASS
Deck not missing any cards: PASS
Take top card: AS
Deck left with correct number of cards: PASS
Deals correct number of cards: PASS
Deck left with correct number of cards: PASS
Correct size after adding a card: PASS
Adding hand brings deck back to full size: PASS
Added card went to bottom: PASS
Added hand went to bottom: PASS
A shuffled deck
Shuffle seems to reorder things: PASS
Deck has correct number of cards: PASS
Deck has no duplicates: PASS
Deck not missing any cards: PASS
Botched commands
Drawing from empty deck throws correct exception: PASS
Dealing too many cards throws correct exception: PASS
Dealing too many cards fails without removing cards: PASS
addCard(null) throws correct exception: PASS
addCards(null) throws correct exception: PASS
addCards(list containing null) throws correct exception: PASS
Crazy8s
This is an example. Each game will be different!
Crazy Eights
------------
The hands have been dealt.
The top card has been turned.
The top card is 7C
It's your turn to play.
Your cards are: [2S, 4S, 9S, 8H, JH, 5D, 5C, JC]
1) 8H
2) 5C
3) JC
Enter the # of your choice: 3
Player 0 plays JC
...press enter...
The top card is JC
Player 1 misses a turn!
The top card is JC
...draws...
...draws...
Player 2 plays AC
...press enter...
The top card is AC
Player 3 plays KC
...press enter...
The top card is KC
It's your turn to play.
Your cards are: [2S, 4S, 9S, 8H, JH, 5D, 5C]
1) 8H
2) 5C
Enter the # of your choice: 2
Player 0 plays 5C
...press enter...
The top card is 5C
Player 1 plays 6C
...press enter...
The top card is 6C
...draws...
...draws...
...draws...
...draws...
Player 2 plays 4C
...press enter...
The top card is 4C
Player 3 plays 3C
...press enter...
The top card is 3C
It's your turn to play.
Your cards are: [2S, 4S, 9S, 8H, JH, 5D]
1) 8H
Enter the # of your choice: 1
Player 0 plays 8H
...press enter...
The top card is 8H
Player 1 plays 8C
...press enter...
The top card is 8C
...draws...
...draws...
Player 2 plays 8D
...press enter...
The top card is 8D
...draws...
...draws...
...draws...
Player 3 plays 9D
...press enter...
The top card is 9D
It's your turn to play.
Your cards are: [2S, 4S, 9S, JH, 5D]
1) 9S
2) 5D
Enter the # of your choice: 1
Player 0 plays 9S
...press enter...
The top card is 9S
Player 1 plays 10S
...press enter...
The top card is 10S
Player 2 plays AS
...press enter...
The top card is AS
Player 3 plays 7S
...press enter...
The top card is 7S
It's your turn to play.
Your cards are: [2S, 4S, JH, 5D]
1) 2S
2) 4S
Enter the # of your choice: 1
Player 0 plays 2S
...press enter...
The top card is 2S
Player 1 must pick up 2!
Player 1 plays 6S
...press enter...
The top card is 6S
Player 2 plays KS
...press enter...
The top card is KS
Player 3 plays JS
...press enter...
The top card is JS
Player 0 misses a turn!
The top card is JS
...draws...
Player 1 plays 3S
...press enter...
The top card is 3S
Player 2 plays 3D
...press enter...
The top card is 3D
...draws...
...draws...
...draws...
Player 3 plays 8S
...press enter...
The top card is 8S
It's your turn to play.
Your cards are: [4S, JH, 5D]
1) 4S
Enter the # of your choice: 1
Player 0 plays 4S
...press enter...
The top card is 4S
...draws...
...draws...
...draws...
Player 1 plays 8D
...press enter...
The top card is 8D
Player 2 plays 7D
...press enter...
The top card is 7D
Player 3 plays 7H
...press enter...
The top card is 7H
It's your turn to play.
Your cards are: [JH, 5D]
1) JH
Enter the # of your choice: 1
Player 0 plays JH
Player 0 says "Last card!"
...press enter...
The top card is JH
Player 1 misses a turn!
The top card is JH
Player 2 plays 2H
...press enter...
The top card is 2H
Player 3 must pick up 2!
Player 3 plays 6H
...press enter...
The top card is 6H
It's your turn to play.
Your cards are: [5D]
You must draw.
...press enter...
You drew a 9S
You must draw again!
...press enter...
You drew a KC
You must draw again!
...press enter...
You drew a 10S
You must draw again!
...press enter...
You drew a 2S
You must draw again!
...press enter...
You drew a JS
You must draw again!
...press enter...
You drew a 6C
That card is playable (press Enter).
Player 0 plays 6C
...press enter...
The top card is 6C
Player 1 plays QC
...press enter...
The top card is QC
Player 2 plays QD
...press enter...
The top card is QD
Player 3 plays QS
...press enter...
The top card is QS
It's your turn to play.
Your cards are: [2S, 9S, 10S, JS, 5D, KC]
1) 2S
2) 9S
3) 10S
4) JS
Enter the # of your choice: 1
Player 0 plays 2S
...press enter...
The top card is 2S
Player 1 must pick up 2!
Player 1 plays 8C
...press enter...
The top card is 8C
...draws...
...draws...
...draws...
...draws...
Player 2 plays 8S
...press enter...
The top card is 8S
Player 3 plays 5S
...press enter...
The top card is 5S
It's your turn to play.
Your cards are: [9S, 10S, JS, 5D, KC]
1) 9S
2) 10S
3) JS
4) 5D
Enter the # of your choice: 3
Player 0 plays JS
...press enter...
The top card is JS
Player 1 misses a turn!
The top card is JS
Player 2 plays 6S
...press enter...
The top card is 6S
Player 3 plays 8H
...press enter...
The top card is 8H
It's your turn to play.
Your cards are: [9S, 10S, 5D, KC]
You must draw.
...press enter...
You drew a KS
You must draw again!
...press enter...
You drew a 4C
You must draw again!
...press enter...
You drew a AC
You must draw again!
...press enter...
You drew a 7C
You must draw again!
...press enter...
You drew a 3S
You must draw again!
...press enter...
You drew a JC
You must draw again!
...press enter...
You drew a 7S
You must draw again!
...press enter...
You drew a 4S
You must draw again!
...press enter...
You drew a 9D
You must draw again!
...press enter...
You drew a 7D
You must draw again!
...press enter...
You drew a 5S
You must draw again!
...press enter...
You drew a QC
You must draw again!
...press enter...
You drew a 6C
You must draw again!
...press enter...
You drew a 2H
That card is playable (press Enter).
Player 0 plays 2H
...press enter...
The top card is 2H
Player 1 must pick up 2!
Player 1 plays KH
...press enter...
The top card is KH
Player 2 plays KD
...press enter...
The top card is KD
...draws...
...draws...
...draws...
...draws...
Player 3 plays 8D
...press enter...
The top card is 8D
It's your turn to play.
Your cards are: [3S, 4S, 5S, 7S, 9S, 10S, KS, 5D, 7D, 9D, AC, 4C, 6C, 7C, JC, QC, KC]
1) 5D
2) 7D
3) 9D
Enter the # of your choice: 3
Player 0 plays 9D
...press enter...
The top card is 9D
Player 1 plays 9H
...press enter...
The top card is 9H
Player 2 plays 10H
...press enter...
The top card is 10H
Player 3 plays 10C
...press enter...
The top card is 10C
It's your turn to play.
Your cards are: [3S, 4S, 5S, 7S, 9S, 10S, KS, 5D, 7D, AC, 4C, 6C, 7C, JC, QC, KC]
1) 10S
2) AC
3) 4C
4) 6C
5) 7C
6) JC
7) QC
8) KC
Enter the # of your choice: 6
Player 0 plays JC
...press enter...
The top card is JC
Player 1 misses a turn!
The top card is JC
...draws...
Player 2 plays 8C
...press enter...
The top card is 8C
Player 3 plays 9C
...press enter...
The top card is 9C
It's your turn to play.
Your cards are: [3S, 4S, 5S, 7S, 9S, 10S, KS, 5D, 7D, AC, 4C, 6C, 7C, QC, KC]
1) 9S
2) AC
3) 4C
4) 6C
5) 7C
6) QC
7) KC
Enter the # of your choice: 7
Player 0 plays KC
...press enter...
The top card is KC
Player 1 plays 3C
...press enter...
The top card is 3C
Player 2 plays 3D
...press enter...
The top card is 3D
...draws...
...draws...
...draws...
Player 3 plays 8S
...press enter...
The top card is 8S
It's your turn to play.
Your cards are: [3S, 4S, 5S, 7S, 9S, 10S, KS, 5D, 7D, AC, 4C, 6C, 7C, QC]
1) 3S
2) 4S
3) 5S
4) 7S
5) 9S
6) 10S
7) KS
Enter the # of your choice: 7
Player 0 plays KS
...press enter...
The top card is KS
Player 1 plays JS
...press enter...
The top card is JS
Player 2 misses a turn!
The top card is JS
Player 3 plays JH
...press enter...
The top card is JH
Player 0 misses a turn!
The top card is JH
Player 1 plays 5H
...press enter...
The top card is 5H
Player 2 plays 4H
...press enter...
The top card is 4H
Player 3 plays AH
...press enter...
The top card is AH
It's your turn to play.
Your cards are: [3S, 4S, 5S, 7S, 9S, 10S, 5D, 7D, AC, 4C, 6C, 7C, QC]
1) AC
Enter the # of your choice: 1
Player 0 plays AC
...press enter...
The top card is AC
Player 1 plays AD
...press enter...
The top card is AD
Player 2 plays 10D
...press enter...
The top card is 10D
...draws...
...draws...
Player 3 plays 8H
...press enter...
The top card is 8H
It's your turn to play.
Your cards are: [3S, 4S, 5S, 7S, 9S, 10S, 5D, 7D, 4C, 6C, 7C, QC]
You must draw.
...press enter...
You drew a AD
You must draw again!
...press enter...
You drew a 9D
You must draw again!
...press enter...
You drew a AC
You must draw again!
...press enter...
You drew a 8H
That card is playable (press Enter).
Player 0 plays 8H
...press enter...
The top card is 8H
Player 1 plays 3H
...press enter...
The top card is 3H
Player 2 plays QH
...press enter...
The top card is QH
Player 3 plays 6H
...press enter...
The top card is 6H
It's your turn to play.
Your cards are: [3S, 4S, 5S, 7S, 9S, 10S, AD, 5D, 7D, 9D, AC, 4C, 6C, 7C, QC]
1) 6C
Enter the # of your choice: 1
Player 0 plays 6C
...press enter...
The top card is 6C
Player 1 plays 6D
...press enter...
The top card is 6D
Player 2 plays 2D
...press enter...
The top card is 2D
Player 3 must pick up 2!
Player 3 plays 2C
...press enter...
The top card is 2C
Player 0 must pick up 2!
It's your turn to play.
Your cards are: [3S, 4S, 5S, 7S, 9S, 10S, 10H, AD, 5D, 7D, 9D, AC, 4C, 7C, JC, QC]
1) AC
2) 4C
3) 7C
4) JC
5) QC
Enter the # of your choice: 4
Player 0 plays JC
...press enter...
The top card is JC
Player 1 misses a turn!
The top card is JC
...draws...
...draws...
Player 2 plays 8C
...press enter...
The top card is 8C
Player 3 plays 5C
...press enter...
The top card is 5C
It's your turn to play.
Your cards are: [3S, 4S, 5S, 7S, 9S, 10S, 10H, AD, 5D, 7D, 9D, AC, 4C, 7C, QC]
1) 5S
2) 5D
3) AC
4) 4C
5) 7C
6) QC
Enter the # of your choice: 6
Player 0 plays QC
...press enter...
The top card is QC
Player 1 plays QD
Player 1 says "Last card!"
...press enter...
The top card is QD
Player 2 plays 4D
...press enter...
The top card is 4D
Player 3 plays KD
...press enter...
The top card is KD
It's your turn to play.
Your cards are: [3S, 4S, 5S, 7S, 9S, 10S, 10H, AD, 5D, 7D, 9D, AC, 4C, 7C]
1) AD
2) 5D
3) 7D
4) 9D
Enter the # of your choice: 4
Player 0 plays 9D
...press enter...
The top card is 9D
Player 1 plays JD
...press enter...
Player 1 wins!
Return to
Outline page
/
assignment description