CEMC Banner

Problem of the Week
Problem B
Help Send Freddy Home

Freddy the Robot starts in the top left square of the maze below, facing left (symbolized by \(\leftarrow\)). Freddy wants to get to his Home Charging Station in the bottom right corner of the maze, marked with an H. Freddy can only turn right (clockwise on the diagram), and will only turn the number of degrees which you tell him. As well, he will go exactly the number of squares you tell him and in the direction that the arrow is currently pointing.

For example, if he starts facing \(\leftarrow\), and your command said, "Turn \(180\) degrees and go \(3\) spaces", he would turn \(180\degree\) right (clockwise) and then move \(3\) spaces forward (to the right).

Write a program of commands that gets Freddy to his Home Charging Station.

A description of the maze follows.

Themes: Computational Thinking, Geometry & Measurement