-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRPSLS
More file actions
75 lines (72 loc) · 2.97 KB
/
RPSLS
File metadata and controls
75 lines (72 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
'''Julia Marden
9/3/17
CMPT100
My first program'''
import random
name=input('Hi, what is your name? ')
assert isinstance(name, str )
print ()
if name == 'Julia' or name == 'Marymelon':
print('Welcome to the monkey house')
elif name == 'Keefer':
print('Goodbye, blue Monday')
elif name == 'Nick' or name == 'Anton':
print('Get swell')
print('Hello', name)
abc=input('Would you like to play rock, paper, scissors, lizard Spock?(Y/N) ')
if abc == 'Y':
player=input('Great, you go first ')
if player == 'rock' or player == 'paper' or player == 'scissors' or player == 'lizard' or player == 'Spock':
computer_choice = random.choice(['rock', 'paper','scissors', 'lizard', 'Spock'])
print('I chose' , computer_choice, 'and you chose', player)
if player == computer_choice :
print('We tied!')
elif player == 'rock':
if computer_choice == 'paper':
print('I win,', computer_choice, 'covers', player)
elif computer_choice == 'lizard':
print('You win,', player, 'crushes', computer_choice)
elif computer_choice == 'Spock':
print('I win,', computer_choice, 'vaporizes', player)
else:
print('You win,', player,'smashes', computer_choice)
elif player == 'paper':
if computer_choice == 'rock':
print('You win,', player, 'covers', computer_choice)
elif computer_choice == 'Spock':
print('You win,', player, 'disproves', computer_choice)
elif computer_choice == 'scissors':
print('I win,', computer_choice, 'cuts', player)
else:
print('I win,', computer_choice,'eats', player)
elif player == 'scissors':
if computer_choice == 'paper':
print('You win,', computer_choice, 'cuts', player)
elif computer_choice == 'lizard':
print('You win,', player, 'decapitates', computer_choice)
elif computer_choice == 'Spock':
print('I win,', computer_choice, 'vaporizes', player)
else:
print('I win,', computer_choice,'smashes', player)
elif player == 'lizard':
if computer_choice == 'paper':
print('I win,', computer_choice, 'eats', player)
elif computer_choice == 'scissors':
print('I win,', computer_choice, 'decapitates', player)
elif computer_choice == 'Spock':
print('You win,', computer_choice, 'posions', player)
else:
print('You win,', computer_choice,'crushes', player)
elif player == 'Spock':
if computer_choice == 'paper':
print('I win,', computer_choice, 'disproves', player)
elif computer_choice == 'lizard':
print('I win,', player, 'posions', computer_choice)
elif computer_choice == 'rock':
print('You win,', player, 'vaporizes', computer_choice)
else:
print('You win,', player,'smashes', computer_choice)
elif abc == 'N':
print('I do not like what you got')
else:
print("I can't hear you")