This repository provides a solver for the Unblock Me puzzle game. See the solver in action in this video!
We will connect a computer to the Android device and relay commands using the Android Debug Bridge (ADB)
The steps performed by the script are:
- Take a screenshot on the phone
- Transfer it to the computer
- Process the image to obtain the start state
- Breadth First Search (BFS) to find the solution
- Obtain swipe commands and relay them to the phone
matplotlib
numpy
Android phone with a 1080x1920 resolution
-
Follow the steps here and make sure you can relay simple touch/swipe commands to your Android device.
-
Open the game on the phone
-
On the terminal, run
$ python -u main.py
That's it! Watch the puzzles being solved automatically!
As a bonus, the solver also automatically skips ads by using a timeout to terminate BFS and pressing the back button. We can also recover from unintentional ad clicks by using the back button multiple times.