feature: bodování hodů a interaktivní herní smyčka #7

Merged
david-spacil merged 13 commits from feature/vyber-kostek into version/v0.1.0 2026-06-23 20:32:58 +02:00
Showing only changes of commit 16d940253d - Show all commits
+14 -5
View File
@@ -1,5 +1,6 @@
from random import randint
from os import system, name
import re
def throw(count):
count = int(count)
@@ -24,17 +25,25 @@ def clear():
else:
_ = system('clear')
def game():
new_throw = throw(6)
def evaluate(inp, count):
inp = str(inp)
if re.search("^\d+$", inp):
count = len(inp)
return count
def game(count):
new_throw = throw(count)
clear()
print(show_throw(new_throw))
input("Prosím, stiskněte enter pro další hod:")
game()
inp = input("Vyberte, kterými kostkami chcete hodit znovu (např. 135):")
count = evaluate(inp, count)
game(count)
def main():
print("Vítejte ve hře v kostky!")
input("Prosím, stiskněte enter pro první hod:")
game()
count = 6
game(count)
if __name__ == "__main__":
main()