-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame.py
More file actions
29 lines (24 loc) · 807 Bytes
/
game.py
File metadata and controls
29 lines (24 loc) · 807 Bytes
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
import random
def dice():
print("game.py - dice")
bot1 = random.randrange(1,7)
bot2 = random.randrange(1,7)
user1 = random.randrange(1,7)
user2 = random.randrange(1,7)
a = bot1 + bot2
b = user1 + user2
if a > b:
return "패배", 0xFF0000, str(bot1), str(bot2), str(user1), str(user2), str(a), str(b)
elif a == b:
return "무승부", 0xFAFA00, str(bot1), str(bot2), str(user1), str(user2), str(a), str(b)
elif a < b:
return "승리", 0x00ff56, str(bot1), str(bot2), str(user1), str(user2), str(a), str(b)
def gamble():
print("game.py - coin")
coin_face = random.randrange(0,2)
if coin_face == 0:
print("성공")
return True
else:
print("실패")
return False