Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alifeee/tree-matching
https://github.com/alifeee/tree-matching
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/alifeee/tree-matching
- Owner: alifeee
- Created: 2023-11-25T19:30:28.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2023-11-25T19:40:31.000Z (12 months ago)
- Last Synced: 2023-11-25T20:27:40.253Z (12 months ago)
- Language: Python
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tree Matching
Given this puzzle, find a solution. The hexagons must be places in the holder, and each edge that touches must display the same image. Shown below is the solution.
![Picture of wooden puzzle](images/puzzle.png)
This repository uses Python and recursion to find a solution programmatically.
For solution, see [`matcher.py`](./matcher.py). Currently, it finds "6 solutions", which are actually 1 solution, with 6-times rotational symmetry.
## Commands
### Test
```bash
pip install pytest
pytest
```### Find solution
```bash
py matcher.py
```### Example output
```text
Solution 1:B
C D
F
E A
Gc
f b
f a e b
c a d e f
d e d c d
b e c a
b f b a
a f a b d
d c a f e
e c f c
b e
d
```