Ethan H.

asked • 02/19/21

Guessing a random number when you roll a dice

Play a simple game of guess closest to the dice roll. You guess a number between 6 and 30, you randomly roll 5D6 dice (which means roll 6 sided dice, 5 five times).

  1. If you guess within 3 of the random number without going over, print a statement indicating you are in range along with the value rolled and your guess.
  2. If you guess within 2 of the random number without going over, print a statement indicating you are getting closer along with the value rolled and your guess.
  3. If you guess within 1 of the random number without going over, print a statement indicating you are so close along with the value rolled and your guess.
  4. If you guess equals the random number without going over, print a statement indicating bingo you guessed correctly, with the value rolled and your guess.
  5. Any other result you will print a statement indicating you not close or you went over and the value rolled and your guess.


1 Expert Answer

By:

Patrick B. answered • 02/19/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Ethan H.

thank you
Report

02/19/21

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.