feature: výběr kostek: odečítání vybraných kostek z nového hodu
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user