What You'll Need

Participants: 1

Devices: 1




1. Planning
Let's draw a square! A square is made by 4 lines, like this:

2. Drawing
Now let's draw it with your Capybara. Let's draw the first line by walking forward a few steps. Begin by trying with a number below 10 to ensure the line is neither too long nor too short.


Hint: The order you stack the blocks is very important!
should be above
.
3. Rotation
To make the Capybara draw the second line, first it has to turn. Left or right, it's your choice! Let's use "right" for this example. How much does it have to turn?
The numbers in
are angles. So, if the Capybara is facing to the front, it should turn 90°

So, let's add that rotation. Your code should look like this:

Now, let's execute that code. This should be the final result:

4. Repeat
Now that we have 1 side of the square, let's draw all of them by repeating our code 4 times.

Congratulations! You drew a square.

Take It Further
Now let's optimize the code, making it more efficient, getting the same outcome with less blocks.
How can we do it? What blocks seem to be repeated? How many times are they repeated?
As you can see, the blocks are repeated four times:

So let's use:


Now you'll have the same square with less coding blocks.
And Beyond!
Now that you know how to draw, walk forward and rotate, let's try one of these drawings! Or imagine new ones and try them!



Block Inventory
EVENTS

MOTION



LOOKS


CONTROL

