50 lines of Bash to bring a Wordle fan out of their shell
- Reference: 1643810418
- News link: https://www.theregister.co.uk/2022/02/02/bash_wordle/
- Source link:
GitHub user [2]"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.
[3]
Thankfully, a thoughtful command line parameter ( unlimit ) will up the limit from six tries to quite a bit more.
[4]
[5]
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 ./wordle.sh 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.
[6]
The New York Times bought the game from its inventor, Josh Wardle, and plans are afoot to shift it to the NYT site, although [7]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.
[8]New York Times outlays seven-figure sum for 1,900 lines of JavaScript – yes, we mean Wordle
[9]On the first day of Christmas, my true love gave to me... a coding puzzle and it's a doozy
[10]LINE Pay leaks around 133,000 users' data to GitHub, of all places
[11]Thousands of Firefox users accidentally commit login cookies on GitHub
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."
[12]
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. ®
Get our [13]Tech Resources
[1] https://gist.github.com/huytd/6a1a6a7b34a0d0abcac00b47e3d01513
[2] https://gist.github.com/huytd
[3] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2Yfq4urmYSCvTuBftLrqT0AAAAMs&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0
[4] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44Yfq4urmYSCvTuBftLrqT0AAAAMs&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[5] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33Yfq4urmYSCvTuBftLrqT0AAAAMs&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[6] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44Yfq4urmYSCvTuBftLrqT0AAAAMs&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[7] https://twitter.com/powerlanguish/status/1488263944309731329
[8] https://www.theregister.com/2022/02/01/wordle_nyt_buyout/
[9] https://www.theregister.com/2021/12/01/advent_of_code/
[10] https://www.theregister.com/2021/12/07/line_pay_leaks_around_133000/
[11] https://www.theregister.com/2021/11/18/firefox_cookies_github/
[12] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33Yfq4urmYSCvTuBftLrqT0AAAAMs&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[13] https://whitepapers.theregister.com/
Re: Quit vim
What could be simpler!
Re: Quit vim
Use Emacs instead:
Ctrl-C,Meta-Bucky-M, "(close-this-buffer-and-the-other-buffers-and-exit-while-saving-probably)"
Not only simple, but totally intuitive!
Re: Quit vim
Esc ZZ
or
Esc ZQ
First saves and quits (must have a filename). Second just quits.
Re: Quit vim
:x
> 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.
I'm disappointed.
Really struggled with it, couldn't think of a 4 letter swear word that ends with E.
The answer was "lube" - I don't care what you do with it, that's not a fucking swear word
arse!
var01, var02 as string
var01 = "lube"
var02 = "arse"
var02 & "-" & var01 =
@Ben Tasker
Oh how I agree with you. The swear version is way harder than the original one. And you only get 4 tries!
I have yet to win..
This isn't the IP you're looking for
Wordle is basically a hangman variant, of which there must be many versions in almost every programming language out there – in Haiku you can even play hangman in the kernel debugger! But the NYT has bought the brand and copyright, and that's what will be the target of any enforcement actions.
/usr/share/dict/words clearly contains some doozies. Of the first five words I tried, I utterly failed to get three of them; kwela, sparm and ebbie.
Usually /usr/share/dict/words is a symlink to the locale of your machine. For some odd reason my locale is set to left pondian, whereas I live on the right. That's about to get fixed.
If nothing else, this script has improved my life! /s
Which is why Wardle chose to use the most common ~2500 words as possible answers (although the possible guesses list is much longer)
They're built in? That means the NYT paid about $400 a word. Their regular journalists must be fuming.
They're in the javascript file.
kwela, sparm and ebbie
The best midfield trio that Arsenal ever fielded if you ask me.
Replying to one's own comment seems bad form, akin to quoting one's own poetry. But the edit window's closed, so here we are.
The readme that accompanies linux.words is quite enlightening, and reveals myriad sources that any scrabble player would bristle at. Fortunately, scrabble word lists abound on the internet, and bring the list down from 25105 words to 12972 (based on what's in fedora 35's list and the 2019 Collins list I grabbed). Caveat: you may have to dos2unix the list before it works as a replacement.
Prior art?
Is this just not a "modern" version of the old Mastermind coloured peg game from the 70's? I seem to remember having an electronic calculator-shaped variant as well many, many, many years back.
Re: Prior art?
Pretty close. Only differences I see is 26 letters versus a smaller number of colours, and Wordle tells you exactly which items correspond to black or white pegs whereas you had to figure that out for yourself in old-school Mastermind
Re: Prior art?
TechTangents released a video yesterday showing both Mastermind and an electronic game which does look like a calculator.
Link should show the calculator in that video
https://www.youtube.com/watch?v=rLUmER9dn9A&t=1s&ab_channel=TechTangents&t=309
Re: Prior art?
You know that, I know that and the NYT legal department know that. Will that stop them though?
I think we all know the answer to that as well.
Re: Prior art?
The artwork, music and software are protectable with copyright. The game mechanics might be copyrightable but if that is possible then the rights belong to the creator of the word variant of mastermind from decades ago.
Prior art is a term from patent law. I have no idea if game mechanics can be patented. Depending on jurisdiction, the prior art may not be a problem: [1]some jurisdictions specifically legalise ripping off other people's ideas if they go with "first to file a patent". Other jurisdictions go with "first to invent" so a patent can be ruled invalid with prior art and a large pile of money.
Software is a branch of mathematics so it is not patentable subject matter according to WIPO. The implementation is protected by copyright but not the idea. In theory someone can legally create their own implementation and distribute it. Patent offices are skilled in ignoring patent treaties and will grant patents for the idea for some software. In the EU you have to call a software patent a "computer implemented invention" in the filing but you don't even need to pretend in the US. Although software computer implemented invention patents are granted they may or may not be valid. That does not matter at all as the cost of litigation convinces many defendants to settle without a fight.
[1] https://patents.google.com/patent/US1905473A/en
"And if we really fancy a text-based challenge, perhaps we'll fire up Vim."
Easier than getting out of a Windows update according to https://www.tomshardware.com/news/windows-update-needs-eight-hours
"may wish to consider reforming copyright .. for the age of the metaverse"
Do they mean that copyright terms should be shortened now that we're in the metaverse and everything moves faster?
Quit vim
Esc :q! Enter
Or press the power button for 10 seconds.