Compare commits
3
Commits
main
...
caa743fcc9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
caa743fcc9 | ||
|
|
26f53761a7 | ||
|
|
d420664fde |
No files matched your search
@@ -3,3 +3,4 @@ __pycache__/
|
|||||||
dist/
|
dist/
|
||||||
build/
|
build/
|
||||||
*.egg-info/
|
*.egg-info/
|
||||||
|
test.py
|
||||||
+24
-4
@@ -26,6 +26,8 @@ for row in csv_reader:
|
|||||||
|
|
||||||
hodnoty[key] = value
|
hodnoty[key] = value
|
||||||
|
|
||||||
|
hodnoty = dict(sorted(hodnoty.items(), key=lambda x: x[1], reverse=True))
|
||||||
|
|
||||||
def throw(count: int) -> str:
|
def throw(count: int) -> str:
|
||||||
count = int(count)
|
count = int(count)
|
||||||
new_throw: list[str] = []
|
new_throw: list[str] = []
|
||||||
@@ -56,12 +58,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