In this task our objective is to get the frog home, which requires moving around the trees which are blocking the path.   We already have a program written for us to achieve this.

Tasks:

Clearly the required objective wasn’t achieved so there is an error in the program.   The compiler didn’t tell us about the error because it was an error in logic, not programming.   There’s no need to throw out the whole program because of this, it’ll be more efficient to isolate the part of the program that went wrong and change it.

By now it should be obvious that an instruction like “frogRight(4)” moves the frog 4 squares to the right, and that we can move the frog up, down, and left in the same manner.

Tasks: