21, Bagram, or Twenty plus one is a game which progresses by counting up 1 to 21, with the player who calls “21” is eliminated. It can be played between any number of players.
This is a simple 21 number game using Python programming language. The game illustrated here is between the player and the computer.
- The player can choose to start first or second.
- The list of numbers is shown before the Player takes his turn so that it becomes convenient.
- If consecutive numbers are not given in input then the player is automatically disqualified.
- The player loses if he gets the chance to call 21 and wins otherwise.
Free bonus tip ;)
Winning against the computer can be possible by choosing to play second. The strategy is to call numbers till the multiple of 4 which would eventually lead to 21 on computer hence making the player the winner (Thank me later!)