-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDice.py
More file actions
101 lines (78 loc) · 2.59 KB
/
Dice.py
File metadata and controls
101 lines (78 loc) · 2.59 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import random
choice = input("what game would you like to play? Rock paper scissors or rolling dice? ")
def again():
rematch = input("you wanna play again? yes or no? ")
y = "yes"
n = "no"
if rematch == y:
if choice == "dice":
dice()
elif choice == "rock paper scissors":
rockpaperscissors()
elif rematch == n:
print("play again soon!")
else:
print("uhh...that's not an answer buddy")
again()
def dice():
number = random.randrange(1, 7)
if number == 6:
print("you rolled a 6, yay you! you start the game first!")
winner()
elif number < 6:
print("you rolled a " + str(number) + " try for a 6!")
again()
def winner():
other = input("do you wanna play a different game? ")
if other == "yes" and choice == "dice":
rockpaperscissors()
elif other == "yes" and choice == "rock paper scissors":
dice()
elif other == "no":
replay = input("do you want to play another game of " + choice + "?")
if replay == "yes":
if choice == "rock paper scissors":
rockpaperscissors()
elif choice == "dice":
dice()
elif replay == "no":
print("play again sometime soon!")
# if number < 6:
# again()
# while number < 6:
# dice()
# break
def rockpaperscissors():
hand = ["rock", "paper", "scissors"]
play = random.choice(hand)
player = input("Rock, Paper, Scissors? ")
print("I play " + play)
print("**" * 18)
if player == play:
print("we picked the same thing...")
rockpaperscissors()
elif player == "rock" and play == "paper":
print("paper covers rock I win!")
elif player == "paper" and play == "rock":
print("paper covers rock you win!")
elif player == "rock" and play == "scissors":
print("rock beats scissors you win!")
elif player == "scissors" and play == "rock":
print("scissors beats rock I win!")
elif player == "paper" and play == "scissors":
print("paper is cut by scissors I win!")
elif player == "scissors" and play == "paper":
print("scissors cut up paper you win!")
again()
if choice.lower() == "rock paper scissors":
rockpaperscissors()
elif choice.lower() == "dice":
dice()
def whatgame():
choose = input("what game do you wanna play? ")
choice = choose
if choice == "dice":
dice()
elif choice == "rock paper scissors":
rockpaperscissors()
#] whatgame()