Live data from Hacker News

Show HN: Simple Wordle solver in command line in Python

github.com

1–10 of 16 posts

Re: Show HN: Simple Wordle solver in command line in Python

#3
Correction: I thought this was script to solve Wordle puzzles, so I provided a cheat helper below. At first blush, I thought the idea was for the human to feed this script information back from Wordle so it could improve its guesses. Sigh

Also, you really need better names for your methods and variables, starting with this bit here: https://github.com/KevinXuxuxu/wordle_machine/blob/64a8534ad...

As you think about a better way to name those, you will realize it is possible to do this in a much less convoluted way.

Hmmm, I have been using this Perl script:

    #!/usr/bin/env perl

    use strict;
    use warnings;

    use feature 'say';

    my @words = grep # Add conditions below 
        !/^[A-Z]/,
        grep length == 5,
        map split, do { local $/;  };

    say for @words
Invoke it from the command line with your word list. I've been lazy, so I use `./wg /usr/share/dict/words` which means way more options than a more tailored word list would give which means I am only cheating a little. So, for example, I type "amber" as my first move and I am told "e" is in the wrong spot and none of the other letters match, I update the selection using that information:

    my @words = grep # Add conditions below
        !/^...e/  &&
         /e/      &&
        !/[ambr]/ &&
        !/^[A-Z]/,
        grep length == 5,
        map split, do { local $/;  };

Re: Show HN: Simple Wordle solver in command line in Python

#6
post #3

Correction : I thought this was script to solve Wordle puzzles, so I provided a cheat helper below. At first blush, I thought the idea was for the human to feed this script information back from Wordle so it could improve its guesses. Sigh Also, you really need better names for your methods and variables, starting with this bit here: https://github.com/KevinXuxuxu/wordle_machine/blob/64a8534ad... As you think about a…

Thanks for the reply! I really appreciate your feedback on this. I wasn't giving much thought about coding style and naming etc. when I worked on this, just wanted to get it running asap. I'll definitely take a better look at your suggestion (I'm not very familiar with perl) and see if I find any time to improve this thing. cheers.

Re: Show HN: Simple Wordle solver in command line in Python

#9

Is Aeros the entropy maximizing first guess?

No need to “entropy maximize”.

There’s only ~12k-13k five letter English words in the dictionary. Check /usr/share/dict/words file (if you use Windows, go find a dictionary file elsewhere).

The first word should be a word that roughly eliminates half the words, regardless of getting any letters right or wrong.

Count the letters in each position and calculate & rank the words that closely eliminates 1/2 the whole list. Use that as a filter and binary search until there’s only 1 word left.

Wordle is the same game as mastermind and hangman and wheel of fortune.

I’d argue Aeros is not the optimal first word in order to filter and binary search the list of five letter words. Homework to be left to the wordler.

Post reply on HN