Version 2.0 - Sudoku.com Android App Automated with Python3 + ADB

preview_player
Показать описание
My 1.0 version is here:

In this version, I modified the code so that it only enters the numbers on empty squares. I also combined two similar functions into one, in order to make the program code smaller.

Previously the solve time was between 1:20 and 1:40, but now it completes the sudoku puzzle in roughly 55 seconds (give or take 2-3 seconds).

The workflow has changed slightly.

1. Take a Screenshot
2. Identify the Sudoku Grid
3. Split each row apart
4. Iterate through each block in the row, and use pytesseract to OCR the number. If no number, then just list it as 0. Append all numbers to a list.
5. Append all lists to a master list.
5.5. Find all the values that are blank in this list, and make note of their coordinates on the grid.
6. Perform backtracking to figure out the solution for the sudoku puzzle.
7. Iterate through the empty coordinates, and pull out the respective number from the solved sudoku grid.
8. enter the number into the empty boxes.

The code is viewable on github here:

Рекомендации по теме
Комментарии
Автор

I know it is a bit late, but could you upload the source code, please?

olomouc_trams
Автор

wow thats amazing
If anyone is interested in the code, let me know - I can share it on github. -- I would love seeing how u did this

yesnonononoooop
welcome to shbcf.ru