第一段修改如下:
# Release 1.01
# @2021/02/19 Created By Stephane
# FR_racingV1beta21
from tkinter import Tk, Label
# Set up Tkinter
window = Tk()
window.title("FR")
window.maxsize(200, 200)
window.resizable(0, 0)
label1 = Label(window, text="0")
label1.pack(side="top")
# Definition Variables
count1 = "0"
count2 = "0"
tmp1 = "0"
tmp2 = "0"
set1 = "0"
# Definition Images and Icon
def FRASCII1():
tmp1 = "0"
tmp2 = "0"
print("""
ASCII art here
""")
def FRWIN():
tmp1 = "0"
tmp2 = "0"
window.title("FR")
label1 = Label(window, text="YOU WIN!!")
window.mainloop()
def FRLOSE(): # Changed the function name to FRLOSE (previously FRWIN, which was incorrect)
tmp1 = "0"
tmp2 = "0"
window.title("FR")
label1 = Label(window, text="YOU LOSE")
window.mainloop()
def SCOREPLUSONE():
tmp1 = "0"
tmp2 = "0"
int(count1) + int(count2)
def SCOREMINUSONE():
tmp1 = "0"
tmp2 = "0"
int(count1) - int(count2)
def doMain():
pass # Placeholder for the doMain function, implement your logic here
def START():
tmp1 = "0"
tmp2 = "0"
print("Welcome To FR Racing V1 2021")
time.sleep(1.0)
tmp1 = input("Do You Want To Install The Game? Y/n")
if tmp1 == "Y" or tmp1 == "y":
return tmp2 == input("Where Do Want To Install? ex:C:/Programfile")
elif tmp1 == "n":
return doMain()
else:
return tmp1 == input("Do You Want To Install The Game? Y/n")
------------------------------------------------------------------------------------------------
第二段修改如下:
import random
import time
print()
print("UFO Password")
print()
time.sleep(1.0)
print("First, Enter A Capital Letter and then A Small Letter")
time.sleep(1.0)
print("To Disable The Explosion Function")
print()
input("Press Enter to continue...")
def guess_letter():
return random.choice("abcdefghijklmnopqrstuvwxyz")
first_letter = guess_letter()
#print(first_letter)
def guess_letter2():
return random.choice("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
second_letter = guess_letter2()
#print(second_letter)
no_explosion = False
def fun1():
print("You Save The Humans!!!!")
global no_explosion # Added global keyword to modify the global variable
no_explosion = True
tmp1 = input("Press any key to continue...")
exit()
for x in range(3):
fg = input("first_letter:")
fg2 = input("second_letter:")
if fg == first_letter and fg2 == second_letter:
fun1()
|