Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions Assignment 4 - Psuedocode
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ Instructions:
1) Divide the deck evenly between 2 people - each person receives 26 cards.
2) Each player places their stack of cards face down in front of them.
3) Both players turn up a card at the same time.
4) The player with the higher card takes both cards and puts them face down on the bottom of their stack.
4) The player with the higher value card takes both cards and puts them face down on the bottom of their stack.
5) Players take their turns at the same time, repeating step number 4.
6) If the cards have the same rank, that means "War"
6) If the cards have the same value, that means "War"
7) Each player turns up one card face down and one card face up.
8) The player with the higher cards takes both piles.
9) If the turned up cards are again the same rank, each player places another card face down and turns another card face up.
9) If the turned up cards are again the same value, each player places another card face down and turns another card face up.
10) Game ends when one player has won all the cards.

//Selection
Expand All @@ -21,7 +21,8 @@ Divide the deck evenly between two people - each person receieves 26 cards.
Each player places their stack of cards face down in front of them.

Both players turn up a card at the same time :
If the player has the higher card, they takes both cards and put them face down on the bottom of their stack.
If the player has the higher card, they takes both cards and put them face down on the bottom of their stack,
(Face cards are worth a value of 10, number cards are worth number value, including ace card).
If the cards have the same rank, that means "War".

If "war" occurs, each player turns up one card face down and one card face up. :
Expand All @@ -39,12 +40,12 @@ Divide the deck evenly between two people - each person receieves 26 cards.
Each player places their stack of cards face down in front of them. Both players turn up a card at the same time.

For both players turn up a card at the same time, :
Whoever has the higher card takes both cards and puts them face down on the bottom of their stack.
Whoever has the higher value card takes both cards and puts them face down on the bottom of their stack.
If the cards have the same rank, that means "War".

For "war", each player turns up one card face down and one card face up. :
The player with the higher cards take both piles.
If the turned up cards are again the same rank, each player places another card face down and turns another card face up until they are not the same rank.
The player with the higher calue cards take both piles.
If the turned up cards are again the same value, each player places another card face down and turns another card face up until they are not the same rank.

If "war" does not occur, continue both players turning up a card at the same time.

Expand Down