Description
when play mode starts it will initialize a predefined number of LEDs = X
X == 5 - level number, in this case X == 5 - 4 == 1
leds that light up should be chosen randomly from the entire matrix. If easier think about them as X random out of 16!
In play mode each button press controls groups of buttons using inversion (like in the original LO):
if lighted up => go dark
if dark => light up
Each level uses a different geometric shape to define the group which is controlled via single button press:
Some board configurations will not lead to a successful solution if you are trying to play the classical LO game. This is fine; no checking for this.
For the corner buttons the following implementation(s) are acceptable:
either consider that you have phantom rows/columns on all sides (to make the algorithm straight forward and not do any error checks) or
if easier check if the resulting (horizontal, vertical) address represents an invalid location (e.g. no such physical LED + button) and skip it.
For more info see #5
Reactions are currently unavailable
You can’t perform that action at this time.
+shape where the pressed button is in the center, see LightsOut sources: general logic #5 for imageFor more info see #5