Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import math
- import time
- def boot(): #This is the intitial screen when you run the program. It is just a few print statements.
- print """ _____________ _____________
- | | |
- | | |
- | | |
- | | |
- | | |
- |_____________|_____________|
- | | |
- | | |
- | | |
- | | |
- | | |
- |_____________|_____________|
- Welcome to Windows.
- Please wait while we check your peripherals..."""
- def username(): #This is where you input the username and password. If you do not get it right it will ask if you want a hint and it will tell you the right username and password.
- uname = raw_input("Username:")
- password = raw_input("Password:")
- if uname == "stpetersprep" and password == "password":
- print "Logging in..."
- main_system()
- else:
- hint = raw_input("That was incorrect. Do you need a hint?")
- if hint == "yes" or hint == "Yes":
- print "'stpetersprep' is the username and 'password' is the password"
- username()
- elif hint == "no" or hint == "No":
- tryagain = raw_input("Would you like to try again?")
- if tryagain == "yes" or tryagain == "Yes":
- username()
- else:
- restart2 = raw_input("Would you like to restart?")
- elif restart2 == "Yes" or restart2 == "yes":
- boot()
- peripherals()
- else:
- print "Shutting down..."
- def documents(): # This will let you open documents and read them.
- print """
- 1. Short Story
- 2. Poem
- 3. Funny Joke
- 9. Exit"""
- document_choice = int(raw_input("Input your choice."))
- if document_choice == 1:
- print "\nThe quick brown fox jumped over the lazy dog."
- short_story = int(raw_input("\nInput '9' when you are done reading."))
- if short_story == 9:
- documents()
- elif document_choice == 2:
- print """\nLove is like an endless mystery,
- for it has nothing else to explain it."""
- poem_choice = int(raw_input("\nInput '9' when you are done being inspired."))
- if poem_choice == 9:
- documents()
- elif document_choice == 3:
- print """\nWhat do you call a dinosaur with an extensive vocabulary?
- A thesaurus!"""
- joke_choice = int(raw_input("\nWhen you are done laughing, input '9' to exit."))
- if joke_choice == 9:
- documents()
- elif document_choice == 9:
- main_system()
- def pictures(): # This will display some text pictures.
- print """
- 1. Dinosaur
- 2. Elephant
- 3. Camel
- 9. Exit"""
- picture_choice = int(raw_input("Input your choice."))
- if picture_choice == 1:
- print """
- ░▄▄▄▄░
- ▀▀▄██►
- ▀▀███►
- ░▀███►░█►
- ▒▄████▀▀"""
- dinosaur_end = int(raw_input("\nInput '9' when you are done marvelling at this magnificent creature."))
- if dinosaur_end == 9:
- pictures()
- elif picture_choice == 2:
- print """
- ──███▅▄▄▄▄▄▄▄▄▄
- ─██▐████████████
- ▐█▀████████████▌▌
- ▐─▀▀▀▐█▌▀▀███▀█─▌
- ▐▄───▄█───▄█▌▄█"""
- elephant_end = int(raw_input("\nInput '9' when you are done being amazed by this beautiful specimen."))
- if elephant_end == 9:
- pictures()
- elif picture_choice == 3:
- print """
- ───▄██▄─██▄───▄
- ─▄██████████▄███▄
- ─▌████████████▌
- ▐▐█░█▌░▀████▀░░
- ░▐▄▐▄░░░▐▄▐▄░░░░"""
- camel_end = int(raw_input("\nInput '9' after you realize that this is not as good as the other two."))
- if camel_end == 9:
- pictures()
- elif picture_choice == 9:
- main_system()
- def Do_Now(): # This is a simple math formula with a for loop.
- number = raw_input("Input your favorite number.")
- number = int(number)
- for num in range(1,11):
- print math.pow(number,num), "\n is your favorite number to the", num, "power"
- continue
- def plane_game(): # This is a text based game.
- print """You are flying a plane and you see another plane coming at you. You must make a quick decision about which direction to go? You can go up, down, left or right."""
- print "-"*53
- choice=raw_input('Which direction do you go?')
- if choice == "Up" or choice == "up":
- print "You stalling now...\nYou played yourself."
- print "-" * 53
- play_again = raw_input("Do you want to play again?")
- if play_again == "Yes" or play_again == "yes":
- print "-" * 53
- plane_game()
- elif play_again == "No" or play_again == "no":
- exit
- elif choice == "Down" or choice == "down":
- print "You narrowly lived.\nYou Win!"
- print "-" * 53
- exit
- elif choice == "Left" or choice == "left":
- print "You are super dead because you went head on."
- print "-" * 53
- play_again = raw_input("Do you want to play again?")
- if play_again == "Yes" or play_again == "yes":
- print "-" * 53
- plane_game()
- elif play_again == "No" or play_again == "no":
- exit
- elif choice == "Right" or choice == "right":
- print "You clipped each other and now you are plummiting into the ground."
- print "-" * 53
- play_again = raw_input("Do you want to play again?")
- if play_again == "Yes" or play_again == "yes":
- print "-" * 53
- plane_game()
- elif play_again == "No" or play_again == "no":
- exit
- else:
- print "That was not a valid direction."
- print "-" * 53
- play_again = raw_input("Do you want to play again?")
- if play_again == "Yes" or play_again == "yes":
- print "-" * 53
- plane_game()
- elif play_again == "No" or play_again == "no":
- exit
- def lunch(): # This is the student life program that uses if statements to tell you what you can get for lunch.
- money0 = "I hope you brought a lunch."
- money1 = "You can get a muffin or something.\n\n"
- money2 = "You can get one slice of pizza at Lisbon's for 2 dollars\n\n"
- money3 = "You can get a Taylor Ham, Egg and Cheese or Bacon Egg and Cheese at Gotham for 3 dollars. No drink tho.\n\n"
- money4 = "You can get two slices of pizza at Lisbon's. Also, you can get a Taylor Ham, Egg and Cheese at Legal Ground (much better than the commons) for 4 dollars.\n\n"
- money5 = "You can get a student special at Lisbon's (two slices of pizza and a drink) or you can get a Cheesesteak and a water at Gotham for 5 dollars.\n\n"
- money6 = "You can get a Cheeseburger Deluxe at Gotham with a bottle of water or you can also get many of the sandwiches at Gotham. Also, you can get 2 Sicilian Slices at Lisbon's for 6 dollars.\n\n"
- money7 = "You can get a Chicken Parm Sandwich at Milano's (Try it spicy)for $6.25.\n\n"
- money10 = "If it's friday you can get Calamari over Spaghetti at Milano's for $9.25. If it's not friday just get one of the other things.\n\n"
- money = raw_input("How much money (in dollars) do you have in your wallet?")
- money = float(money)
- if money <= 0:
- print money0
- elif money <= 1.99:
- print money1, "You need more money, bro."
- elif money <= 2:
- print money1, "or", money2
- elif money <= 3:
- print money1, "or", money2, "or", money3
- elif money <= 4:
- print money1, "or", money2, "or", money3, "or", money4
- elif money <= 5:
- print money1, "or", money2, "or", money3, "or", money4, "or", money5
- elif money <= 6:
- print money1, "or", money2, "or", money3, "or", money4, "or", money5, "or", money6
- elif money <= 6.25:
- print money1, "or", money2, "or", money3, "or", money4, "or", money5, "or", money6, "or", money7
- elif money <= 9.25:
- print money10, money1, "or", money2, "or", money3, "or", money4, "or", money5, "or", money6, "or", money7
- elif money <= 99999999999999999999999999999999999999999999999999999999999999999:
- print "You are just balling out, dude. Go get two lunches or something."
- def growth(): # This is a simple input and output with a math equation for exponential growth.
- initial_population = float(raw_input("Input the Principle"))
- rate_of_growth = float(raw_input("Input the rate of growth"))
- for num in range(1,27):
- print "The value after", num, "years is", initial_population*math.e**(rate_of_growth*num)
- def games(): #This opens a menu for games.
- print """
- 1. Plane Game
- 2. Favorite Number Game
- 9. Exit"""
- game_choice = int(raw_input("Input your choice."))
- if game_choice == 1:
- plane_game()
- plane_choice = int(raw_input("\nInput '1' if you want to play again. Input '9' to exit"))
- if plane_choice == 1:
- plane_game()
- if plane_choice == 9:
- games()
- elif game_choice == 2:
- Do_Now()
- donow_choice = int(raw_input("\n Input '1' if you want to play again. Input '9' to exit."))
- if donow_choice == 1:
- Do_Now()
- elif donow_choice == 9:
- games()
- elif game_choice == 9:
- main_system()
- def tools(): # This opens a menu for tools.
- print """
- 1. Lunch
- 2. Exponential Growth
- 9. Exit"""
- tools_choice = int(raw_input("Input your choice."))
- if tools_choice == 1:
- lunch()
- lunch_choice = float(raw_input("\nInput '9' to exit."))
- if lunch_choice == 9:
- tools()
- elif tools_choice == 2:
- growth()
- growth_choice = float(raw_input("\nInput '9' to exit."))
- if growth_choice == 9:
- tools()
- elif tools_choice == 9:
- main_system()
- def task_manager(): # This shows you the tasks that are running and allows you to remove tasks from the list.
- tasks = ["Google Chrome", "CS:GO", "Photoshop", "Discord"]
- print """
- These are the programs that are running:
- 1. Google Chrome
- 2. CS:GO
- 3. Photoshop
- 4. Discord"""
- task_manager_question = int(raw_input("\nWhich program would you like to close? Input '9' to close all programs."))
- if task_manager_question == 1:
- tasks.pop(0)
- print "\nNow these tasks are open", tasks
- tasks_1 = int(raw_input("Input '9' to go back to the main menu."))
- if tasks_1 == 9:
- main_system()
- elif task_manager_question == 2:
- tasks.pop(1)
- print "\nNow these tasks are open", tasks
- tasks_2 = int(raw_input("Input '9' to go back to the main menu."))
- if tasks_2 == 9:
- main_system()
- elif task_manager_question == 3:
- tasks.pop(2)
- print "\nNow these tasks are open", tasks
- tasks_3 = int(raw_input("Input '9' to go back to the main menu."))
- if tasks_3 == 9:
- main_system()
- elif task_manager_question == 4:
- tasks.pop(3)
- print "\nNow these tasks are open", tasks
- tasks_3 = int(raw_input("Input '9' to go back to the main menu."))
- if tasks_3 == 9:
- main_system()
- elif task_manager_question == 9:
- print "\nNow you have no tasks open"
- tasks_9 = int(raw_input("Input '9' to go back to the main menu."))
- if tasks_9 == 9:
- main_system()
- def power_options(): # This is a power options menu which will bring you to different functions.
- print """
- 1. Log Off
- 2. Restart
- 3. Shut Down
- 9. Exit"""
- power_choice = int(raw_input("Input your choice."))
- if power_choice == 1:
- username()
- elif power_choice == 2:
- boot()
- peripherals()
- elif power_choice == 3:
- print "Shutting down..."
- quit
- elif power_choice == 9:
- main_system()
- def main_system(): # This is the main system which gives you a menu which lets you open other menus.
- print """\nWelcome back, 'stpetersprep'.
- 1. Documents
- 2. Pictures
- 3. Games
- 4. Tools
- 5. Task Manager
- 9. Power Options"""
- options = int(raw_input("Input your choice."))
- if options == 1:
- documents()
- if options == 2:
- pictures()
- if options == 3:
- games()
- if options == 4:
- tools()
- if options == 5:
- task_manager()
- if options == 9:
- power_options()
- boot()
- print "\n", "=" *54
- def peripherals(): # This is where the system checks for your peripherals. It uses the random module to randomly see if your mouse, keybaord and monitor are connected. This uses the time module to display some of the print statements shortly after one another.
- mouse = random.randint(1, 11)
- if mouse <= 8:
- mouse = 1
- time.sleep(1)
- print "\nMouse: %s" % "Connected"
- else:
- mouse = 2
- time.sleep(1)
- print "\nMouse: %s" % "Disconnected"
- keyboard = random.randint(1,11)
- if keyboard <= 8:
- keyboard = 1
- time.sleep(1)
- print "\nKeyboard: %s" % "Connected"
- else:
- keyboard = 2
- time.sleep(1)
- print "\nKeyboard: %s" % "Disconnected"
- monitor = random.randint(1, 11)
- if monitor <= 9:
- monitor = 1
- time.sleep(1)
- print "\nMonitor %s\n" % "Connected"
- else:
- monitor = 2
- time.sleep(1)
- print "\nMonitor not connected.\n \nYou can't even see this right now.\n"
- if mouse == 1 and keyboard == 1 and monitor == 1:
- print "Your peripherals are connected... Please enter your username and password\n"
- username()
- elif mouse == 2 or keyboard == 2 or monitor == 2:
- print "Your peripherals are not connected, please restart.\n"
- restart = raw_input("Would you like to restart?")
- if restart == "Yes" or restart == "yes":
- print "\n" * 5
- boot()
- peripherals()
- else:
- print "Shutting down..."
- peripherals()
- # I did this whole thing Angus did a seperate one.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement