Checkerboard

Write a program that behaves as follows. While no key is pressed, the screen should be filled with a checkerboard pattern as shown in the image below. The top-left pixel of the screen should always be black. While the “c” key is held, the screen should be filled with the opposite checkerboard pattern, with the top-left pixel of the screen coloured white. The top-left pixel should be coloured correctly no matter when “c” is pressed.

In testing, you will almost certainly find that the default CPU simulator speed is too slow. Remember that you can run the CPU simulator extremely fast by changing “Animate” from “Program flow” to “None” in the top bar. This will stop you from editing memory manually until you change it back, although you can still clear memory using the blank paper icon (next to the binoculars).

By the way - checking this problem on our current hardware takes about 1 minute. If the server load is high - you could hit our 90 second time out even if your code is perfect.