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
47 changes: 26 additions & 21 deletions 21 Psuedo
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,32 @@ Aces : 1 or 11
Jacks, Queens, Kings, and 10 : 10
Cards 2 through 9 : Same value

for (each player in the game * 3 rounds);
The players look at their cards
If the 2 cards add up to 21:
say "21" to end the game
Else:
begin the game normally
The dealer asks the player to hit or stand.
If the player chooses to hit:
dealer gives the player 1 card faced down
Else if the player chooses to stand:
the player keeps the same cards
The player looks at their cards again
If the player's cards add up to 21 first or is closest to 21 but still under 21:
the player wins the game
If the player's cards add up to above 21:
the player is busted (eliminated)
Else:
Continue the game normally
Proceed to deal cards to the next player
If both players' cards are equal, less than 21, and they both stay:
it is a push (tie)
for (each player in the game * 3 rounds){
The players look at their cards
If the 2 cards add up to 21{
say "21" to end the game
}Else{
begin the game normally
}
The dealer asks the player to hit or stand.
If the player chooses to hit{
dealer gives the player 1 card faced down
}Else the player chooses to stand{
the player keeps the same cards
}
The player looks at their cards again
If the player's cards add up to 21 first or is closest to 21 but still under 21{
the player wins the game
}
If the player's cards add up to above 21{
the player is busted (eliminated)
}Else{
Continue the game normally
}
Proceed to deal cards to the next player
If both players' cards are equal, less than 21, and they both stay{
it is a push (tie)
}



Expand Down