-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
58 lines (49 loc) · 1.15 KB
/
main.py
File metadata and controls
58 lines (49 loc) · 1.15 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
# author @aesha98
# Day 4: Rock Paper Scissor Game
# IMPORTANT RULES:
# - Rock win against Scissors
# - Scissors win against Paper
# - Paper win against Rock
# randomisation and list
import random
#display program
user_input = int(input("What do you choose?:\n - 0 for Rock\n - 1 for Paper\n - 2 for Scissors.\n"))
# ascii representation
rock = '''
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
'''
paper = '''
_______
---' ____)____
______)
_______)
_______)
---.__________)
'''
scissors = '''
_______
---' ____)____
______)
__________)
(____)
---.__(___)
'''
game = [rock, paper, scissors]
computerInput = random.randint(0,2)
if((user_input == 0 and computerInput == 2) or (user_input == 1 and computerInput == 0) or (user_input == 2 and computerInput == 1)):
print(game[user_input] + "\n")
print(game[computerInput] + "\n")
print("You Win")
elif(user_input == computerInput):
print(game[user_input] + "\n")
print(game[computerInput] + "\n")
print("It's a tie")
else:
print(game[user_input] + "\n")
print(game[computerInput] + "\n")
print("You lose. Game Over.")