Do you play Connections,
the popular word puzzle in the New York Times
?
If so, have you ever wished that instead of a shuffle, you could do a sort?
That is, drag and drop the cells until you see patterns.
You could write the words out on PostIts, or you could code up a widget to help out. I chose the latter, mostly because I needed practice in Python. I also wanted to explore cross-platform GUIs. Every time I felt one of my work tools needed a GUI, I never really had time to learn how to make one. I finally got a break from my work schedule and roughed out this very basic tool.
I didn't record what I did at the time, and I forgot which libraries I had to install. I will eventually make a clean environment and walk through this again, logging all actions.
- Python 3.9
Python is an interpreted language, so there is no need for a build phase. Actually, I just checked, and there is some just-in-time processing of the code before execution, so maybe Python is a compiled language.
- Start playing NYT Connections in your browser.
- Take a screen capture of the 4x4 grid to a file.
- Open a terminal
- Run
connections-splitter.py
-
(base) alexodonnell@Alexs-MBP ~ % python3 ./Projects/GitHub/PuzzlePal/code/connections-splitter.py
- Use the file selector to open screen capture
- You may now drag and drop tiles OR use the shuffle button
- Drag and drop does not yet have animation or coloration to help; trust that it will swap the source and destination
- Shuffle will randomize the tile order
- The grid is broken into 16 tiles, each 1/4 of the height and width of the original capture rather than smart border detection.
- No visual feedback of a selected tile
- No visual feedback for dragging
- Tile split is based on quartering height and width, not line detection.