Paper Scissor Rock [Python][Updated!] 02-13-2013, 02:32 PM
#1
Code:
from random import choice
choices = ['Paper', 'Scissor', 'Rock']
print('Welcome to Paper-Scissor-Rock Game')
user_name = input('Please enter your good name: ')
print('Welcome', user_name, '!')
print('Pick your choice')
print('''Your Choice:
1) Paper
2) Scissor
3) Rock
''')
user_choice = input('Your choice (Type the word): ')
pc_choice = choice(choices)
print(user_choice)
print(pc_choice)
if pc_choice == 'Paper' and user_choice == 'Scissor':
print('Sissor busts Paper', user_name, 'wins!')
elif pc_choice == 'Scissor' and user_choice == 'Paper':
print('Scissor busts Paper, PC wins! SHAME ON YOU!')
elif pc_choice == 'Scissor' and user_choice == 'Rock':
print('Rock beats Scissor', user_name, 'wins!')
elif pc_choice == 'Rock' and user_choice == 'Scissor':
print('Rock beats Scissor, PC wins!')
elif pc_choice == 'Rock' and user_choice == 'Paper':
print('Paper beats Rock', user_name, 'wins!')
elif pc_choice == 'Paper' and user_choice == 'Rock':
print('Rock beats Paper PC wins!')
elif pc_choice == user_choice:
print('Great Minds think alike ;)')
Here's my updated code, First one was too simple. This time I've added a score system and repeating menu so that you don't have to quit and lauch the app again
![Smile Smile](https://sinister.ly/images/smilies/set/smile.png)
Code:
import random
from random import choice
user_score = 0
pc_score = 0
usr_choice = ['paper', 'scissor', 'rock']
user_name = input('Please enter your good name: ')
print('Welcome', user_name, '!')
stat = True
while stat:
print('Welcome to Paper Scissor and Rock Game')
print('Your Score is: ', user_score)
print('PC score is: ', pc_score)
print('Choose your pick: Paper, Scissor or Rock')
usr_pick = input(': ')
pc_pick = random.choice(usr_choice)
if pc_pick == 'paper' and usr_pick == 'scissor':
print('Scissor beats rock', user_name, 'gets the point')
user_score += 1
elif pc_pick == 'scissor' and usr_pick == 'paper':
print('Scissor tears the Paper and PC get the point')
pc_score += 1
elif pc_pick == 'scissor' and usr_pick == 'rock':
print('Rock crushes the Scissor and', user_name, 'takes the point')
user_score += 1
elif pc_pick == 'rock' and usr_pick == 'scissor':
print('Rock destroyes the scissor PC takes the point')
pc_score += 1
elif pc_pick == 'rock' and usr_pick == 'paper':
print('Paper covers the Rock and', user_name, 'takes the point')
user_score += 1
elif pc_pick == 'paper' and usr_pick == 'rock':
print('Paper Dumps the Rock and PC takes the point!')
pc_score += 1
elif pc_pick == usr_pick:
print('Thats a tie, For fun I will deduct points B-) IMA Boss')
pc_score -= 1
user_score -= 1