Brute-force solver for Navigation Compass puzzles web version
Initial upload (May 9, 2023)
- python 3.8+
- numpy 1.23+
The Navigation Compass problem is a game involving 3 rings,
The solution to this, navigation_compass.py attempts to brute-force a solution.
navigation_compass.py has several arguments to specify the configuration of a navigation compass puzzle.
| Flag | Required | Valid Argument | Description |
|---|---|---|---|
--inner |
Yes | Number that is a multiple of 60 | Degree of the inner axis |
--middle |
Yes | Number that is a multiple of 60 | Degree of the middle axis |
--outer |
Yes | Number that is a multiple of 60 | Degree of the outer axis |
--marks-inner |
Yes | Natural number | Number of marks on inner ring, indicating rotation per step |
--marks-middle |
Yes | Natural number | Number of marks on middle ring, indicating rotation per step |
--marks-outer |
Yes | Natural number | Number of marks on outer ring, indicating rotation per step |
--inner-cw |
No | None | Specify flag only if inner ring rotates clockwise |
--middle-cw |
No | None | Specify flag only if middle ring rotates clockwise |
--outer-cw |
No | None | Specify flag only if outer ring rotates clockwise |
-a, --group-a |
Yes | At least one of inner, middle, and outer |
First group of rings that rotate together |
-b, --group-b |
Yes | At least one of inner, middle, and outer |
Second group of rings that rotate together |
-c, --group-c |
Yes | At least one of inner, middle, and outer |
Third group of rings that rotate together |
-N, --maxit |
No | Natural number | Maximum number of brute-force attempts (default 100) |
Example
python navigation_compass.py --inner 60 --middle 0 --outer 180 --marks-inner 4 --marks-middle 3 --marks-outer 1 --inner-cw --middle-cw --outer-cw -a inner -b middle outer -c inner outer
>>>
answer = [20. 1. 11.] % 6 = [2 1 5]
rotate group A ['inner'] 2 times
rotate group B ['middle', 'outer'] 1 times
rotate group C ['inner', 'outer'] 5 times
Solved in 11 brute-force iterations
If no solution is found, check if the arguments are correct.