Show HN: Reversle – Find the words given Wordle pattern and the solution word
reversle.net
reversle.net
https://jse.li/wordle-reverse/
Flowers: https://twitter.com/__jesse_li/status/1480341968110690309
Poem: https://twitter.com/__jesse_li/status/1480768147875667971
However, it's just a single 400ish line html file with mediocre code.
When I first opened the link I thought we would have to guess the exact words, in reverse order. But that seems like it would be difficult
Edit: maybe it’s just how I play wordle? I try to minimize reusing burned letters in wordle since they don’t add information. There’s no penalty in reversle for repeating what would be burned letters so it’s easier to template match. It would be interesting to maybe add that constraint to reversle, but then you might have to go back and change earlier lines if you guess wrong
Anyway thanks for building reversle, one of the cooler wordle variants IMO!
(I.e. no placing a letter in a in position where it gives you no new information.)
def is_valid(word, conditions, final_guess):
"""
Checks if it is a valid guess
- word => The word in question
- conditions => The conditions. A string of 5 characters. '-' means a grey cell, 'G' is a green cell and 'y' is a yellow cell.
- final_guess => The final guess.
"""
if len(word) != 5:
return False
for i in range(5):
if conditions[i] == "G":
if word[i] != final_guess[i]:
return False
if conditions[i] == "-":
if word[i] in final_guess:
return False
if conditions[i] == "y":
if word[i] not in final_guess[:i] and word[i] not in final_guess[i+1:] or word[i] == final_guess[i]:
return False
return True
## How to usewith open("/usr/share/dict/words") as f:
for line in f:
word = line.strip()
## Replace with appropiate parameters.
if not is_valid(word, "--yy-", "piano"):
continue
print(word)Thank you for the feedback!
equalArray = function arraysEqual(a, b) {
if (a === b) return true;
if (a == null || b == null) return false;
if (a.length !== b.length) return false;
for (var i = 0; i < a.length; ++i) {
if (a[i] !== b[i]) return false;
}
return true;
}M.solution.colors.forEach(wordToGuess=>{
let flag =false;
c.forEach(item=>{
let result=b(item.toUpperCase(),M.solution.word);
if(!flag && equalArray(result,wordToGuess)){
console.log(item)
flag=true;
}
});
});If you want to make a personal project then cool: go for it. Does it belong on HN though? It's not interesting when it's the 100th clone on the 100th day. But, alas that is what upvotes are for I guess.
I was thinking about a similar reverse-wordle clone, but focusing on mind-reading between friends. The core idea:
1. uploads your full wordle solution screenshot (with each guess) to the server. The server does an OCR and store it.
2. get shareable links from server, send to friends. Each friend gets a unique link
3. friends guess what you guessed.
4. you can see how well each friend guess
The third row reuses two letters that were already revealed in the first row to not occur in the solution, and reuses a third letter at the correct position already revealed in the second row, but omitting a another letter whose correct position was also revealed in the second row. That is, it is clear that this can’t be the solution word, because of the two letters already known to not occur, and because of omitting one known-position letter. And if it was an attempt to tease out more letters, then the guess doesn’t make much sense either because only one of the five letters hadn’t been tried yet in the previous rows.
The fourth row again uses a letter already known to not occur, while reusing two letters already known to occur, but one of them at a known-wrong position. (Of course the letter in question could occur twice, but I don’t think there’s an English word matching “pi_p_”.) Furthermore, none of the letters that are new in the fourth row are likely to occur in the solution, given what’s already known at that point (in fact I don’t think there are any potential solution words where they would fit). So again this is neither an attempt to guess the solution nor a good attempt at teasing out more letters.
Here you go, now you know.