stage.set_background("hauntedhouse")
guess_list = []
right_guess = ["candy", "slime", "eyeball"]
witch = codesters.Sprite("witch", -50, -150)
cauldron = codesters.Sprite("cauldron", 50, -200)
witch.say("Can you guess what's in my cauldron? \nI'm making a special potion!")
stage.wait(2)
for counter in range(3):
guess = witch.ask("Guess " + str(counter + 1) + ":")
guess_list.append(guess)
witch.say("You only get three guesses. Let's see if you're correct!")
for guess in guess_list:
if guess in right_guess:
witch.say("You guessed " + guess + ".")
stage.wait(2)
if guess == "candy":
witch.say("Yess the ssecret ingredient!")
stage.wait(1)
elif guess == "slime":
stage.wait(1)
witch.say("Of course. Crucial for consistency!")
stage.wait(1)
elif guess == "eyeball":
witch.say("Yup! Gotta have eyeballs for a good potion.")
stage.wait(1)
for guess in guess_list:
if guess not in right_guess:
stage.wait(2)
witch.say("You guessed " + guess + ".")
stage.wait(1)
witch.say("Wrong! I'm going to turn you into a snail!")
stage.wait(1)
-
Run Code
-
-
Stop Running Code
-
Show Chart
-
Show Console
-
Codesters How To (opens in a new tab)