Bogart is a two-player dice game implemented without physical dice or chips. The pot starts empty, one player is chosen randomly, and players alternate turns until someone wins. A turn adds chips to the pot, rolls progressively more dice, and forces a choice between stopping safely or risking everything. section 10.4.1
A player’s turn follows this pattern:
- Add one chip and roll one die. Rolling a 1 ends the turn without awarding chips. section 10.4.1
- If no 1 appears, stop and collect the pot or continue by adding two chips and rolling two dice. section 10.4.1
- Continue sequentially through three, four, and five dice; any 1 ends the turn without a payout. section 10.4.1
- Organize the implementation with a top-level play function, separate turn logic, chip awarding, and game-ending decisions. section 10.4.2
A safer strategy
A player who has accumulated enough chips to win can stop instead of risking another roll. A human-versus-computer version can give the computer rules for stopping when its current chips are valuable or sufficient to win. section 10.5
Figure 10.5 Player turn in Bogart
The player-turn flowchart helps trace the choices, rolls, failed turns, payouts, and stopping points before translating them into functions. section 10.4.1
