Challenge #1: 21 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Challenge #1: 21

Make a game that allows the user to play a game of 21 with the computer. 21 is a game in which you count up to 21 with a player. The player that says 21 loses. Each player can count up to a maximum of 3 each turn. E.g Player 1 starts off with 1, player 2 can say 2,3 or 4. Or player 1 starts off with 3, player 2 can say a number from 4 to 7. So the conditions are as follows: Game supports 1 player to play against the computer. Each has one turn at a time. They must pick a number. They can only count up by 1, 2 or 3 each turn. When a player is forced to count up to 21, they lose. The game must specify who wins and who loses. Begin!!!

10th Jul 2016, 1:01 PM
Gershon Fosu
Gershon Fosu - avatar
2 Answers
+ 2
Code the game mate
10th Jul 2016, 1:28 PM
Gershon Fosu
Gershon Fosu - avatar
+ 1
1
10th Jul 2016, 1:02 PM
Loeschzwerg