Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 916 Bytes

README.md

File metadata and controls

14 lines (10 loc) · 916 Bytes

21 Number Game

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.

Implementation

This is a simple 21 number game using Python programming language. The game illustrated here is between the player and the computer.

  1. The player can choose to start first or second.
  2. The list of numbers is shown before the Player takes his turn so that it becomes convenient.
  3. If consecutive numbers are not given in input then the player is automatically disqualified.
  4. 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!)