Skip to content

GeneralOneill/diceroll

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

languages tags
python
functions, random, looping

DICE ROLL APP

Instructions

Open the dice_roll.py file and run it. It should roll two dice five times, printing the rolls of each pair. Look at the code and get familiar with it. You will modify this program in three ways:

  1. Rather than rolling the dice a fixed number of times (like the original version does), we now want to keep rolling the dice until we hit double sixes. The program should stop as soon as it rolls the first double sixes.

  2. You should make the program print something when it rolls either two ones or two sixes.

  3. Rather than telling the user how many times we will roll the dice, tell the user how many dice rolls it took to hit double sixes.

The output of your program should look something like this:

$ python dice_roll.py
Rolls: 2 1
Rolls: 1 4
Rolls: 3 1
Rolls: 6 1
Rolls: 1 3
Rolls: 1 3
Rolls: 1 1
Got snake eyes!
Rolls: 4 6
Rolls: 4 1
Rolls: 3 1
Rolls: 4 2
Rolls: 4 1
Rolls: 4 4
Rolls: 6 4
Rolls: 3 6
Rolls: 3 1
Rolls: 5 4
Rolls: 2 6
Rolls: 6 6
Got double sixes!
Rolled the dice 19 times

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%