first time coding in python on ios: Guess My Number (rated M: language)

Published June 14, 2018
Advertisement

So I used python 3 for ios on my ipad to do part one of this assignment.

Part One: create a guess my number game:

numSpecial = 0
time = 0
guesses = 0
g = 0
i = 0
import random
numSpecial= random.randint(1,9)
print ("guess my nmber, biatch! between 1 and 10")
while g!= numSpecial:
    time = time + 1
    if time > 5:
        print ("you took too long, loser")
    elif g > numSpecial:
        print ("too high, shithead")
        guesses = guesses + 1
    elif g < numSpecial:
        print ("too low, asshole")
        guesses = guesses + 1
    elif guesses > 10:
        print ("I have had enough of your shit")
    else:
        print ("you found an error")
    g = int(input("what is your guess?"))
    if g == numSpecial:
        print ("you guessed right, you are not as stupid as I thought.")
        i = input ()
cleardot.gif
 
Part Two: figure out where in the program the computer recognises time and place a time limit on the game.
 
And no it doesn't have an ending because I haven't covered ending a program in the text yet.
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement