Problem 45

Dice

Write a program that simulates a dice roll by picking a random number from 1-6 and then picking a second random number from 1-6. Add the two values together, and display the total.

HERE COMES THE DICE!

Roll #1: 3
Roll #2: 5
The total is 8!
HERE COMES THE DICE!

Roll #1: 4
Roll #2: 2
The total is 6!

◄ 44: Fortune Cookie 46: One Shot Hi-Lo ►



Adapted from ProgrammingByDoing.com
©2013 Graham Mitchell

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.