Giter VIP home page Giter VIP logo

flying-circus-game's Introduction

flying-circus-game

#beginner code for random number game

import random random_number = random.randint(0,10) tries = 0 tries_remaining = 10 print(random_number)

while tries < 10: guess = input("guess 1 to 9.") tries += 1 tries_remaining -= 1

try: guess_num = int(guess) except: print("whole number doof") break

if not guess_num > 0 or not guess_num < 10: 
    print("can you count?")   
break

else guess_num == random_number:
    print("Bingo, got it!")
    print("you used {} tries.".format(tries))
user_input = input(")

if user_input == "!":
    print("type ! to exit cowboy")   
break


else guess_num < random_number:
    if tries_remaining > 0:
    print("too low, go higher!  {} tries left.".format(int(tries_remaining)))
    continue
else:
  print("waaaa waah! {}".format(random_number))
  print("2 oz sparrows don't carry coconuts, try again")


else guess_num > random_number:
    if tries_remaining > 0:
    print("noooo! go lower! {} tries remaining.".format(int(tries_remaining)))
    continue
else:
    print("BZZZZT! you lose, the number was {}".format(random_number))
    print("nothing but a mere flesh wound, try again")

user_input = input(") if user_input == "!": print("type ! to run away if you feel repressed")
break

flying-circus-game's People

Contributors

bruinj1968 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.