Solves Multiplayer Crossword using Hit and Trial Method.
The code is adequately commented and will be easy to modify and make it work with other crossword puzzles too.
See Full Video Here
- Takes the screenshot of the first box of the crossword
- Does Image processing on it and then checks if it is black, filled or empty. (using
np.mean
) - If the box is empty it fills it with the first letter according to the frequency of alphabet in English language
- It then clicks the
Check All
button and moves forward to next box. - This is repeated for all the alphabets for all the empty boxes until no box remains empty.
Note: Yes I know that it can just click the Check All
button once after all the boxes are filled with the alphabet and it will make the program faster. I just found this approach a bit more pretty : ) Fell free to change it , in my testing it was about 4 sec faster.
Got more Ideas ? Feel free to dive into the code.
-
pip install numpy
pip install pyautogui
pip install opencv-python
pip install mss
Open the Crossword Game
Start the python program by typing this in command prompt:
python3 cross.py
Edit the p.PAUSE=0
to edit the time between the clicks , I recommend you start with 0.25 and reduce it from there
Edit the monitor = {"top":270,"left":20,"width":20,"height":20}
to change the detection box for the first box of the crossword, try to make the detection box small and prevent the numbers on the crossword
Change the os.system('clear')
to os.system('cls')
if you are on windows.
Special thanks to Chris Zetter for making an awesome multiplayer crossword game
If you like this Project don't forget to go and star his repository too.