Use it twice

Try itYour own words

A word is worth making when you use it more than once. This slime dances at the start, and again when it sees the hero.

learn to dance
hop left 1 block
jump
hop right 1 block
end
​
dance
​
dance

Try it

  1. Press Play Play this script. The slime dances once.
  2. Click the little game, so the arrow keys work.
  3. Hold the right arrow key to walk the hero toward the slime.

The slime says "Watch this!" and dances again. Two rules use the same word.

Count the lines

The dance is three steps. It is used in two places. Without the word, those three steps would be written out twice.

With the wordWithout it
Lines for the dance3, written once6, the same 3 twice
To change the danceChange it in one placeChange it in two places, the same way

Change it once

  1. Press Stop Stop.
  2. In Code Code, click the line jump, inside the word. Click the small arrow at the end of the line. A list of steps drops down.
  3. Click jump back in the list.
  4. Press Play Play this script, and walk the hero up again.

Both dances changed, and you only touched one line.

This section ticks itself when you press Play.

Press Play in the code box to finish this section.