implemetace smyčky
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
from random import randint
|
from random import randint
|
||||||
|
from os import system, name
|
||||||
|
|
||||||
def throw(count):
|
def throw(count):
|
||||||
count = int(count)
|
count = int(count)
|
||||||
@@ -17,12 +18,23 @@ def show_throw(throw):
|
|||||||
pretty_list += f"{i} "
|
pretty_list += f"{i} "
|
||||||
return pretty_list
|
return pretty_list
|
||||||
|
|
||||||
|
def clear():
|
||||||
|
if name == 'nt':
|
||||||
|
_ = system('cls')
|
||||||
|
else:
|
||||||
|
_ = system('clear')
|
||||||
|
|
||||||
|
def game():
|
||||||
|
new_throw = throw(6)
|
||||||
|
clear()
|
||||||
|
print(show_throw(new_throw))
|
||||||
|
input("Prosím, stiskněte enter pro další hod:")
|
||||||
|
game()
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
print("Vítejte ve hře v kostky!")
|
print("Vítejte ve hře v kostky!")
|
||||||
input("Prosím, stiskněte enter pro první hod:")
|
input("Prosím, stiskněte enter pro první hod:")
|
||||||
new_throw = throw(6)
|
game()
|
||||||
print(show_throw(new_throw))
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user