Automatické vyhodnocení a nová dynamika kola #31
+22
-4
@@ -56,12 +56,30 @@ def evaluate(inp: Any, count: int, throw: str) -> tuple[Any, ...]:
|
|||||||
global h_bool
|
global h_bool
|
||||||
|
|
||||||
def eval_score(pick: str) -> bool:
|
def eval_score(pick: str) -> bool:
|
||||||
if(pick in hodnoty):
|
|
||||||
global score
|
global score
|
||||||
score += hodnoty[pick]
|
score_temp = 0
|
||||||
return True
|
pick_ok = False
|
||||||
|
pick_counter = Counter(pick)
|
||||||
|
while pick_counter:
|
||||||
|
bool_temp = False
|
||||||
|
for k in hodnoty:
|
||||||
|
k_counter = Counter(k)
|
||||||
|
if k_counter <= pick_counter:
|
||||||
|
pick_counter = pick_counter - k_counter
|
||||||
|
score_temp += hodnoty[k]
|
||||||
|
pick_ok = True
|
||||||
|
bool_temp = True
|
||||||
|
|
||||||
|
if not bool_temp:
|
||||||
|
break
|
||||||
|
|
||||||
|
print(pick_counter)
|
||||||
|
if pick_counter:
|
||||||
|
pick_ok = False
|
||||||
else:
|
else:
|
||||||
return False
|
score += score_temp
|
||||||
|
|
||||||
|
return pick_ok
|
||||||
|
|
||||||
def next_player() -> None:
|
def next_player() -> None:
|
||||||
global pointer
|
global pointer
|
||||||
|
|||||||
Reference in new issue
Block a user