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

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

WinterDragon

833 views

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 Comments


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
  • Advertisement
  • Blog Entries

  • Similar Content

    • By TheAICodeGuy
      Hello everyone!
      If you couldn't figure it out I'm new here. I've been reviewing jobs regarding AI game programming because I love working on AI systems. A few searches have been well straight forward and I'm grateful for that, but for anybody whose has or who still is currently working as an AI programmer, what skills would you say are necessary? I've learned (and still am learning because well learning and getting BETTER never ends) C and C++. Of course I'll continue to sharpen my skills there as much as possible. I've seen some jobs list python and/or lua in their descriptions. Would you say these extra skills are, I guess, major in the game industry? I know python a bit, but lua I don't really know much at all. 
      However I'm most definitely willing to learn.
      Thank you to anyone willing to give feedback!
    • By kalydos
      Currently I have two creative talents with me on board to work with me for my visual novel dating sim and we are currently looking for a programmer to work with in Ren'py (or another program if that works), minimal pixel art and it would require being able to contribute creatively as well as programming a stat/leveling system, affection system, calendar/scheduling activities system, a minimal sidescrolling exploration system and it would also be nice to have a GUI designer. If any clarification or anyone is on board contact me on discord kalydos#0726
    • By renedudfield
      The pygame book project has begun. It's called "pygame 4000" and is a book project by one of the main contributors of the pygame project.

      Not only does the book aim to cover Python programming, but also aims to cover C, and the GLSL shading language.
      [ Pixel Perfect Collision Detection ] [ SDL2 Fundamentals Tutorial in C ] [ Sound Generation and Visualization ] [ Python intro for game programming ] [ Let's make a shit JavaScript Interpreter! ] [ How to port and market games ] [ Let's write a unit test! ] [ Arduino; Serial & pixels for breakfast ] [ Awesome pygame. Great stuff you can use with pygame. ] pygame 4000 available as an early preview pre-release on the pygame book itch page. Updates will be posted on the pygame book developer web log.
      pygame is the most popular game/art/and music library available for the most popular programming language in the world -- Python. pygame is used in school classes, university courses, and workshops around the world. It's used in embedded devices like handheld game consoles, in video synthesizers, museum displays, and interactive art installations. It's available in over 130 different OS distributions, including on the Raspberry Pi, Ubuntu, and MacOS. All funds from the pygame 4000 book go towards pygame development and improvements to the pygame 4000 book.

      View full story
    • By renedudfield
      The pygame book project has begun. It's called "pygame 4000" and is a book project by one of the main contributors of the pygame project.

      Not only does the book aim to cover Python programming, but also aims to cover C, and the GLSL shading language.
      [ Pixel Perfect Collision Detection ] [ SDL2 Fundamentals Tutorial in C ] [ Sound Generation and Visualization ] [ Python intro for game programming ] [ Let's make a shit JavaScript Interpreter! ] [ How to port and market games ] [ Let's write a unit test! ] [ Arduino; Serial & pixels for breakfast ] [ Awesome pygame. Great stuff you can use with pygame. ] pygame 4000 available as an early preview pre-release on the pygame book itch page. Updates will be posted on the pygame book developer web log.
      pygame is the most popular game/art/and music library available for the most popular programming language in the world -- Python. pygame is used in school classes, university courses, and workshops around the world. It's used in embedded devices like handheld game consoles, in video synthesizers, museum displays, and interactive art installations. It's available in over 130 different OS distributions, including on the Raspberry Pi, Ubuntu, and MacOS. All funds from the pygame 4000 book go towards pygame development and improvements to the pygame 4000 book.
    • By Gomta777
      Hello, I am a Japanese, a novice of the python programming.
      I am currently trying to program games using pygame.
      The progress of the game production can be seen on the following blog and youtube channel.
      https://ko-gaku-jiji.hatenablog.jp/
      (sorry all of my page is written by Japanese)

      I'm trying to make a Tetris-like game right now, but sometimes I'm worried.
      In the process for the Tetris game, such as the process of line erasing, I feel that I can write a program more simply by using multithreading.
      However, I couldn't find a suitable sample for multithreading with pygame.
      If you know, please introduce me a web page with a simple and easy-to-understand sample.
  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!