Today is our grand finale! So far, we've been the robots ourselves, following instructions to make patterns and draw pictures. We learned that to get the right result, the sequencing and order of our code has to be perfect.
Today, we're going to meet a robot that lives on a screen. This robot can follow all the same commands we used to draw, and it will show us just how good it is at following our code.
Materials Needed:
A Screen/Projector: To display the simple web application.
Worksheets: Have a few of the "Drawing Robot" worksheets on hand to reference.
Markers: To draw a few example shapes before going to the screen.
Open the Digital Robot Game on the screen. Explain that this is a digital robot.
Point to the buttons that match their instruction cards (➡️
, ⬇️
, ⬅️
, ⬆️
).
Tell them that when you click these buttons, you are giving the robot its code, and it will remember every single step.
Tell the students you are going to code the digital robot to draw a simple square, just like they did with their markers.
Click the buttons in the correct sequence (➡️
, ⬇️
, ⬅️
, ⬆️
).
As you click, the code will appear on the screen, building the sequence.
Once you are done, press the "Draw" button. The digital robot will then "magically" draw the square on the screen.
This is the "aha!" moment where they see their unplugged work translated to the digital world.
Now, tell the students you are going to try to confuse the robot.
Recreate the "bug" from a previous lesson, purposely inputting the commands in the wrong order.
For example, input ⬇️
, ➡️
, ⬆️
, ⬅️
. Press "Draw."
The students will see a messed-up shape and will be able to tell you that the code was wrong.
This reinforces the idea that computers, like them, can only follow instructions exactly as they are given, and one mistake (a bug) can break the whole program.
Give each student a worksheet. Tell them it's their turn to be the programmer.
Challenge them to write the code to draw a simple square and then a rectangle.
When they have completed the code, they can enter it into our online drawing robot to see if it works!