🚀 Basics Day 4: In-Class Exercises 🚀

Pre-Class In-Class

Base: Multi-Dice Game

More dice rolling and guessing!

  1. Create a dice-guessing game with a variable number of dice rolls determined by the user.
  2. The game will have 2 modes.
  3. In the 1st mode, the user will enter the number of dice they wish to roll.
  4. In the 2nd mode, the user will enter a guess that will apply to all dice rolls. For example, if the user has chosen to roll 2 dice in Mode 1 and guesses 4 in Mode 2, that guess of 4 will apply to both Dice 1 and Dice 2.
  5. After the user guesses, the program will run a loop where the number of iterations is the number of dice rolls from Mode 1. Each loop iteration will roll a dice and verify if the user has won.
  6. If the user guesses correctly for any of the dice rolls, the user wins.
  7. The game keeps track of and outputs the overall win-loss record.

Input:


Output:

More Comfortable: Multi-Round Multi-Dice Game

  1. Alter the previous multi-dice game such that the user plays 4 rounds in the 2nd mode.
  2. After the user enters their guess in Mode 2, the program enters a loop that runs 4 rounds.
  3. Within each round the game will roll the number of dice the user specified and compare them with the single user guess.
  4. If the user guessed correctly for any dice rolls in a round, they win that round.
  5. The game will continue to output overall win-loss record, where each of the 4 rounds count as wins or losses.

Input:


Output:

More Comfortable: Two Player Multi-Round Multi-Dice Game

  1. Change the game to support 2 players, starting with Player 1.
  2. The gameplay follows the multi-round multi-dice game above. After each player's turn, that player will have won between 0 and 4 rounds, because each player plays 4 rounds per turn.
  3. The game alternates between players indefinitely and outputs win-loss record for each player.

Input:


Output:

More Comfortable: Multi-Player Multi-Round Multi-Dice Game

Change the game to ask how many players are playing the game. Players will take turns playing the game as above.


Input:


Output: