User Tools

Site Tools


lights_out

Lights Out www.mathorama.com_apcs2_lights_out_files_lo2000.jpg www.mathorama.com_apcs2_lights_out_files_lodeluxe.jpg www.mathorama.com_apcs2_lights_out_files_loclass.jpg www.mathorama.com_apcs2_lights_out_files_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 your code test 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: 2023/11/30 09:21 by frchris

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki