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.
<span>Every word has only one correct spelling and pronunciation.
This is a false statement.
</span>
Flip bit position 5 to accomplish this. This maps to hex value 0x20, where the least significant bit is assumed to be at position 0.
Example: ascii "A" = 0x41, "a" = 0x61. 0x41 xor 0x61 = 0x20.
You would implement a flip function by XOR'ing the character value with 0x20.