Categories
coding python

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

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 ()

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.

pflynt's avatar

By pflynt

My sense of humour is absurdist, inwardly bleak, caustic and morose, self-referential, rebellious and defiant, even in some cases sadistic, but overall sincere and even in the tragedies, hopeful.

Leave a comment

Design a site like this with WordPress.com
Get started