Compare commits
3
Commits
main
...
caa743fcc9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
caa743fcc9 | ||
|
|
26f53761a7 | ||
|
|
d420664fde |
No files matched your search
+2
-1
@@ -2,4 +2,5 @@ __pycache__/
|
||||
*.pyc
|
||||
dist/
|
||||
build/
|
||||
*.egg-info/
|
||||
*.egg-info/
|
||||
test.py
|
||||
+26
-6
@@ -26,6 +26,8 @@ for row in csv_reader:
|
||||
|
||||
hodnoty[key] = value
|
||||
|
||||
hodnoty = dict(sorted(hodnoty.items(), key=lambda x: x[1], reverse=True))
|
||||
|
||||
def throw(count: int) -> str:
|
||||
count = int(count)
|
||||
new_throw: list[str] = []
|
||||
@@ -56,12 +58,30 @@ def evaluate(inp: Any, count: int, throw: str) -> tuple[Any, ...]:
|
||||
global h_bool
|
||||
|
||||
def eval_score(pick: str) -> bool:
|
||||
if(pick in hodnoty):
|
||||
global score
|
||||
score += hodnoty[pick]
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
global score
|
||||
score_temp = 0
|
||||
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:
|
||||
score += score_temp
|
||||
|
||||
return pick_ok
|
||||
|
||||
def next_player() -> None:
|
||||
global pointer
|
||||
|
||||
Reference in new issue
Block a user