Git Product home page Git Product logo

cssi-5.4-python-dice-roll's Introduction

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

View DICE ROLL APP on Learn.co and start learning to code for free.

cssi-5.4-python-dice-roll's People

Contributors

fislabstest avatar norahsolo avatar sarogers avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.