Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

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")
        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.


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!