Star Student Builder logoStar Student Builder
← Block Builders Lesson 5Std 3-5

Make Your Own Block

The turtle knows square and triangle. It does not know petal. So teach it. Write to petal, then the drawing, then end. From that moment on, the word petal is a command, exactly like forward.

πŸ’‘ The idea

You can teach the turtle a brand new command and give it any name you like.

  • to petal starts your new block, and end finishes it.
  • Nothing is drawn while you are teaching. It draws when you call the name.
  • After that, writing petal once draws the whole thing.
  • A good block finishes where it started, so you can use it again and again.
  • Give your block a name that says what it draws.

πŸ“˜ Words to know

block
a command you make and name yourself
to
the word that starts a new block
call
use a block by writing its name

πŸ‘€ Watch this

Six petals around one point, all from a single block that you named yourself.

to petal
repeat 2 [ forward 80 right 60 forward 80 right 120 ]
end
colour pink
repeat 6 [ petal right 60 ]
What this program draws
What it draws

✍️ Your turn

  1. Run it and find the word petal being used.
  2. Delete the last line and run it again. Nothing is drawn, because nothing called petal.
  3. Change repeat 6 and right 60 to repeat 12 and right 30.
  4. Change the 80s inside petal to 50 and watch every petal shrink.
  5. Rename petal to leaf, in both places.

🎯 Challenge: Make a block called leaf and use it four times to draw a four-leaf pattern.

Show me one answer
to leaf
repeat 2 [ forward 60 right 45 forward 60 right 135 ]
end
colour green
repeat 4 [ leaf right 90 ]

Your program
Ask GuruAcharya Samayeshwar