News for hackers. Stuff that matters.
Re:Show HN: A simple Wordle clone in 60 lines, using Hypersc... by jaidhyani on Wednesday January 26, 2022 @09:50AM (#30086083)
This is awesome, but there's a slight bug in this implementation: Wordle won't count additional instances of a letter as wrong-position, it'll just flag them as wrong. For example, if the word is TRACE, and I guess TRACT, the first T will be green, but the second T should be black, not yellow. In this implementation, at the moment, TRACT would return GGGGY, but in Wordle it would be GGGGB.

I actually made the same mistake in a Wordle solver I was writing recently - it's easy to miss, since Wordle doesn't make this explicit and you have to infer it yourself.

Re:Show HN: A simple Wordle clone in 60 lines, using Hypersc... by ajusa on Wednesday January 26, 2022 @10:32AM (#30086694)
Oh wow, I never noticed that myself. I'll fix it once I'm at my computer, thanks for pointing it out! The fix will probably be something like

    if letter not in (.bg-warning in first .guess).innerText then add .bg-warning
Haven't tested as I'm on my phone, but seems like a simple enough fix.
Re:Show HN: A simple Wordle clone in 60 lines, using Hypersc... by anonymoushn on Wednesday January 26, 2022 @01:21PM (#30089479)
I don't think it's that simple. For HOUSE, guessing BEERS should get you WYWYW
Re:Show HN: A simple Wordle clone in 60 lines, using Hypersc... by Aethylia on Wednesday January 26, 2022 @03:35PM (#30091399)
I have been trying to figure this out myself. The algorithm I'm using is to colour yellow only if the count of that letter before that occurance in the guess, is less than the count of that letter in the target word.
Re:Show HN: A simple Wordle clone in 60 lines, using Hypersc... by joeframbach on Wednesday January 26, 2022 @06:27PM (#30093654)
Looks good, here are some test cases off the top of my head.

guess: "SASSY", target: "BRASS", expect either "YYBGB" or "BYYGB". I believe your algorithm would return "YYYGB".

guess: "BRASS", target: "SASSY", expect "BBYGY"

guess: "ASSET", target: "BRASS", expect "YYYBB"

guess: "BRASS", target: "ASSET", expect "BBYYY"

Re:Show HN: A simple Wordle clone in 60 lines, using Hypersc... by xmonkee on Wednesday January 26, 2022 @12:04PM (#30088140)
Haha, I made the exact same mistake in my wordle solver. Well, not a mistake since that's what the worlde docs say.