0

I have a project due at the end of the quarter. This is my first quarter in programming and we have to create a single player game with at least three modules.

I want the game to ask the user to choose heads or tails, then a coin flips and chooses either one randomly.

If you get three in a row you win, if the coin doesnt match your decision you lose. Once you win or lose the game should restart. Does anyone think the can help me?:icon_question:

3
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by vegaseat
0

I'll upload what I have so far. I have a flow chart im trying to convert it into python code

0

I assume when you say methods you mean functions, otherwise you have to set up a class with three methods. For a small program like this functions would suffice, however a class would be a good exercise.

Anyway you can figure out the likelihood of the user succeeding by running this little test program ...

import random as rn

for k in range(16):
    print rn.choice(['heads', 'tails'])

Edited by vegaseat: test

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.