LOGO Programming


Make Your Own Words

One of the coolest things about Logo is that you can make your own words that do whatever you want them to do. When you make a word, you can use it in other commands and programs just as if it was part of Logo to begin with.

What if we want to draw a lot of squares. Each time we have to type in:

REPEAT 4 [FD 100 RT 90]

That's not a whole lot of typing, but wouldn't it be nice if we could just type:

SQUARE

You can teach LOGO what a "SQUARE" is like this:

TO SQUARE
    REPEAT 4 [FD 100 RT 90]
END

Now we can use our new word to make cool new programs. Can you figure out what this does?

REPEAT 36 [SQUARE RT 10]