12 ms·
Looking at the source, this doesn't handle ambering of repeated letters correctly: let mut diff = [Match::Black; 5]; for (i, &b) in input.iter().enume
by ylyn 5y ago
Looking at the source, this doesn't handle ambering of repeated letters correctly:
let mut diff = [Match::Black; 5];
for (i, &b) in input.iter().enumerate() {
if solution[i] == b {
diff[i] = Match::Green;
} else if solution.contains(&b) {
diff[i] = Match::Amber;
}
}
If the solution is "crest", for example, guessing "class" should give green for the first s and black/grey for the second s, but your implementation will give amber for the second s. And if you guess "stars", then only the first s should be amber, and the second should be black.
- conradludgate 5y agoOh interesting. Fair enough. I didn't bother (or care enough) how it handled multiple of the same letter. I might patch it later
- Biganon 5y agoThis is a key behavior, without it the game is basically useless
- conradludgate 5y agoI'd disagree with this. Sampling bias but I do have a 100% win streak average of 4 and I've never needed this information to win
- Jtsummers 5y agoYou may not have needed that information, but if the game marks both instances of the same letter as amber (correct letter, wrong place), but there is only one instance then it has misled the player. That's incorrect behavior. The player should be able to discern from their guess which letters and how many of them there are in the solution. They shouldn't be led towards a wrong answer. It's not a stellar plan, but if someone starts off with a guess like "abyss" and there is only one 's', they shouldn't be tricked by the game.
- brewdad 5y agoNot to mention, if you play on hard mode, using that non-existent second 's' is now required. I get that this implementation doesn't have a hard mode, but most of my friends play in hard mode, in practice, even if the box isn't ticked on.
- airstrike 5y agoYou may disagree, but you're still wrong.
- conradludgate 5y ago>> without it the game is basically useless This is what I am disagreeing with. It's not useless. I have and can play it just fine without that information. I already have a fix implemented, but it was an extreme statement that I was saying is wrong
- airstrike 5y agoBut that's the thing, you can't "play it just fine". You can play a broken version of the game. Nobody is interested in a game that is 90% correct. And then on top of that you're being defensive when you receive very valid feedback instead of gladly accepting it. What's the point of even posting to HN if you're not welcoming feedback?
- conradludgate 5y agoWhen did I not accept the feedback? I fixed it. I said it was interesting. I didn't accept that it was "unplayable" which is hyperbole
- csallen 5y agoYou come off as somewhat defensive, dismissive, uncaring. Which are normal and justifiable human emotions when someone is criticizing your creations. But "the crowd" really doesn't like to see them expressed. So it's a good rule of thumb when posting these things in public to err on the side of being gracious and grateful. Like it or not, it's just good PR.
- conradludgate 5y agoI agree in a sense, but I was initially responding to someone who said the game was "useless" without this, which in my experience is just not true and rude itself (and most people I know don't understand the rules of how it handles doubles) The "didn't care" part was referring to my initial research, and not the fix. In my top level comment, I mentioned this was a quick couple hour project. I didn't mind the initial criticism. Like I said before, I found it interesting.
- furyofantares 5y agoI get 3 quite often, and it's a major part of the game, and probably the most fun/interesting consideration.
- contravariant 5y agoFor something that can only occur when the answer contains a letter twice that seems a bit harsh.
- Biganon 5y agoThe problem also happens if the answer contains the letter once, but the guess contains it twice. Imagine the middle letter in the answer is an E, no other E anywhere. I guess EXXXE (assuming that's a word). Both E are yellow: that's incorrect. There's 1 misplaced E and one superfluous E. Which is which is arbitrary. In the version of the game I made from my discord bot, I go left to right, so the E on the left would be yellow, the one on the right would be grey.
- CrazyStat 5y agoIt is unnecessarily harsh, but the behavior is also important if the answer contains a letter once but your guess contains it twice, not only if the answer contains it twice.
- daemoens 5y agoIronically, today's answer had the same letter twice.
- deleted 5y ago[deleted]
- dTal 5y agoSpoilers!!
- deleted 5y ago[deleted]
- iso1210 5y agoFirst half a dozen or so times I did it I just assumed you couldn't have a duplicate letter.
- 5y ago
- cwackerfuss 5y agoI maintain an OSS wordle clone that has solved this problem if you'd like to check it out as inspiration: https://github.com/cwackerfuss/word-guessing-game/blob/49279f73e091bb063ed46df9c400011d5a65f41a/src/lib/statuses.ts#L60 https://github.com/cwackerfuss/word-guessing-game/blob/49279...
- conradludgate 5y agoI already have a working fix, but thanks for offering
- renewiltord 5y agoFascinating how the perceived tone of the initial response can change the outcome of the deepest thread. Sensitive dependence on initial conditions. Human conversation meets James Gleick’s Chaos conditions!
- Arnavion 5y agoThere's nothing even wrong with the initial response. On the contrary, "Fair enough" and "I might patch it later" led to "the game is basically useless" and "You come off as somewhat defensive, dismissive, uncaring". I think some people just had their cereal pissed-in this morning and/or need to look in the mirror.
- renewiltord 5y agoI think I could have predicted the response, overall. But I enjoyed how little you have to deviate to have a completely opposite outcome.
- tsumnia 5y ago> this doesn't handle AMBERing of repeated letters correctly Sigh... this game has ruined 5 letter words for me. Saw it and immediately thought "how's that for an opener?"
- re 5y agoIt's interesting to me how common this bug with the coloring of repeated letters in guesses is in Wordle clones, as well as how often there are disagreements in comments about what the correct behavior should be. IMO, this is something that ought to be called out in a hypothetical formal specification of Wordle, but I kind of like that it isn't mentioned in the instructions for the game, from a gameplay/learning perspective. It encourages people to reason through what the correct behavior ought to be on their own, and to experiment to see how the implementation marks guesses; the assumption that letters can't be repeated is one that a lot of people don't realize that they're making. https://news.ycombinator.com/item?id=30174386 https://news.ycombinator.com/item?id=30174386 https://news.ycombinator.com/item?id=30086083 https://news.ycombinator.com/item?id=30086083 https://news.ycombinator.com/item?id=29964725 https://news.ycombinator.com/item?id=29964725 https://news.ycombinator.com/item?id=29947881 https://news.ycombinator.com/item?id=29947881 https://news.ycombinator.com/item?id=29828652 https://news.ycombinator.com/item?id=29828652 https://news.ycombinator.com/item?id=29699516 https://news.ycombinator.com/item?id=29699516 https://news.ycombinator.com/item?id=30103848 https://news.ycombinator.com/item?id=30103848
- IanCal 5y agoIt's making me think that this will be a future fizzbuzz/bowling pin/Roman numerals kind of example for programming.