Thursday, February 6, 2014

February 6, 2014 - Day Six

Our robots have arrived! w00t!

The robots have a hole in the middle for a special brush pen, so that a trail can be left behind as the robot moves. This can be useful to verify the output of a program and determine whether it needs to be debugged or not.



In addition to moving forward, backward, and turning right or left, programs can include specific distances (in centimeters) and angles at which to turn. In order to draw a regular polygon with all sides and angles equal, the user must determine the angle at which the robot should turn. Students were told they should divide 360 by the number of sides of the shape they wish to draw. To draw a simple triangle, the robot would turn 120 degrees. Thus, the command to draw a triangle with three centimeter sides would look like this:
The number three in the above command represents the number of times the commands following it should repeat. The output displayed on the robot's screen actually looks like this:
The above command conforms better to the Logo language specification. The reason for the difference is so the user won't have to push as many keys to make the program. The opening bracket is included on the same key as the Repeat.

Students can determine the interior angles of a regular polygon by subtracting the angle at which the robot should turn from 180.
Students were given a few short commands to program into their robot. With a pen inserted into the robot, they executed the command on butcher paper to view the output.

Students tried to program the robot to draw an octagon, and then determine the interior angles of the octagon. Charlie was the first one to do this, so I challenged him to create a dodecagon. He did it!

I think they might have had fun with the robots.





0 comments:

Post a Comment

 

Copyright (c) 2010 Introduction to Coding. Design by WpThemesExpert
Blogger Template by New Blogger Templates.