Late to the party, here is some code to solve the path between each word, just requires numpy and a txt file of 4 letter words "words.txt" separated by lines
import numpy as np
with open("words.txt") as f:
words = f.read().splitlines()
f.seek(0)
chars = np.array(list(ord(c) for c in f.read() if c != '\n')).reshape((-1, 4))
word_to_index = dict(zip(words, range(len(words))))
char_flip = np.sum(chars[:, None, :] != chars[None, :, :], axis=2) == 1
chars_sorted = np.sort(chars, axis=1)
char_shuffle = np.all(chars_sorted[:, None, :] == chars_sorted[None, :, :], axis=2)
adj = char_flip | char_shuffle
np.fill_diagonal(adj, False)
# import itertools
def path_recursive(current, end, adj, path, depth):
if depth <= 0:
return []
if current == end:
return [[*path, end]]
# all_paths = []
for neighbor in adj[current]:
if neighbor in path:
continue
_path = path_recursive(neighbor, end, adj, [*path, current], depth - 1)
# all_paths.append(_path)
if _path:
return _path
# return list(itertools.chain(*all_paths))
return []
def binary_shortest_dist(start, end, adj):
depth = 1
adj_n = np.eye(adj.shape[0])
while depth < 20:
depth += 1
adj_n = adj_n @ adj
if adj_n[start, end]:
return depth
def path(start, end, adj):
start = word_to_index[start.upper()]
end = word_to_index[end.upper()]
depth = binary_shortest_dist(start, end, adj)
print(depth)
adj = [[i for i in np.nonzero(_adj)[0]] for _adj in adj]
paths = path_recursive(start, end, adj, [], depth)
return [[words[i] for i in path] for path in paths]
path("disc", "zero", adj)
Excellent game. I haven't finished it yet (though I got what I'm pretty sure is the hardest picture word) but the key strategy seems to be to pick a (hard) target word, sketch out some chains from there to some easier ones and then try to reach one of those.
Minor suggestions: better contrast in the tab screen for not-yet-founds, have all instructions in the supporting text (i.e. Tab and backspace too). Maybe allow hyperspacing to any word you've previously got to, although that's maybe a bit radical.
Personally I find the dance-ey style of graphics a bit tiring to look at, but that's just me.
EDIT: I'm finding that I tend to fixate too much on single-char replacements and not enough on anagrams. Curious whether that's just me.
Clever and funny game. As a non-native speaker, it took me two hours to finish the game. The last word was a bit difficult to find!
It would be great to highlight the unfound and revealed words on the tab screen. It is hard to find and eye tiring. Background colors are sometimes too flashy and there is some contrast issue between the text and the background color.
It would be great to have the picture in along with the text in the tab screen.
Sometimes I am a bit frustrated when a word is revealed, and I know I was at one letter of this earlier in the game. I am not sure how this frustration could be reduced.
Reminds me of an interview with the composer Elliott Carter, where he said that to fall asleep, he would conjugate Greek verbs in their various moods and tenses. It actually works, and in very short time.
Normally I would agree, but for some reason, the width threshold for going from desktop -> mobile is really wide (1280px) which could genuinely be larger than some laptop screens depending on zoom or scaling.
My brother and I were brainstorming ideas for a new wordle-like game recently and we hit upon this same idea. We looked it up and learned that Lewis Carroll "invented" this game back in the 1800s. He called it "Word Ladders."