This is a lights out game where the goal is to turn all of the lights off.
When you click a light, that light and every light touching it will flip states, e.g.. lights that are on will turn off and lights that are off will turn on.
Play the game here: lights out!
See the annotated source here: annotated source