feature/hod: nahrazení throw listu stringem

This commit is contained in:
2026-06-21 16:31:23 +02:00
parent e4fc41a656
commit b7ec4eb17f
+10 -6
View File
@@ -15,20 +15,25 @@ with open("hodnoty.csv", "r") as csv_file:
hodnoty[key] = value
def throw(count):
def throw(count: int) -> str:
count = int(count)
new_throw = []
for dice in range(count):
new_throw.append(str(randint(1, 6)))
new_throw = "".join(new_throw)
return new_throw
def show_throw(throw):
pretty_list = ", ".join(throw)
throw_temp = []
for x in throw:
throw_temp.append(x)
pretty_list = ", ".join(throw_temp)
pretty_list += "\n"
for i in range(1, len(throw) + 1):
for i in range(1, len(throw_temp) + 1):
pretty_list += "^ "
pretty_list += "\n"
for i in range(1, len(throw) + 1):
for i in range(1, len(throw_temp) + 1):
pretty_list += f"{i} "
return pretty_list
@@ -64,8 +69,7 @@ def evaluate(inp, count, throw):
return data
def check_value(throw):
throw_s = throw.copy()
throw_s.sort()
throw_s = sorted(throw)
throw_str = "".join(throw_s)
hodnota = False
for h in hodnoty: