Advertisement
Guest User

Project 1

a guest
Apr 7th, 2016
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 7.14 KB | None | 0 0
  1. #!/usr/bin/python
  2. import string
  3. import math
  4. import random
  5. import time
  6. # this is the boot up sequence for the computer
  7. def bootup():#The boot up function was made by Chris
  8.   print "-" * 56
  9.   print "                         Welcome!"
  10.   print "                   Starting up Computer!"
  11.  
  12.   waiting = "                         waiting..."
  13.   print " "
  14.   print waiting
  15.   time.sleep(0.5)
  16.   print waiting
  17.   time.sleep(0.5)
  18.   print waiting
  19.   time.sleep(0.5)
  20.   print " "
  21.   print "                     Keyboard Found!"
  22.   time.sleep(1)
  23.   print "                       Mouse Found!"
  24.   time.sleep(1)
  25.   print "                    Hard drive Found!"
  26.   time.sleep(1)
  27.   print "                      Monitor Found!"
  28.   time.sleep(1)
  29.   print "                        GPU Found!"
  30.   time.sleep(1)
  31.   print "                        CPU Found!"
  32.   time.sleep(1)
  33.   print " "
  34.   print "                  Starting Login Screen!"
  35. bootup()
  36. # this is the username and password setup for the computer
  37. def userpassword():
  38.   print "-" * 56
  39.   print "Hello!"
  40.   print " "
  41.   print "Please insert username:"
  42.   username = raw_input()
  43.   password = raw_input("Please insert password:(Hint: What year is it?)")
  44.   if password == "2016":
  45.     print "Continuing login process..."
  46.   if password != "2016":
  47.     print "Sorry, but that is incorrect! System shutting down! Please reboot computer!"
  48.     exit(0)
  49. userpassword()
  50. time.sleep(1)
  51. def programs():
  52.   time.sleep(1)
  53.   print "                        Welcome!"
  54.   time.sleep(1)
  55.   print "       Here are a list of programs for you to run:"
  56.   print "          1. Google Chrome"
  57.   print "          2. Happy Leify"
  58.   print "          3. Mozilla Firefox"
  59.   print "          4. System Check"
  60.   print "          5. Log Off"
  61.   print "          6. Shut Down Computer"
  62.   prg = int(raw_input("Please input the number of the program you want to run: "))
  63.   if prg == 1:
  64.     print "Opening Google Chrome..."
  65.     time.sleep(1)
  66.     print "Oops! No WiFi. Sorry, but Saint Peter's WiFi is terrible. Can't open."
  67.     time.sleep(1)
  68.     programs()
  69.   elif prg == 2:
  70.     print "-" * 30
  71.     print "    H A P P Y   L E I F Y "
  72.     print "-" * 30
  73.     print " "
  74.     print "       1. Play Game"
  75.     print "       2. View Credits"
  76.     print "       3. Smoke W33d Evrydae"
  77.     print "       4. MLG"
  78.     print "-" * 30
  79.     print " "
  80.     number = raw_input("Input a number: ")
  81.     number = int(number)
  82.     if number == 1:
  83.       print "Welcome Leif Ericson. Oh, you don't remember? You are the great son of the Red Ericson. You're supposed to be on an adventure, right?\nWell, anywho, you're walking on a trail and come up at a fork in the road. Oh, and there is a fork in the road. You can either turn left or right."
  84.       direction = raw_input("Which way will you go?")
  85.       if direction == "left":
  86.         print "Okay, you take the left path. You come up on a cliff. There is a ladder going up to the top of a cliff. You also notice a cave with a sign stating 'Rainbows and Unicorns Inside!' So there are your choices: either a ladder or a cave."
  87.         direction2 = raw_input("Which way will you go again? (Type ladder or cave)")
  88.         if direction2 == "ladder":
  89.           print "You start climbing up the ladder. When you get to the top, you spot a slide going down back the path. You take the slide down and get back onto the path. As you walk down the path, you manage to find a beach with a bunch of mermaids. Congratz you win!"
  90.           time.sleep(1)
  91.           print "Sending you back to the main menu..."
  92.           time.sleep(1)
  93.           programs()
  94.         elif direction2 == "cave":
  95.           print "Wow! You are really gullible! Did you actually think there were unicorns and rainbows?! Wow... Anywho, you walk in the cave of a pack of lions and get eaten alive. The End. Being gullible loses every game. Please try the game over."
  96.           time.sleep(1)
  97.           print "Sending you back to the main menu..."
  98.           time.sleep(1)
  99.           programs()
  100.       elif direction == "right":
  101.         print "Way to go! You walk straight into a sand pit. For a fierce viking, you're pretty dumb. Please try the game over."
  102.         time.sleep(1)
  103.         print "Sending you back to the main menu..."
  104.         time.sleep(1)
  105.         programs()
  106.     elif number == 2:
  107.       print "Game was made by James Robbins and Nick Demetriades. (And was trash.)"
  108.       time.sleep(1)
  109.       print "Sending you back to the main menu..."
  110.       time.sleep(1)
  111.       programs()
  112.     elif number == 3:
  113.       print "Snoop Dogg: 'Smoke Weed everyday'"
  114.       time.sleep(1)
  115.       print "Sending you back to the main menu..."
  116.       time.sleep(1)
  117.       programs()
  118.     elif number == 4:
  119.       print "DUN DUNDUNDUNDUN DUN"
  120.       time.sleep(1)
  121.       print "Sending you back to the main menu..."
  122.       time.sleep(1)
  123.       programs()
  124.     else:
  125.       print "You suck."
  126.       time.sleep(1)
  127.       print "Sending you back to the main menu..."
  128.       time.sleep(1)
  129.       programs()
  130.   elif prg == 3:
  131.     print "Launching Mozilla Firefox"
  132.     time.sleep(1)
  133.     print "Failure to start Mozilla Firefox. Use a better browser."
  134.     programs()
  135.   elif prg == 4:
  136.     def systemcheck():
  137.       print " "
  138.       print "               Welcome to System Check!"
  139.       print "       Currently, your CPU only 6% of its potential."
  140.       print "         And your disk is only running at 37%."
  141.       print "           Would like to close any programs?"
  142.       print "                  1. Google Chrome"
  143.       print "                  2. Happy Leify"
  144.       print "                  3. Mozilla Firefox"
  145.       print "          If you don't want to just type no."
  146.       systemcheckr = raw_input()
  147.       if systemcheckr == "1":
  148.         print "Closing up Google Chrome..."
  149.         print "Thank you!"
  150.         programs()
  151.       elif systemcheckr == "2":
  152.         print "Closing up Happy Leify..."
  153.         print "Thank you!"
  154.         programs()
  155.       elif systemcheckr == "3":
  156.         print "Closing up Mozilla Firefox..."
  157.         print "Thank you!"
  158.         programs()
  159.       elif systemcheckr == "No" or "no":
  160.         print "Okay, thank you!"
  161.         programs()
  162.     systemcheck()
  163.   elif prg == 5:
  164.     print "Logging off..."
  165.     time.sleep(1)
  166.     userpassword()
  167.     programs()
  168.   elif prg == 6:
  169.     time.sleep(1)
  170.     print "Shutting down computer..."
  171.     time.sleep(1)
  172.     print "Powering off in:"
  173.     count = 0
  174.     while (count < 6):
  175.       print count
  176.       time.sleep(1)
  177.       count = count + 1
  178.     print "Goodnight!"
  179.     exit(0)
  180. programs()
  181.  
  182. #This is our code for the Quarterly. What this program does, it runs a simple
  183. #computer system, using only 6 programs, two of them acting as nothing. For the start up, we
  184. #used a function called bootup that just stated that the computer was starting and
  185. #had found all the hardware necessary for the computer.  
  186. #time.sleep was a code that James had found delays the program for a couple of seconds before running. . After the bootup, we used a function named userpassword specified for the
  187. #username and password. We made the username to be anything, but the password had to be 2016,
  188. #because if not the code would go through an exit(0) and you would have to restart.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement