title: Lights out game algorithm
body: <p>It's a homework. I have to design and lights out game using backtracking description is below.</p>
  
  <p>The game consists of a 5-by-5 grid of lights; when the game starts, a set of these lights (random, or one of a set of stored puzzle patterns) are switched on. Pressing one of the lights will toggle it, and the four lights adjacent to it, on and off. (Diagonal neighbours are not affected.) The game provides a puzzle: given some initial configuration where some lights are on and some are off, the goal is to switch all the lights off, preferably in
  as few button presses as possible.</p>
  
  <p>My approach is go from 1 to 25 and check if all the lights are off or not. If not then I will check for 1 to 24 and so on until I reach 1 or found solution. No if there is no solution then I will start from 2 to 24 and follow the above process till I reach 2 or found solution.</p>
  
  <p>But through this I am not getting the result ? for example light at (0,0) (1,1) (2,2) (3,3) (4,4) are ON?</p>
  
  <p>If any one need code I can post it.</p>
  
  <p>Can any one tell me correct approach using backtracking to solve this game ?</p>
  
  <p>Thanks.  </p>