Karel is starting to find her world too black and white. Help her fill it with color.

Paint and Random

Karel has a few commands up her sleeve. She can paint the corner on which she is standing using the instruction

The value enclosed in the parentheses, which is called an argument in the terminology of programming languages, may be any of the following: RED   ORANGE   GREEN   CYAN   BLUE   MAGENTA and more...

Karel also defines a new condition random, which is true half the time, but in an unpredictable way. Like flipping a coin, sometimes it is true and sometimes it is false. For example the code

if(random()) {
Will place a beeper, or will not, with equal probability.


Use these new abilities to have karel randomly paint each corner of a world one of two colors. You can chose any two colors you would like; we chose green and blue.

Below are three executions of the same program that randomly paints any sized world green and blue executed on a 10x10 world. Note that because of the random condition, the pattern of green and blue is different on each run!

As always, remember to decompose your solution! Your program should work on a world of any size.