[Tutor] Craps game was: Re: (no subject)

Alan Gauld alan.gauld at yahoo.co.uk
Thu Nov 5 04:46:59 EST 2020


On 05/11/2020 02:01, Kaniz Sumiya wrote:
> I need to make a scraps game with these guidelines:
> 
> 
> import random
> money = 100
> Ask user if they want to play or "QUIT" (.upper())
> while game != "QUIT":
> 2 dice generate random numbers 1-6 on each (generate random
> numbers inside while loop)
> Every roll cost $3
> Win $5 if total is 7
> Win $10 for snake eyes
> Else display " Craps"
> Ask user if they want to play or "QUIT"
> if money<3
> game ="QUIT"
> Print money

That all looks clear enough.
I assume you want to write it in Python? If so why not
start translating the above pseudo code into real python
code.

If you get stuck ask us a question.
If you do that include the code you have written,
any error messages you get(in full) and tell us the
Python version and OS you are using.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list