mirror of
https://github.com/Xameren/Casino.git
synced 2025-02-04 08:29:24 +01:00
Optimised the code again.
This commit is contained in:
parent
057ed51738
commit
b797d02266
1 changed files with 11 additions and 20 deletions
31
Casino.py
31
Casino.py
|
@ -556,6 +556,10 @@ def HorseBettin():
|
||||||
|
|
||||||
horsiewinner = ""
|
horsiewinner = ""
|
||||||
print("\033[H\033[J", end="")
|
print("\033[H\033[J", end="")
|
||||||
|
horseright = ["-------------------------------------------------" for _ in range(4)]
|
||||||
|
horseleft = ["" for _ in range(4)]
|
||||||
|
horses = ["Horse 1", "Horse 2", "Horse 3", "Horse 4"]
|
||||||
|
floats = [random_float_1, random_float_2, random_float_3, random_float_4]
|
||||||
while horsiewinner == "":
|
while horsiewinner == "":
|
||||||
if change_title <= 2:
|
if change_title <= 2:
|
||||||
cooleffecthorsetexttitle = "-#- Race in progress -#- Race in progress -#- Race in progress -#-"
|
cooleffecthorsetexttitle = "-#- Race in progress -#- Race in progress -#- Race in progress -#-"
|
||||||
|
@ -566,31 +570,18 @@ def HorseBettin():
|
||||||
if change_title == 5:
|
if change_title == 5:
|
||||||
change_title = 1
|
change_title = 1
|
||||||
time.sleep(0.2)
|
time.sleep(0.2)
|
||||||
a = random.randint(1,4)
|
a = random.randint(0,3)
|
||||||
if a == 1:
|
|
||||||
Horse1progressleft += "-"
|
horseleft[a] += "-"
|
||||||
Horse1progressright = Horse1progressright.replace("-", "", 1)
|
horseright[a] = horseright[a].replace("-", "", 1)
|
||||||
if a == 2:
|
|
||||||
Horse2progressleft += "-"
|
|
||||||
Horse2progressright = Horse2progressright.replace("-", "", 1)
|
|
||||||
if a == 3:
|
|
||||||
Horse3progressleft += "-"
|
|
||||||
Horse3progressright = Horse3progressright.replace("-", "", 1)
|
|
||||||
if a == 4:
|
|
||||||
Horse4progressleft += "-"
|
|
||||||
Horse4progressright = Horse4progressright.replace("-", "", 1)
|
|
||||||
print("\033[H", end="")
|
print("\033[H", end="")
|
||||||
print(cooleffecthorsetexttitle)
|
print(cooleffecthorsetexttitle)
|
||||||
print("Horse 1: [", Horse1progressleft, "🏇", Horse1progressright, "]")
|
for i in range(4):
|
||||||
print("Horse 2: [", Horse2progressleft, "🏇", Horse2progressright, "]")
|
print(f"{horses[i]}: [{horseleft[i]}🏇{horseright[i]}]")
|
||||||
print("Horse 3: [", Horse3progressleft, "🏇", Horse3progressright, "]")
|
|
||||||
print("Horse 4: [", Horse4progressleft, "🏇", Horse4progressright, "]")
|
|
||||||
print(cooleffecthorsetexttitle)
|
print(cooleffecthorsetexttitle)
|
||||||
|
|
||||||
for index in range(4):
|
for index in range(4):
|
||||||
horseright = [Horse1progressright, Horse2progressright, Horse3progressright, Horse4progressright]
|
|
||||||
horses = ["Horse 1", "Horse 2", "Horse 3", "Horse 4"]
|
|
||||||
floats = [random_float_1, random_float_2, random_float_3, random_float_4]
|
|
||||||
if horseright[index] == "":
|
if horseright[index] == "":
|
||||||
horsiewinner = horses[index]
|
horsiewinner = horses[index]
|
||||||
if horsiechooseinput == index + 1:
|
if horsiechooseinput == index + 1:
|
||||||
|
|
Loading…
Add table
Reference in a new issue