feature/vynulovani: byla implementována logika pro vynulování: po třetím tahu končícím nulou dojde k vynulování celkového skóre hráče
This commit is contained in:
1 parent
a6a256992e
commit
0682ad88ce
1 file changed
+8
@@ -122,6 +122,14 @@ 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])
|
||||||
|
|
||||||
players[pointer].append(score)
|
players[pointer].append(score)
|
||||||
aggr[pointer] = sum(players[pointer])
|
aggr[pointer] = sum(players[pointer])
|
||||||
score = 0
|
score = 0
|
||||||
|
|||||||
Reference in new issue
Block a user