Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.57 KB | None | 0 0
  1. from random import randint
  2. import os
  3.  
  4. def menu():
  5.     #Clear the screen, windows skrubs be needin' cls
  6.     os.system('clear')
  7.     print '**Rock Paper Sissors**\n\n1)Rock\n2)Paper\n3)Sissors'
  8.     return
  9.  
  10. while(True):
  11.     menu()
  12.     options = ('Rock', 'Paper', 'Sissors')
  13.     cpu = randint(0, 2)
  14.     try:
  15.         player = int(raw_input('Input an option> '))
  16.     except:
  17.         print 'Have you been blazin\' it m8? It asked for numbers not letters!'
  18.         raw_input('\nPress enter to continue...')
  19.         continue
  20.    
  21.     #Glorious if statements!
  22.     if ((player < 1) or (player > 3)):
  23.         print 'You didn\'t put in valid input you fucking skrub 1v1 me'
  24.     else:
  25.         print '\nYou chose {}'.format(options[player - 1])
  26.    
  27.     if (cpu == 0):
  28.         if (player == 1):
  29.             print 'Computer chose: {}\nTie!'.format(options[cpu])
  30.         elif (player == 2):
  31.             print 'Computer chose: {}\nWin!'.format(options[cpu])
  32.         elif (player == 3):
  33.             print 'Computer chose: {}\nRek\'d!'.format(options[cpu])
  34.    
  35.     elif (cpu == 1):
  36.         if (player == 1):
  37.             print 'Computer chose: {}\nRek\'d!'.format(options[cpu])
  38.         elif (player == 2):
  39.             print 'Computer chose: {}\nTie!!'.format(options[cpu])
  40.         elif (player == 3):
  41.             print 'Computer chose: {}\nWin!'.format(options[cpu])
  42.    
  43.     elif (cpu == 2):
  44.         if (player == 1):
  45.             print 'Computer chose: {}\nWin!'.format(options[cpu])
  46.         elif (player == 2):
  47.             print 'Computer chose: {}\nRek\'d!!'.format(options[cpu])
  48.         elif (player == 3):
  49.             print 'Computer chose: {}\nTie!'.format(options[cpu])
  50.    
  51.     #Get yo errors outta here
  52.     else:
  53.         print 'Something went wrong'
  54.            
  55.     raw_input('\nPress enter to continue...')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement