-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.py
63 lines (45 loc) · 1.7 KB
/
game.py
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
#!/bin/python3
from ast import Break
from random import randint
def ComputerMugging():
while True:
playerChoice = input(WillSmith)
if playerChoice == ("Wallet"):
print ("Thanks Bud, good choice. *Walks away*")
break
elif playerChoice != ("Wallet"):
print ("I didn't ask for", playerChoice + "!" " Show me your wallet!")
#create a list of play options
t = ["Rock","Paper","Scissors","Gun"]
WillSmith = "Rock, Paper, Scissors?\nType your shit here: "
pandoraBox = False
while True:
#set playerChoice to True
playerChoice = input(WillSmith)
if not playerChoice in t:
print ("That didn't work! You could have typed Gun for all I care!")
continue
computer = t[randint(0,3 if pandoraBox else 2)]
if playerChoice == computer:
print("Tie!")
elif computer == "Gun":
print("Computer shows Gun and insists you choose wallet.")
ComputerMugging()
elif playerChoice == "Rock":
if computer == "Paper":
print("You lose!", computer, "covers", playerChoice)
else:
print("You win!", playerChoice, "smashes", computer)
elif playerChoice == "Paper":
if computer == "Scissors":
print("You lose!", computer, "cut", playerChoice)
else:
print("You win!", playerChoice, "covers", computer)
elif playerChoice == "Scissors":
if computer == "Rock":
print("You lose...", computer, "smashes", playerChoice)
else:
print("You win!", playerChoice, "cut", computer)
elif playerChoice == "Gun":
print("Computer brought", computer, "to a gun fight")
pandoraBox = True