forked from larymak/Python-project-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dice_game_"barbut"
34 lines (28 loc) · 895 Bytes
/
dice_game_"barbut"
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
"""Barbut"""
from random import randint
def barbut():
while True:
score_pairs = [17, 16, 15, 14, 13, 12] # values for pair-outcomes
user = [randint(1,6), randint(1, 6)]
bot = [randint(1, 6), randint(1, 6)]
scor_user = 0
scor_bot = 0
print(f"Your dice: {user[0]}, {user[1]} | Bot's dice: {bot[0]}, {bot[1]}. ")
if user[0] == user[1]:
scor_user = score_pairs[user[0] - 1]
else:
scor_user = user[0] + user[1]
if bot[0] == bot[1]:
scor_bot = score_pairs[bot[0] - 1]
else:
scor_bot = bot[0] + bot[1]
if scor_user > scor_bot:
print("+5$")
break
elif scor_user == scor_bot:
print("Play on")
continue # If result is draw, play again
else:
print("-5$")
break
barbut()