Just click the flag draw with mouse and then hit space if the square is by the flag restart by clicking the flag again and draw
I worked REALLY hard on this, this killed my brain I hope you enjoy!