Some OpenCV and PyAutoGUI code monkeying to automatically play Fruit Box (both English and Japanese). Pair programmed with stephen-huan in one night.
Things this is good at:
- Finding the game on the screen
- Dealing with different resolutions and sizes
- Executing game moves
This is this awful at:
- Solving for good game solutions
- Supporting non-Linux, probably
Note that this requires Tessearct to be in your path! Unfortunately, the program shells out to it.
video.mp4
Finding valid boxes is easy. Maximizing final score is probably hard. Currently, there are two (awful) strategies: the first always chooses the valid box closest to the top left corner, while the other tries random solutions and picks the one with the best score.
There are some simple heuristics that probably do okay. For instance, it seems good to get rid of high numbers early, as those have fewer future choices. A nine can only be matched with a one.