Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2015
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.41 KB | None | 0 0
  1. # computer will askusers name[x]
  2. # user will be asked to pick either rock , paper or sicssors[x]
  3. # create a list that stores rock,paper or scicssors[x]
  4. #Create a score board[x]
  5. # create random for which computer will choose[x]
  6. #user will input either rock,paper or sissors[X]
  7. #computer will generate random option to counter[X]
  8. #if the user loses ask to play again
  9. #if user win ask to play again or finished and show the score
  10. #if user draws ask to pick again
  11.  
  12. import random
  13.  
  14. user = ''
  15. print('Hello there what is your name? ')
  16. user = input().lower()
  17.  
  18.  
  19. print('Hello,' + user + '. This the rock,paper,scissors game.\nLets start. '\
  20.       '\nrock , paper or scissors? ')
  21. #user = input().lower()
  22.  #in ('stop','exit')
  23. game = ['rock','paper','scissors']
  24. random_pick = random.choice(game)
  25. score = 0
  26. pcscore = 0
  27. while True:
  28.     user = input()
  29.     if user == 'Stop' or user == 'n':
  30.         break
  31.     if user == 'rock' and random_pick == 'rock':
  32.         score +=0
  33.         pcscore +=0
  34.         print('It is a draw')
  35.         print('Would you like to try again? ')
  36.         user = input()
  37.         if user == 'y':
  38.             print('rock paper or scissors?')
  39.             user = input()
  40.  
  41.         if user == 'rock' and random_pick == 'scissors':
  42.         score +=1
  43.         pcscore -=1
  44.         print('you smashed the scisssors')
  45.     elif user== 'rock' and random_pick == 'paper':
  46.         score -=1
  47.         pcscore +=1
  48.         print('the paper blinds you')
  49.     #if user picks paper
  50.     if user == 'paper' and random_pick == 'rock':
  51.         score +=1
  52.         pcscore -=1
  53.         print('You blind the rock with your mighty shield')
  54.     elif user == 'paper' and random_pick == 'scissors':
  55.         score -=1
  56.         pcscore +=1
  57.         print('You have been shredded')
  58.     elif user == 'paper' and random_pick == 'paper':
  59.         score +=0
  60.         pcscore +=0
  61.         print('Meh nothing special happened')
  62.     # if user picks scissors
  63.     if user.lower() == 'scissors' and random_pick == 'rock':
  64.         score -=1
  65.         pcscore +=1
  66.         print('Oh that must hurt')
  67.     elif user == 'scissors' and random_pick == 'scissors':
  68.         score +=0
  69.         print('If you know what I mean :P')
  70.     elif user == 'scissors' and random_pick == 'paper':
  71.         score +=1
  72.         pcscore -=1
  73.         print('You left that paper into pieces')
  74. print ('Good bye\n' + 'your score '+str(score) + '\ncomputer score '+str(pcscore))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement