Respuesta :

Answer:

Revisiting "Build a Tower"

Recall in the last section how we made Karel make a tower of tennis balls. We told Karel to move() and turnLeft() and putBall() until we had a tower. At the end of the program, Karel was still at the top of the tower, like as in the picture below.

Stuck at top

Suppose that now we want Karel to come back down from the top of the tower. The first thing we need to do is get Karel facing in the right direction. One way to do this is to tell Karel

turnLeft();

turnLeft();

turnLeft();

And then tell Karel to

move();

move();

move();

back to the bottom of the tower.

However, telling Karel to turnLeft() three times is not very readable. That's a lot of writing when all we really want is to tell Karel to "turn right."

Explanation:

Hopefully it would help.