This doesn't handle Yellow result correctly. Specifically, if there is a repeated letter in the guess but that letter appears once in the actual word, then the second occurrence will get a Black instead of a Yellow.<p>In other words, a Yellow result doesn't just mean that letter occurs somewhere. A Black also doesn't mean the letter occurs nowhere.
Slightly off-topic - I've seen wordle become very popular out of nowhere, and haven't been following it. I'm trying to understand how it would be played. Is this basically Lingo (a gameshow on Dutch TV) but for individuals and as an app?
Doesn't work for me on linux using 5.1.8(1)-release (x86_64-pc-linux-gnu). Output with `set -vx` at top (I guessed "fooba"):<p><pre><code> ++ [[ false != true ]]
++ guess_count=1
++ [[ 1 -le 6 ]]
++ echo 'Enter your guess (1 / 6):'
Enter your guess (1 / 6):
++ read guess
fooba
+++ echo fooba
+++ tr '[a-z]' '[A-Z]'
++ guess=FOOBA
[... ÉTUDE =~ FOOBA ]]
++ echo 'Please enter a valid word with 5 letters!'
Please enter a valid word with 5 letters!
++ guess_count=0
++ [[ false != true ]]
++ guess_count=1
++ [[ 1 -le 6 ]]
++ echo 'Enter your guess (1 / 6):'
Enter your guess (1 / 6):
++ read guess</code></pre>
Really neat!<p>I wish bash would have a nicer way to address a character in a string though. How hard would it be to use the same syntax as for arrays for it?<p>By the way, this can be expressed simpler:<p><pre><code> guess_count=$(( $guess_count - 1 ))
</code></pre>
As<p><pre><code> ((guess_count--))</code></pre>
And here’s a quick one-liner to solve Wordle puzzles:<p><a href="https://twitter.com/AlexWeichart/status/1488223629867462664" rel="nofollow">https://twitter.com/AlexWeichart/status/1488223629867462664</a>
Someone needs to make the obligatory "Wordle clone in 50,000 lines of react/java/nosql/docker/terraform/documentation/7GB of unused dependencies" :)