WARNING: This program has a bug, which means we need to fix it! This bug is a logic error.

RULE: The handler listens for the signal to run the event. It should not be indented.

  • Click Run and wait 1 second. Watch the stage to see what's wrong with the program.
  • A snowflake should appear and start to fall every half-second, but they aren't.
  • Unindent the event handler on line 15 so that the snow starts to fall!

To navigate the page using the TAB key, first press ESC to exit the code editor.

stage.set_background("winter2") tint = codesters.Square(0, 0, 500, "black") tint.set_opacity(0.5) stage.disable_floor() def interval(): x = random.randint(-250, 250) snowflake = codesters.Sprite("snowflake1", x, 350) snowflake.set_size(random.randint(3, 7)/10) snowflake.set_y_speed(random.randint(-5, -1)) # add any other actions... stage.event_interval(interval, .5)
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)