Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # computer will askusers name[x]
- # user will be asked to pick either rock , paper or sicssors[x]
- # create a list that stores rock,paper or scicssors[x]
- #Create a score board[x]
- # create random for which computer will choose[x]
- #user will input either rock,paper or sissors[X]
- #computer will generate random option to counter[X]
- #if the user loses ask to play again
- #if user win ask to play again or finished and show the score
- #if user draws ask to pick again
- import random
- user = ''
- print('Hello there what is your name? ')
- user = input().lower()
- print('Hello,' + user + '. This the rock,paper,scissors game.\nLets start. '\
- '\nrock , paper or scissors? ')
- #user = input().lower()
- #in ('stop','exit')
- game = ['rock','paper','scissors']
- random_pick = random.choice(game)
- score = 0
- pcscore = 0
- while True:
- user = input()
- if user == 'Stop' or user == 'n':
- break
- if user == 'rock' and random_pick == 'rock':
- score +=0
- pcscore +=0
- print('It is a draw')
- print('Would you like to try again? ')
- user = input()
- if user == 'y':
- print('rock paper or scissors?')
- user = input()
- if user == 'rock' and random_pick == 'scissors':
- score +=1
- pcscore -=1
- print('you smashed the scisssors')
- elif user== 'rock' and random_pick == 'paper':
- score -=1
- pcscore +=1
- print('the paper blinds you')
- #if user picks paper
- if user == 'paper' and random_pick == 'rock':
- score +=1
- pcscore -=1
- print('You blind the rock with your mighty shield')
- elif user == 'paper' and random_pick == 'scissors':
- score -=1
- pcscore +=1
- print('You have been shredded')
- elif user == 'paper' and random_pick == 'paper':
- score +=0
- pcscore +=0
- print('Meh nothing special happened')
- # if user picks scissors
- if user.lower() == 'scissors' and random_pick == 'rock':
- score -=1
- pcscore +=1
- print('Oh that must hurt')
- elif user == 'scissors' and random_pick == 'scissors':
- score +=0
- print('If you know what I mean :P')
- elif user == 'scissors' and random_pick == 'paper':
- score +=1
- pcscore -=1
- print('You left that paper into pieces')
- print ('Good bye\n' + 'your score '+str(score) + '\ncomputer score '+str(pcscore))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement