This Python program solves a 3x3 panel puzzle by finding valid combinations of commands that transform the initial panel state into a target state (all cells set to 1
).
This usefully solves the puzzle in Resident Eval (1996)
. The description of the problem.
Each command toggles specific cells using XOR, and the solution brute-forces all possible command combinations up to a specified maximum length.
- Interactive Input: Enter the initial 3x3 panel configuration directly
- Customizable Combination Length: Set the maximum length of command sequences to explore (default: 3)
- Predefined Commands: 9 unique commands that toggle specific cell patterns
- Brute-Force Algorithm: Exhaustively checks all valid command combinations to find solutions
- Parallelism: Proper use of big number of courses in parallel
- Ensure Python 3.x is installed
- Download or copy the script
panel_solver.py
-
Run the script:
python panel_solver.py
-
Enter the initial panel row by row (3 rows of 0/1 separated by spaces)
-
Specify the maximum combination length (press Enter to use default value 3). Do not use more then 4 on slow machines. Because complexity is
$O(n!)$
Example input:
Enter initial panel (3 rows of 3 digits 0/1 separated by spaces):
Row 1: 1 1 0
Row 2: 1 0 0
Row 3: 0 0 0
Maximum combination length [3]: 2