Wordle

You must surely know Wordle, but just in case you don’t, it’s a daily game where you have to guess a five-letter word in six goes. I won’t post an example in case it’s one you haven’t done. If you get the right letter in the wrong place, you get a yellow tile. The right letter in the right place gets you green. The wrong letter completely yields a black tile.

This is very similar to the old computer game Moo and the board game Mastermind. I’d even go so far as to say it basically is Moo, but with words rather than numbers or patterns of colours. Mastermind works like this. One player sets up four pegs of different colours, including missing ones, which is hidden from the other. The other then has to guess by putting down their own sets of pegs along something like twenty holes, depending on the size of the board, and the first player places black or white pegs in a 2×2 grid at the side of the guess row indicating right pegs in the right place (black) and right colours in the wrong place (white). The colours of the guesses seem to have changed, as indicated by this illustration:

Photo taken by User:ZeroOne

Completely wrong guesses are indicated by blanks. Mastermind came out in 1970, and in my own child mind there was a clear association with the quiz programme but in fact the two have little in common. I actually thought it was a tie-in at the time, but I no longer think it was and it seems to have been coincidental. I have a tendency to be silly with games, and even more so as a child, and I remember one of my “patterns” being completely empty. I won with that one.

Moo is kind of the same game. Invicta, the company which made the “board” game, actually branded a calculator-like device in 1977 on which one could play that game:

By MaltaGC – Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=114645559

Moo was written for the TITAN computer system in the 1960s. I first came across it in a BASIC programming language primer in 1981 CE. This version has the computer generate a four-digit positive integer which the user then has to guess. Right guesses in the right place are “bulls” and right ones in the wrong place are “cows”. It’s been proven that any four-digit sequence needs at most seven goes to get it right. Before being computerised, Bulls & Cows was a paper and pencil game.

Wordle is a little different, but not very. There is a four-letter version which was apparently also a pencil and paper game and that variant is out there online too. I imagine the issue with that is that a lot of profanities would be used.

Now, I could make myself out to be an expert on Wordle but I’m really not. I’m sure there are strategies but so far I haven’t worked one out much. Because you only get one go a day, it’s hard to practice. Certain combinations of letters are more likely in English generally. For instance, if there’s a Q there will very probably be a U, meaning that Q is only likely to be found in the first three positions. A while back I actually studied form for the first hundred or so Wordle answers, tallying which letters were most likely to occur in which positions. This is not completely random because five-letter English words will inevitably have certain features. For instance, no word in English, so far as I know, begins with “MK” or “TK”, but many begin with “SL” and “TH”. Based on this selection, it came to appear that the most likely word was “SRORE”, which is plainly wrong. A more likely word is “SHIRE”. However, there is actually a definitive list of all Wordle answers and that word was used on 22nd January 2022. No, I haven’t looked closely at that list although I do know what the last word is.

Wordle has a finite lifespan. It will end on 20th October 2027 and there are a total of 2 314 words. However, there is a much larger number of words allowed in the sequence leading up to the answer. I have the number 12 000 in my head but maybe not. This is the biggest difference between Wordle on the one hand and Moo and Mastermind on the other. The other two permit any combination, meaning that nothing needs to be stored. To use modern jargon, the patterns in the other two are procedurally generated. There is an algorithm which determines which symbols occur where, or rather, it’s completely random. In computerised versions it’s more likely to be pseudo-random. Not so with Wordle, which needs a series of stored words. Or does it? Is there a way to determine meaningful English five-letter words? It’s already clear that very few if any of end in Q, but my intuition tells me that at best there would be a substantial number of nonsense words if you tried to do this, which rules out that approach.

It might be thought that the game’s reliance on a set number of words would make it a creature of the age of cheap information storage, but this is only partly true. The ASCII version of an uncompressed list of 2314 five letter words is only 11K plus a couple of hundred bytes, and even that’s a lazy way of storing them because only two dozen and two characters are in use, which is only five bits per character, reducing it to just over 7K. This is with no real compression algorithm, but of course there can easily be one because of common sequences of vowels and consonants, or both, and the non-occurrence of letters in particular places. For instance, it’s rare for a Y to occur immediately before another letter in the middle of a word and rare for an I to occur at the end. However, because of the list of permissible words this is not the whole story, and if that is 12 000 the storage needed will be several times larger at around 37K.

I will now appear to digress.

In 1987, the big hit computer game was of course Tetris, also known, a little irritatingly, as TETЯIS. At the time the kind of home computer you might find which was somewhat up-market but nonetheless just about affordable for some people was the Amiga 500, with a 68000 CPU, 512K of RAM and a screen resolution comparable to that of a PAL TV. Nonetheless, there is now a version of Tetris for the ZX81 and it would’ve been feasible to write one for the very first mass-market microcomputers, particularly the Apple in low-resolution graphics mode. This brings to mind the oddity that whereas some inventions depend heavily on a series of predecessors leading up to shortly before their own appearance, others are just waiting for someone to think of them. The form factors of PC cases are, er, a case in point. It would’ve been entirely feasible for a Georgian cabinet maker to have churned out wooden and metal PC cases although it would’ve been a while before anything suitable could’ve been put in them, so there would’ve been no market.

End of apparent digression.

Wordle is an example of this low-dependency type of game. In 1755, a couple of people could’ve taken Samuel Johnson’s dictionary and used it to play it. Even in computer form it could’ve existed quite a long time ago. The limiting factor is the storage space needed for the list of possible intermediate words. There are a total of 12 972 words in its dictionary, whereof only a small fraction are permissible as answers. It’s possible, using modern compression algorithms, to get this down to 43K but that doesn’t mean an old computer would have had the storage space to process such algorithms, which might also be very slow. However, even without working very hard it’s feasible to get this down to 40Kb, meaning that the entire dictionary could be held in the RAM of an eight-bit computer. That computer would of course have to do other things than just hold words in its memory. Dispensing with that requirement, it would also be possible to take the same approach as early spell-checking algorithms and have the machine check words for feasibility. For instance, it could disallow any instance of five identical letters or impronounceable consonant clusters, or, as Commodore 64 Scrabble used to do, simply trust the user not to use nonsense words. With the latter approach, only 12K of RAM would be required for the list of right answers.

Here’s a possible 16K ZX81 implementation of Wordle. There are 2314 words in the dictionary, compressed to a packed five-bit per letter form, taking up less than 12K. There is no error-checking for forbidden words. A correct letter in the correct place is shown as white on black, a correct letter in the wrong place as black on white flashing with white on black, which would have to be done through software, and a completely incorrect letter is black on white. The program asks for the date when you start, converts it to a position value for a compressed series of strings (maximum string length on the ZX81 was 4096, so three strings would be needed) and loads that four-byte value into a short string literal, clearing the last seven bits which would belong to the next word. Every word the user inputs is appropriately compressed and compared five bits at a time with the string. This is then displayed on screen with only the flashing letters stored by position in the display file. If all letters are correct, the appropriate response is generated from an array depending on how many turns the user has had.

I think it’s clear that if this is feasible on a 16K ZX81 it would also be feasible on practically any computer (except maybe the MC-10) manufactured since 1982, and in most cases colour could be used. This is not a difficult game to implement, even in BASIC, although it seems to lend itself more to BCPL, C, FORTH or Assembler. It’s just eminently doable, and it even existed in some form on computers back to about 1968.

As to strategy, I have little idea. There’s little opportunity to practice with only one word a day, and in that way it’s a bit of a leveller. I have developed very rudimentary tricks. For instance, I tend to move a letter one place in either direction if it’s the right one in the wrong place, I start with a small list of possible words (CRANE, ADIEU, POINT or SOARE) and avoid impossible consonant clusters, which I have to anyway because they aren’t in the dictionary. I can’t actually implement this algorithm because it would involve looking at the word list and therefore cheating, but obviously it can be done quite straightforwardly.

Bye for now.