Open LleytonH opened 6 months ago
entered = "" armed = False
def Password(): global armed if (entered == "42351"): drawer.goto(-650,340) drawer.color("black") drawer.write("Correct Password! Press the button to drop the bomb. :)))", font=("Arial", 35, "bold")) armed = True
def four_pressed(): global entered entered = entered + "4" Password() def Two_pressed(): global entered entered = entered + "2" Password() def Three_pressed(): global entered entered = entered + "3" Password() def Five_pressed(): global entered entered = entered + "5" Password() def one_pressed(): global entered entered = entered + "1" Password()
def fire_missle(x,y): if (armed == True): drop() else: print("fail to launch")
wn.onkeypress(four_pressed, "4") wn.onkeypress(Two_pressed, "2") wn.onkeypress(Three_pressed, "3") wn.onkeypress(Five_pressed, "5") wn.onkeypress(one_pressed, "1")
the code needs to be indented but other than that looks good
Create a password that when entered correctly will do something.