feature/hod: nahrazení throw listu stringem
This commit is contained in:
@@ -15,20 +15,25 @@ with open("hodnoty.csv", "r") as csv_file:
|
|||||||
|
|
||||||
hodnoty[key] = value
|
hodnoty[key] = value
|
||||||
|
|
||||||
def throw(count):
|
def throw(count: int) -> str:
|
||||||
count = int(count)
|
count = int(count)
|
||||||
new_throw = []
|
new_throw = []
|
||||||
for dice in range(count):
|
for dice in range(count):
|
||||||
new_throw.append(str(randint(1, 6)))
|
new_throw.append(str(randint(1, 6)))
|
||||||
|
new_throw = "".join(new_throw)
|
||||||
return new_throw
|
return new_throw
|
||||||
|
|
||||||
def show_throw(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"
|
pretty_list += "\n"
|
||||||
for i in range(1, len(throw) + 1):
|
for i in range(1, len(throw_temp) + 1):
|
||||||
pretty_list += "^ "
|
pretty_list += "^ "
|
||||||
pretty_list += "\n"
|
pretty_list += "\n"
|
||||||
for i in range(1, len(throw) + 1):
|
for i in range(1, len(throw_temp) + 1):
|
||||||
pretty_list += f"{i} "
|
pretty_list += f"{i} "
|
||||||
return pretty_list
|
return pretty_list
|
||||||
|
|
||||||
@@ -64,8 +69,7 @@ def evaluate(inp, count, throw):
|
|||||||
return data
|
return data
|
||||||
|
|
||||||
def check_value(throw):
|
def check_value(throw):
|
||||||
throw_s = throw.copy()
|
throw_s = sorted(throw)
|
||||||
throw_s.sort()
|
|
||||||
throw_str = "".join(throw_s)
|
throw_str = "".join(throw_s)
|
||||||
hodnota = False
|
hodnota = False
|
||||||
for h in hodnoty:
|
for h in hodnoty:
|
||||||
|
|||||||
Reference in New Issue
Block a user