User Tools

Site Tools


Lights Out www.jaapsch.net_puzzles_images_lo2000.jpg www.jaapsch.net_puzzles_images_lodeluxe.jpg www.jaapsch.net_puzzles_images_loclass.jpg www.jaapsch.net_puzzles_images_logamze.jpg

Click here to see a video of the game

Download starter code

What to do

  1. Right now the code works so that a single clicked square is turned on or off as you click it. In the actual game, when you click on a light, it changes not only the light you clicked on, but also the one above, below and the one on the right and the left. You need to modify the Puzzle method clickOn so it will work properly. To do this without run time errors, you need to check if the neighboring light exists (there is nothing below the bottom row or the right of the last column, for instance).
  2. Once you have that working, change the constructor of the Puzzle so it randomly chooses to turn on several lights.
  3. Notice it always says 0 moves. Look at the code in LightsOutApp to see how to get that working.
  4. Change the dimensions of the puzzle. The mini was 4 by 4, the LightsOut 2000 was 5 by 5, and Deluxe was 6 by 6. A more difficult challenge is to make it like the Gamzes Out . Find out more about them here
  5. There is a version where there are no borders, so when you click on one of the lights on the edge, it changes the lights on the other side (Hint: use mod % )
  6. Not all random starting situations form a solvable puzzle. Make you code teak the random starting position so that it is solvable. To do this, make sure there are an even number of lights turned on in the three “quiet positions” described here
  7. Optional: Let the player know the minimum number of moves
lights_out.txt · Last modified: 2019/03/28 13:44 by frchris