Word-based puzzle solver (Wörtellöser?)

In the course of solving a wordle-esque puzzle, I became wholly distracted by solving the puzzle of writing a wordle-esque puzzle solver to solve the puzzle I was in the middle of solving. I've happily been using wordle-cli for a while. It's been great (i.e. wildly addictive), but it's only in English — although, having just today found the website to share in this post (initially I found the app by chance with brew and installed it that way), it looks like you can customise the language of your choice manually.

However, mere days ago I found cli-wordle, which is multi-language and includes German. The only persistent issue I have with it is that the word list contains a fair few invalid words (e.g. brand/store names, forenames, quite obscure words foreign to both English and German, etc.). Thus far, I've had Fabio, Helga, Edeka (a German grocery store), Exxon, and other unexpected invalid words. Since I'm playing German 'wordle' to expand and strengthen my vocabularly, I rely quite heavily on Duden to double check myself, and when the hidden solution is an invalid word not on Duden I can get rather stuck, so I wanted a simple solver to check I'm not being scuppered by an invalid word. (A macro to automatically delete newly discovered invalid words is nigh...also probably a macro to automatically add newly discovered valid words missing from the list, though I imagine these will be far too basic to be worth sharing :sweat_smile: )

What I probably should have done instead was dig into the Python code that generated the word list to see if I could solve it at the root, but I know Keyboard Maestro vastly better than Python and I got to practise more regex.

Macro Screenshot

Remember to set the path for the word list

Das Wörtellöser | Wordle-esque Puzzle Solver v3.kmmacros (32.7 KB)


Any feedback would be most appreciated, especially for regex. If anything can be simplified, optimised, or otherwise tidied up, I'm always eager to learn more.

1 Like

Not sure how this either a) didn't come up previously in all my testing and subsequent use or b) I never noticed before now, but apparently a-zA-Z in regex does not include äöüÄÖÜß. It's fixed now at any rate :melting_face:

[edit] One more quick fix that I thought had been an anomoly but just figured out how to solve.