Function Repository Resource:

# LightsOutGame

Start a Lights Out game

Contributed by: Aster Ctor
 ResourceFunction["LightsOutGame"][n] starts an n×n game of Lights Out. ResourceFunction["LightsOutGame"][n,m] starts an n×m game.

## Details and Options

White indicates a lit light; black indicates a light that is extinguished.
Turn off all the lights to win.
The algorithm avoids the generation of games with no solution.
The solution of higher-rank games can be extremely complicated, but the algorithm guarantees at least one solution.

## Examples

### Basic Examples (1)

Start a game with two rows and two columns:

 In[1]:=
 Out[1]=

### Scope (1)

Start a game with two rows and three columns:

 In[2]:=
 Out[2]=

### Options (2)

#### Mode (2)

The game has two modes. Normal mode is initially all white:

 In[3]:=
 Out[3]=

By contrast, random mode starts with a random collection of white and black squares:

 In[4]:=
 Out[4]=

## Publisher

Aster Ctor (MoeNet)

## Version History

• 1.0.0 – 04 November 2019