feature/konec-hry: nastavení vítězného skóre
This commit is contained in:
@@ -11,6 +11,7 @@ pointer = ""
|
|||||||
first = ""
|
first = ""
|
||||||
h_bool = True
|
h_bool = True
|
||||||
aggr = {}
|
aggr = {}
|
||||||
|
final_score = 10000
|
||||||
|
|
||||||
with open("hodnoty.csv", "r") as csv_file:
|
with open("hodnoty.csv", "r") as csv_file:
|
||||||
csv_reader = csv.reader(csv_file)
|
csv_reader = csv.reader(csv_file)
|
||||||
@@ -146,6 +147,7 @@ def add_players(iter=False):
|
|||||||
global players
|
global players
|
||||||
global pointer
|
global pointer
|
||||||
global first
|
global first
|
||||||
|
global final_score
|
||||||
|
|
||||||
if not iter:
|
if not iter:
|
||||||
var = "prvního hráče"
|
var = "prvního hráče"
|
||||||
@@ -157,6 +159,11 @@ def add_players(iter=False):
|
|||||||
if inp == "x":
|
if inp == "x":
|
||||||
if not iter:
|
if not iter:
|
||||||
add_players()
|
add_players()
|
||||||
|
inp = input("Zadejte finální skóre (nechte prázdné pro výchozích 10 000): ")
|
||||||
|
if inp != "":
|
||||||
|
inp = int(inp)
|
||||||
|
final_score = inp
|
||||||
|
|
||||||
elif inp == "":
|
elif inp == "":
|
||||||
print("Jméno nemůže být prázdné.")
|
print("Jméno nemůže být prázdné.")
|
||||||
add_players(iter)
|
add_players(iter)
|
||||||
@@ -179,7 +186,8 @@ def game(data: tuple):
|
|||||||
if(th == ""):
|
if(th == ""):
|
||||||
th = throw(count)
|
th = throw(count)
|
||||||
clear()
|
clear()
|
||||||
print(f"Na tahu je {pointer} ({aggr[pointer]})")
|
print(f"Vítězné skóre: {final_score}.")
|
||||||
|
print(f"Na tahu je {pointer} ({aggr[pointer]}).")
|
||||||
print(show_throw(th))
|
print(show_throw(th))
|
||||||
if not check_value(th) and data[2] == "" and count != 0:
|
if not check_value(th) and data[2] == "" and count != 0:
|
||||||
global score
|
global score
|
||||||
@@ -213,6 +221,7 @@ def game(data: tuple):
|
|||||||
print(msg)
|
print(msg)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
clear()
|
||||||
print("Vítejte ve hře v kostky!")
|
print("Vítejte ve hře v kostky!")
|
||||||
add_players()
|
add_players()
|
||||||
input("Prosím, stiskněte enter pro první hod:")
|
input("Prosím, stiskněte enter pro první hod:")
|
||||||
|
|||||||
Reference in New Issue
Block a user