I am trying to create a solvability function for a game algorithm. Basically a function that returns true or false for a given game if it is solvable or not.
The game is a type of lights-out game. Basically You have a M*N grid of buttons. When the game starts, a random number or a stored pattern of these lights is switched on. Pressing any of the lights will toggle a square of four buttons including the pressed button.
so I'm looking for an algorithm that returns true if we can turn off all the lights and return false if we can't do this.