Busy Bot, Busy Me (Hour of Code Exercise)

For my task this week I chose to attempt an Hour of Code exercise on Code.org. The exercise I decided to go with was BusyBot! developed by Blackbird which was a coding exercise recommended for grades 9+. I chose this exercise as many student won’t have taken coding lessons going into high school, and I was curious how nicely the exercise could be followed with little coding experience and a grade 9+ exercise.

 

The first thing I was greeted with was a tutorial, which taught me how to make a robot, and how to make it walk step by step using r.walk(x-coordinate, y-coordinate). It was a slow process as the user had to tell the robot to move each step in a separate line of code such as r.walk(1,0); r.walk(2,0); instead simply writing the final coordinates we wanted the robot to end up in. Though tedious I found by copy and pasting the r.walk(); command I could mass produce robot movements more quickly than typing it out each line by hand. Below is an example of an early exercise’s code along with where the robot ended up after it was finished.

If a mistake in the code was found, a helpful highlight was given along with a hint at what went wrong. This was very helpful when I was writing a long list of commands and saved me a lot of time that could have been spent looking over code that wasn’t working due to a typo or small error.

After getting me thoroughly used to repeatedly typing out these commands, I was introduced to picking up blocks and placing them down. After that I was introduced to the while loop, a game changing tool that saved me SO much time in the later stages. The while loop continuously runs a line (or lines) of code until specified conditions were met. This meant I now had the ability to tell the robot to keep walking in a direction until they reached the coordinate value that I wished for cutting down the many, many, MANY lines of code I would be spending typing out r.walk(); over and over again. The while loop also introduced the x and y coordinate variables so I wouldn’t need to remember what exact tile the robot was on, but instead could have it move based on where it was currently standing. All of these coding skills were slowly built up, with the user being taught something new before performing a large exercise utilizing that learned skill then being taught something new again. This small step-by-step method made it so that by the end of the exercises it was quite natural to type out the code I had learned at the start while adding in the new code to it. The final exercise given is shown through the gif below with the code listed on the right.

Leave a Reply

Your email address will not be published. Required fields are marked *