BillHung.Net


powered by FreeFind     sms

HW 02

 

HW2:  SolveLightsOut AnalyzeLightsOut

SolveLightsOut:  <files needed for SolveLightsOut>
    <command to compile SolveLightsOut>

AnalyzeLightsOut:  <files needed for AnalyzeLightsOut>
    <command to compile AnalyzeLightsOut>
Andy Carle


For my AnalyzeLightsOut program, I found 384 states with no solution and
there are 2 most interesting states: 001001001 and 100100100
 

1 2 3
4 5 6
7 8 9

Flip table

Position

Point

Bit String Hex Value Initial as 111111111 Result Result as Hex
1 1 2 4 7 110100100 0x1a4 001011011 0x05b
2 1 2 3 5 8 111010010 0x1d2 000101101 0x02d
3 2 3 6 9 011001001 0x0c9 100110110 0x136
4 1 4 5 7 100110100 0x134 011001011 0x0cb
5 2 4 5 6 8 010111010 0x0ba 101000101 0x145
6 3 5 6 9 001011001 0x059 110100110 0x1a6
7 1 4 7 8 100100110 0x126 011011001 0x0d9
8 2 5 7 8 9 010010111 0x097 101101000 0x168
9 3 6 8 9 001001011 0x04b 110110100 0x1b4

http://www.geocities.com/jaapsch/puzzles/lights.htm#solution

Solution of Lights Out (Classic):
Number the rows 1-5, the columns A-E.

  1. For each light on row 1, press the button beneath it on row 2 to turn the light off. This way row 1 is completely unlit.
  2. Repeat step a for rows 2-4, so that now you only have lights on row 5. This is usually called 'chasing the lights'.
  3. If the light at A5 is on, press D1 and E1.
    If the light at B5 is on, press B1 and E1.
    If the light at C5 is on, press D1.
  4. Repeat steps a-b, chasing the lights down and it will be magically solved.

This method will not solve the puzzle in the shortest possible way, but it is very simple.

If your browser has JavaScript, then you can play the standard Lights Out game:

Solution to the Mini Lights Out:

This is an easy puzzle once you know the following two facts:
1. To change an individual light, press it and its four neighbours.
2. To know whether you need to press a button or not, check its own light and the neighbouring lights. If an odd number of these 5 lights are switched on, then the button needs to be pressed, otherwise it does not.

The following solution then suggests itself:
a. Use fact 2 above on all the buttons in the middle two rows.
b. For each light that is on in row 2, press the button above it in row 1.
c. For each light that is on in row 3, press the button below it in row 4.