This article is more than 1 year old

50 lines of Bash to bring a Wordle fan out of their shell

Solved today's in two? Now try and exit Vim

Updated We are delighted to note that a version of the word game the New York Times bought for seven figures can now be played via a 50-line Bash script.

GitHub user "huytd" uploaded the code initially as "less than 50 lines of Bash", although once others got stuck in the script size stood at the magic half century. By our reckoning, that works out at about $20,000 per line, assuming the seven-figure sum is in the region of $1m.

Of course, those 50 lines do not include all the gubbins required to render things on a browser nor the hooks to send a smug little post out to social media so your friends can see how clever you are. However, the requisite colours are present and correct, as is the frustration factor as the attempts mount up without success.

Thankfully, a thoughtful command line parameter (unlimit) will up the limit from six tries to quite a bit more.

We took the script for a spin on a tame Linux box (in this case, running Ubuntu 20.04 LTS) and can confirm that, after a quick chmod to make things executable, tapping in ./ got us our fix.

For the uninitiated, Wordle presents the player with a daily puzzle in which a five-letter word must be guessed with hints regarding correct letters in the correct (or incorrect) places. The game keeps track of one's score, and fans can tweet out their results to all those yet to work out how to mute "wordle" on their social media channels.

The New York Times bought the game from its inventor, Josh Wardle, and plans are afoot to shift it to the NYT site, although Wardle insisted it would continue to be free to play.

Bash script aside, the success of the game has spawned many alternative versions and clones, some lacking the ad-free purity of the original. We'll also draw a discreet veil over the likes of Sweardle, a four-letter guessing game that is as potty-mouthed as you would expect.

Protecting Wordle from the onslaught of clones could present a challenge both in the short and long term. Nick Allan, legal director and head of interactive entertainment at law firm Lewis Silkin, said: "The UK's IP system is not currently very well equipped to protect studios from clone games.

"From a practical perspective, enforcement of IP rights in a mobile games context, especially the hyper-casual genre, can be difficult as well because of their faster development times, sometime shorter shelf-life and the cross-border issues associated with platforms, studios and users around the world.

"Legislators in the UK and other legal systems may wish to consider reforming copyright more generally to make it more fit for the age of the metaverse and the iPhone rather than Telex and Teletext."

In the meantime, we'll continue to get our Wordle fix through Bash and enjoy the educational opportunities afforded by sharing source code.

And if we really fancy a text-based challenge, perhaps we'll fire up Vim. ®

Updated to add

The Register asked Huy about his take on the puzzle and he told us: "The only reason I wrote it is that I want an offline version that I can play on my laptop whenever I'm free, and I think it's kinda cool to learn some Bash."

We couldn't agree more. Just don't be like this writer and spend an embarrassing amount of time forgetting to use chmod...

More about

More about

More about


Send us news

Other stories you might like