Dice Game (Chapter 22)
The dice game in Chapter 22 is a good example of a Finite State Machine controlling a Datapath.
- The combined FSM/Datapath implement a Dice Game.
Dice Game Rules:
- After 1st roll of dice, player wins if roll if 7 or 11. Player loses if roll is 2, 3 or 12. Anything else is saved as the players “POINT”.
- On subsequent rolls, player loses if roll is a 7. Player wins if the dice roll is equal to their “POINT”. You must keep rolling until you win or lose.