Modify Dice Doubles so that it uses at least three functions. The first function is "main". The second function should be called "roll_one_die". It should pick a random integer from 1 to 6 and return its value.
The final function should be some sort of ending to display when the
program ends. It may be called whatever you like and shouldn't return
anything (that is, its return type should be void
).
DICE BLOWOUT WITH FUNCTIONS! Roll #1: 3 Roll #2: 5 The total is 8! Roll #1: 6 Roll #2: 1 The total is 7! Roll #1: 2 Roll #2: 5 The total is 7! Roll #1: 1 Roll #2: 1 The total is 2! You got doubles! [some sort of ending] This is the end, beautiful friend. This is the end, my only friend. The end of everything that stands, The end of our elaborate plans. This is the way the dice blowout ends; not with a bang but a whimper.
©2013 Graham Mitchell
This assignment is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.