4 ms·
Show HN: I built a Wordle decoder that guesses your guesses
- Eddy_Viscosity2 5y agoFun, but it left me feeling jealous of someone with this amount of free time.
- mattlock 5y agoHa, it ended up taking a bit more time than I thought it would, but once I started I couldn't stop.
- itake 5y agoCould you post some examples of the results?
- deleted 5y ago[deleted]
- stavros 5y agohttps://www.pastery.net/xfmbvv/ https://www.pastery.net/xfmbvv/ Contains SPOILERS for today's word.
- lastofthemojito 5y agoI briefly had the thought of creating a game where you get a bunch of those Wordle color square messages from in-game "friends", and maybe some side info - "Tim always guesses adieu as his first word", "Jane always uses one of her kids' names - Olive or Hazel", etc and then you have to guess the word. Haven't had time to experiment with it though so not sure how fun it'd be. I don't retain any rights to the idea if anyone wants to run with it and try it out.
- Symbiote 5y agoI tried that in a single game with a friend's Octordle result. You have to solve it yourself first, then work out their initial guesses. Here's my solution to today's Octordle: O = incorrect (white) ~ = wrong place (yellow) # = correct (green) Daily Octordle #40 / octordle.com OOOOO ~~~OO OO~OO OOOOO ~O~O~ OOOOO OOOOO O~#OO OO~OO OOOOO #OOOO O##OO OOOOO ##### #OOOO ····· OOOOO ····· OOOOO ····· OOOOO ····· ##### ····· ~~O~O O~~OO OOOO~ OOO~O OOOOO OOOO~ ###O# OO#OO #OOOO OOOOO OO#OO ##### OO#O~ ····· O~OOO ····· O~~~# ····· O~O~O ····· O~O~O ····· OOOOO ····· ##### ····· O#OOO OOOOO OOO~O ~OOO~ OOOO~ O~#OO OO~OO #OOOO OOOOO ##### #O~O# ····· ~O~OO ····· ##### ····· O#~#O ~#O~O OOOOO OOOO~ OOOOO OOOOO OO~O~ ~O~## OOOOO ~OOOO O~~OO OO~~O #~~OO OO~O~ O#~OO O#OOO O#OO~ ##### ##O## ····· ##### ····· (This one was difficult and/or arbitrary, I normally try and complete Octordle in 11 guesses, i.e. the 8 correct answers plus three extra.) My first three guesses, base64 encoded: VEFSRUQKTE9JTlMKQ0hVTVAK
- lkbm 5y agoThat could be a lot of fun. Someone did a "guess the word based on people's tweets a while back: https://news.ycombinator.com/item?id=30101456 https://news.ycombinator.com/item?id=30101456 Throwing in those extra hints about the players make it feel more like a zebra puzzle, but that's not a bad thing, especially if you want mere humans to solve it. I can't easily process a thousand tweets, so giving more compact data is key.
- yincrash 5y agoEven using the example on the github page, it gives me a crash - /Library/Ruby/Gems/2.6.0/gems/wordle_decoder-0.1.2/lib/wordle_decoder/wordle_share.rb:8:in `block in final_line?': undefined local variable or method `_1' for WordleDecoder::WordleShare:Class (NameError) from /Library/Ruby/Gems/2.6.0/gems/wordle_decoder-0.1.2/lib/wordle_decoder/wordle_share.rb:8:in `any?' from /Library/Ruby/Gems/2.6.0/gems/wordle_decoder-0.1.2/lib/wordle_decoder/wordle_share.rb:8:in `final_line?' from /Library/Ruby/Gems/2.6.0/gems/wordle_decoder-0.1.2/bin/wordle_decoder:14:in `<top (required)>' from /usr/local/bin/wordle_decoder:23:in `load' from /usr/local/bin/wordle_decoder:23:in `<main>'
- mattlock 5y agoAh, that "_1" numbered parameter syntax was added in Ruby 2.7 I actually hadn't used that syntax before this project, was interested in trying it out. I'll document that it only works with 2.7 or later.
- eat_veggies 5y agothe most interesting part of this imo is the heuristic it uses to find the most likely word: # Greatly penalize words that have multiple of the same black letters # Greatly penalize words that have the same black letters as any seen word # Greatly penalize words that have the same yellow letter/index pair as any seen word # Reward words that have yellow letters that match yellow letters in seen words, but in different positions # Reward words that have yellow letters that match green letters in seen words # Penalize words that have yellow letters that don't appear in seen words # Penalize words that have green letters that don't appear in seen words # Rewards words based on commonality # Reward/penalize words based on line indexes and common letters I built something similar to this that just lists all the possible words, and is nowhere near as smart -- but it lets you draw pretty pictures! https://jse.li/wordle-reverse/ https://jse.li/wordle-reverse/
- mattlock 5y agoI honestly thought I removed those comments lol. They might be a little outdated, but yeah, I spent a lot of time thinking about what kinds of information I could glean. There's definitely some bias in there towards a certain kind of strategy/play. I like your project, very creative!
- ghaff 5y agoLooking at the parent run, my first thought was that its initial guess is a relatively uncommon word and is (I assume) probably not a very good choice as an initial guess. There are various lists of the best starting words in order going around. I wonder if you could get to the best results by picking the highest ranked word consistent with the other lines?
- mattlock 5y agoI thought about using lists like that, but it felt a little too much like cheating. My attempt at something like this is, if the word is one of your first two guesses, I reward it for having more common letters. And actually penalize common letter "misses" in later lines. I'm sure it's not 100% optimal, but I saw some improvement on my admittedly very limited set of test data. Here's the relevant code - https://github.com/mattruzicka/wordle_decoder/blob/0bfd7eaacd14aab0c8a0971fe1bbb43a76ad5ff8/lib/wordle_decoder/word.rb#L32 https://github.com/mattruzicka/wordle_decoder/blob/0bfd7eaac...
- evanb 5y agoIf you want to try playing this as a game, you can play the crosswordle https://crosswordle.vercel.app/ https://crosswordle.vercel.app/
- mattlock 5y agoHa, I built a crosswordle solver and didn't even know it!
- yaps8 5y agoI love it, thanks for sharing. Is the confidence a percentage? How is it determined?
- mattlock 5y agoYeah, you can think of it as a percentage. The min is 1 and the max is 99. It could be 100, but I don't trust my mostly untested side project that much, so I cut it off at 99 :) The base confidence score is determined based on how many words a guess technically could be, that's here - https://github.com/mattruzicka/wordle_decoder/blob/0bfd7eaacd14aab0c8a0971fe1bbb43a76ad5ff8/lib/wordle_decoder/word_position.rb#L32 https://github.com/mattruzicka/wordle_decoder/blob/0bfd7eaac... Then, I sort of just willy nilly add/subtract from that based on the "intrinsic" score of the word which is computed here - https://github.com/mattruzicka/wordle_decoder/blob/0bfd7eaacd14aab0c8a0971fe1bbb43a76ad5ff8/lib/wordle_decoder/word.rb#L11 https://github.com/mattruzicka/wordle_decoder/blob/0bfd7eaac... and then the "contextualized" score AKA how well it works with other words, which is computed here - https://github.com/mattruzicka/wordle_decoder/blob/0bfd7eaacd14aab0c8a0971fe1bbb43a76ad5ff8/lib/wordle_decoder/guess.rb#L55 https://github.com/mattruzicka/wordle_decoder/blob/0bfd7eaac...
- deleted 5y ago[deleted]
- ihndan 5y agoThanks for sharing Let's give the secret word more context, try to guess a keyword on this day: https://peotik.com/otd/ https://peotik.com/otd/