press "r" to randomize colours press "spacebar" to detect which squares are next to a square of the indicated colour. Next to means horizontal or vertical. You can change the colour using the slider