Function Repository Resource:

# LightsOutSolution

Get the solutions of the Lights Out game

Contributed by: Aster Ctor
 ResourceFunction["LightsOutSolution"][rank] gives the essential solution to the standard Lights Out game of the given rank.

## Details and Options

A standard game starts with all lights on. Every time the player clicks a switch, the clicked light and its neighbors switch state.
A solution of Lights Out means a way to turn off all the lights; 1 indicates a click, while 0 indicates no click.
The Method option can take the following values:
 "Unique" give a single solution "All" give all solutions "AllCount" count all solutions "Essential" give all essential solutions "EssentialCount" count all essential solutions

## Examples

### Basic Examples (2)

Get a solution of the rank-5 Lights Out game:

 In[1]:=
 Out[1]=

Visualize this solution:

 In[2]:=
 Out[3]=

### Options (5)

#### Method (5)

Give a solution:

 In[4]:=
 Out[4]=

Give all the solutions:

 In[5]:=
 Out[5]=

Count all solutions:

 In[6]:=
 Out[6]=

An essential solution means there is no other rotation-reflection inequivalent solutions:

 In[7]:=
 Out[7]=

Count essential solutions:

 In[8]:=
 Out[8]=

### Neat Examples (1)

Complex and beautiful patterns arise when the order is high:

 In[9]:=
 Out[9]=

## Publisher

Aster Ctor (MoeNet)

## Version History

• 1.0.0 – 05 December 2019