Advertisement
lindskogd

Project 1

Apr 7th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 5.82 KB | None | 0 0
  1. #CODE IS BY DEAN LINDSKOG ONLY
  2. def system2():  
  3.    print "--TASK MANAGER--"
  4.    print "SYSTEM PROCESSES: "
  5.    print " ALL PROCESSES HAVE ALREADY BEEN ENDED"
  6. def computer(): # function that brings the user to the main menu after complete a previous program
  7.    menu()
  8.    choice = raw_input('Enter a number to begin:')
  9.    choice = int(choice)
  10.    if choice == 1 :
  11.      print "Internet Explorer is not able to load correctly- Please Check if you are properly connected to the internet and then restart your computer."
  12.      computer()
  13.    elif choice == 2 :
  14.      system2()
  15.      computer()
  16.    elif choice == 3 :
  17.      Adventuregame()
  18.      computer()
  19.    elif choice == 4 :
  20.      restart()
  21.      computer()
  22.    elif choice == 5 :
  23.      exit()
  24.    elif choice == 6 :
  25.      logoff()
  26.      computer()
  27.    elif choice == 7 :
  28.      app()
  29.      computer()
  30.    elif choice == 8 :
  31.      ng()
  32.      computer()
  33.    else:
  34.      print "Invalid Number - Please try again."
  35. def ng(): # A cup game I created that lets the user guess which number is under the cup
  36.    import random
  37.    print "Welcome to the guessing game! Guess a number that is under the cup!"
  38.    raw_input("Say what number you believe it to be")
  39.    cups = ["Cup 1", "Cup 2","Cup 3"]
  40.    import random
  41.    print random.choice(["Cup 1", "Cup 2","Cup 3"]),
  42.    print "is the correct cup"
  43. def app():
  44.    print "Monitor: CONNECTED | Keyboard : CONNECTED | Mouse: CONNECTED"
  45. def logoff():
  46.    print "Welcome, please type in your correct username or password in order to gain access to the desktop"
  47.    name = raw_input(" Type in your username:")
  48.    password = raw_input(" Type in your password:")
  49.    print ('Welcome %s.') % name
  50.    print (30 * "-")
  51.    computer()
  52. def restart():
  53.   while True:
  54.     while True:
  55.         answer = raw_input('Restart computer? (y/n): ')
  56.         if answer in ('y', 'n'):
  57.             break
  58.         print 'Invalid input.'
  59.     if answer == 'n':
  60.         computer()
  61.     else:
  62.         print '- -R E S T A R T I N G- -'
  63.         break
  64. def system():
  65.    print "--TASK MANAGER--"
  66.    print "SYSTEM PROCESSES: "
  67.    CAD = raw_input("If you would like to end all processes please type CAD")
  68.    if CAD == 'CAD':
  69.      print 'ALL PROCESSES HAVE BEEN ENDED'
  70.    else:
  71.       print "Invalid Input, please try again."
  72. def Adventuregame(): # A program created by me and damion for another project
  73.    print (30 * '-')
  74.    print (" M A I N - M E N U")
  75.    print (30 * '-')
  76.    print ("Welcome to: \n Zombie Survival")
  77.    sav = "for the tough, strong, and the brave"
  78.    zombie = "the dead"
  79.    print "This is a game %s but how can they reach the top while fighting against %s." % (sav, zombie),
  80.    print "All alone in a place where no one can hear you scream but the zombies seeking to eat you alive!!"
  81.    choice = raw_input("Press 1 to start game!")
  82.    choice = int(choice)
  83.    if choice == 1 :
  84.      print ("Starting Game!")
  85.    print ("You begin the game inside of an abandonded farm, what do you do?")
  86.    choice = int(choice)
  87.    print "1. You see a closed door and you decide to approach it"
  88.    print "2. You see an open window and want to look out for an exit"
  89.    print "3. You want to look around the room for a weapon and see what you can find."
  90.    print "4. You Decide you want to look around for a phone and call for help."
  91.    choice = raw_input('Enter your choice [1-4] :')
  92.    choice = int(choice)
  93.    if choice == 1 :
  94.      print " You go to the door and try and open it and find that it is open, a zombie then runs through the door and eats you. \n GAME OVER."
  95.      exit
  96.    elif choice == 2 :
  97.      print " You go over to the window and open it, just as you do a zombie comes from behind you and knocks you out the window to your death. \n GAME OVER"
  98.      exit
  99.    elif choice == 3 :
  100.       print " You find a magnum revolver on the top of a bookshelf,\tjust then a zombie comes and you shoot him just in the nick of time and kill him, you then decide to leave the house in victory \n YOU HAVE WON! CONGRATULATIONS!!."
  101.    elif choice == 4:
  102.      print "You go to the nightstand to look for a phone, just then a zombie underneath the bed grabs your foot and kills you. \n GAME OVER"
  103.      exit
  104.    else:
  105.      print "Invalid Answer"
  106. def menu(): # main menu, once choosin a program and finishing it you are brought back here
  107.   print (30 * '-')
  108.   print (" M A I N - M E N U")
  109.   print (30 * '-')
  110.   print ("1. Launch Internet Explorer")
  111.   print ("2. System Processes")
  112.   print ("3. Adventure Game")
  113.   print ("4. Restart")
  114.   print ("5. Shutdown")
  115.   print ("6. Logoff")
  116.   print ("7. Appliances")
  117.   print ("8. Cup Game")
  118.   print (30 * '-')
  119.   print (30 * "-")
  120. print "-- B O O T I N G --"
  121. print " C H R O M E: OS"
  122. print "- - L O A D I N G- -"
  123. print "Monitor: CONNECTED | Keyboard : CONNECTED | Mouse: NOT CONNECTED"
  124. choice = raw_input("Please Connect the mouse into the USB port, once you have done that press 1 and then restart.")
  125. choice = int(choice)
  126. if choice == 1 :
  127.    print " - - RESTARTING --"
  128. else:
  129.    print "Invalid Input, Please try again"
  130. print "Welcome, please type in your correct username or password in order to gain access to the desktop"
  131. name = raw_input(" Type in your username:")
  132. password = raw_input(" Type in your password:")
  133. print ('Welcome %s.') % name
  134. print (30 * "-")
  135. menu()
  136. choice = raw_input('Enter a number to begin:')
  137. choice = int(choice)
  138. if choice == 1 :
  139.    print "Internet Explorer is not able to load correctly- Please Check if you are properly connected to the internet and then restart your computer."
  140. elif choice == 2 :
  141.    system()
  142.    computer()
  143. elif choice == 3 :
  144.    Adventuregame()
  145.    computer()
  146. elif choice == 4 :
  147.    restart()
  148.    computer()
  149. elif choice == 5 :
  150.    exit()
  151.    computer()
  152. elif choice == 6 :
  153.    logoff()
  154. elif choice == 7 :
  155.    app()
  156.    computer()
  157. elif choice == 8 :
  158.    ng()
  159.    computer()
  160. else:
  161.   print "Invalid Number - Please try again."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement