Screenshot in, solved PNG out. No mouse automation, no screen coordinates, no display-scaling headaches -- just detect the grid, solve it, draw the answer.
detector.pyfinds the grid lines via pixel-brightness scanning (works at any resolution/crop, no hardcoded coordinates)detector.pyalso finds wall bars the same way (thick bright segments on cell boundaries)ocr.pyreads the digit inside each numbered circle via Tesseract, with several trim/psm passes + majority voting to survive font/edge noisesolver.pyruns a backtracking search for a Hamiltonian path over the whole grid that visits 1..N in order, respecting walls (works with zero walls too)render.pydraws the solved path as a PNG styled like the actual game board -- numbered circles, walls, and the solution traced as a colored line
Every step logs to your terminal and to zipbot.log.
You need Python 3.9+ and the Tesseract OCR binary (pytesseract is just a wrapper around the real binary, which installs separately).
Windows:
winget install --id UB-Mannheim.TesseractOCR
Make sure the install folder (e.g. C:\Program Files\Tesseract-OCR) is on
your PATH -- the installer usually offers to add it, don't skip that.
Linux (Arch):
sudo pacman -S tesseract tesseract-data-eng
Debian/Ubuntu/Kali:
sudo apt install tesseract-ocr
Then install the Python deps:
pip install -r requirements.txt
Screenshot the puzzle (crop tight -- just the grid, not the LinkedIn navbar around it), then either save it as a file or leave it on your clipboard.
From a saved file:
python main.py screenshot.png
From the clipboard (e.g. right after Win+Shift+S):
python main.py --clipboard
Either way, it writes solution.png next to the script -- open it and
trace the blue line onto the real board.
Other flags:
python main.py screenshot.png --out my_solution.png # custom output path
python main.py screenshot.png -v # verbose debug logging
Check zipbot.log -- every detection step is logged: exact pixel
coordinates of every grid line, every wall segment and its brightness
score, every OCR attempt per cell, the full numbers map, and the solved
path.
"Could not detect a full grid" -- your screenshot has too much surrounding UI. Crop tighter to just the board.
OCR reads a wrong number -- run with -v and check the "Numbers map"
log line before it solves. If a number looks wrong (e.g. two cells both
read "1"), the puzzle's font/theme may need a tweak to the trim ratios in
ocr.py.
Solver finds no solution -- almost always an OCR or wall misread, not a solver bug. Verify the numbers map and wall list in the log against what you actually see on screen.
- The solver is fully general -- any RxC grid, any wall layout including none at all.
render.py's colors/sizes are simple constants at the top of the file if you want to tweak the look.