Vynulování #19
@@ -122,6 +122,16 @@ def evaluate(inp: Any, count: int, throw: str) -> tuple:
|
|||||||
return data
|
return data
|
||||||
elif inp == "k":
|
elif inp == "k":
|
||||||
global score
|
global score
|
||||||
|
|
||||||
|
if score == 0:
|
||||||
|
last_two = players[pointer][-2:]
|
||||||
|
if len(last_two) > 1:
|
||||||
|
last_two_sum = sum(last_two)
|
||||||
|
if last_two_sum == 0:
|
||||||
|
score = -sum(players[pointer])
|
||||||
|
clear()
|
||||||
|
input("Po třech nulových hodech bylo vaše skóre vynulováno.")
|
||||||
|
|
||||||
players[pointer].append(score)
|
players[pointer].append(score)
|
||||||
aggr[pointer] = sum(players[pointer])
|
aggr[pointer] = sum(players[pointer])
|
||||||
score = 0
|
score = 0
|
||||||
@@ -225,7 +235,18 @@ def game(data: tuple):
|
|||||||
th = throw(count)
|
th = throw(count)
|
||||||
clear()
|
clear()
|
||||||
print(f"Vítězné skóre: {final_score}.")
|
print(f"Vítězné skóre: {final_score}.")
|
||||||
print(f"Na tahu je {pointer} ({aggr[pointer]}).")
|
|
||||||
|
strikes = ""
|
||||||
|
|
||||||
|
if len(players[pointer]) > 0:
|
||||||
|
if players[pointer][-1:][0] == 0:
|
||||||
|
strikes = "x"
|
||||||
|
if players[pointer][-2:][0] == 0:
|
||||||
|
strikes += "x"
|
||||||
|
else:
|
||||||
|
strikes = ""
|
||||||
|
|
||||||
|
print(f"Na tahu je {pointer} ({aggr[pointer]}{strikes}).")
|
||||||
print(show_throw(th))
|
print(show_throw(th))
|
||||||
if not check_value(th) and data[2] == "" and count != 0:
|
if not check_value(th) and data[2] == "" and count != 0:
|
||||||
global score
|
global score
|
||||||
|
|||||||
Reference in New Issue
Block a user