The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled Python Code
Posted by: Help | July 26, 2010 @ 7:18pm
Python Code
[
Download
]
import random choice = 0 guesses = 0 loop = 1 print "Welcome to the (non-shitty and slightly more advanced) guessing game!" # Basic options, just like in that -boring- calculator I made... print "Please select your difficulty level:" print "1) Easy - Numbers range from one to twenty" print "2) Normal - Numbers range from one to one-hundred" print "3) Hard - Numbers range from one to five-hundred" print "4) Quit, kill the game, you murderer. >:I" print "---------------------------------------------------------" choice = input("Choose your difficulty:") # Durr-durr, won't work without this if choice == 1: print "Now playing on easy mode" print "Current guesses taken:", guesses answer = random.randint(1,20) guess = input("Take a guess:") if guess == answer: print "You win! The answer was", answer else: print "Wrong!" guesses = guesses + 1 choice = 1 elif choice == 2: print "Now playing on normal mode" print "Current guesses taken:", guesses answer = random.randint(1,100) guess = input("Take a guess:") if guess == answer: print "You win! The answer was", answer else: print "Wrong!" guesses = guesses + 1 choice = 2 elif choice == 3: print "Now playing on HARDMAN mode" print "Current guesses taken:", guesses answer = random.randint(1,500) guess = input("Take a guess:") if guess == answer: print "You win! The answer was", answer else: print "Wrong!" guesses = guesses + 1 choice = 3 elif choice == 4: loop = 0 print "Bye!"
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.55 / 8
47 Votes
http://codebin.yi.org/761
page generated in 0.00 seconds