Wordward Draw
managore.itch.io
managore.itch.io
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)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.
PS.
Game works better in Firefox.
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.
deer; drab; tun; part; trap; gab; gut; etc.
Obviously, you could just write a script, but it's more fun to dream them up!
Window width as a determining characteristic of a mobile? Come on.
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."
Only issue for me is that the instructions did not pop up fast enough.