Hacker News new | past | comments | ask | show | jobs | submit login
Tangoing with a Martin Gardner Word Game (pncnmnp.github.io)
48 points by pncnmnp 15 days ago | hide | past | favorite | 9 comments



> Take, for example, "Day," which is even, and "Say," which is odd. Since the "-ay" suffix is consistent, it indicates that "S" is the first letter in the target word.

Am I missing something? Given that information, couldn’t the D+a or D+y be correct?

(I understand those cannot be correct because of “May”, but not from the consistent suffix alone)


The sentence is missing the example of "May", as you observed. It should say:

> Take, for example, "Day" and "May", which are even, and "Say", which is odd. Since the "-ay" suffix is consistent, it indicates that "S" is the first letter in the target word.

(Because as "Day" and "May" have the same parity and different from "Say", it must be that "D" and "M" must have the same correctness and different from "S", and as only one letter can be correct, that letter must be "S".)


You're correct. In fact I'm not seeing any two probe words that will give you a definite piece of positive information, without taking into account a third word.

I made my own mistake when trying to figure out this puzzle, that I didn't notice until your comment prompted me to go back and check through it again. I thought after the three even words, the solution had to BAY or all three even words had to be zeroes. But without using any of the odd probe words, words starting with BU- are also still a possibility.


I think that line was meant to help you understand how the algorithm works internally, not what information was revealed the player.


The abstract strategy game mentioned is listed on BoardGameGeek: https://boardgamegeek.com/boardgame/1047/mem


Spoiled by grep:

   cat words \
   | grep -E '^(da[^y]|d[^a]y|[^d]ay|[^d][^a][^y])$' \
   | grep -E '^(ma[^y]|m[^a]y|[^m]ay|[^m][^a][^y])$' \
   | grep -E '^(bu[^y]|b[^u]y|[^b]uy|[^b][^u][^y])$' \
   | grep -E '^(s[^a][^y]|[^s]a[^y]|[^s][^a]y)$' \
   | grep -E '^(d[^u][^e]|[^d]u[^e]|[^d][^u]e)$' \
   | grep -E '^(t[^e][^n]|[^t]e[^n]|[^t][^e]n)$'


What about exact matches for words from the odd list? This wasn’t the case here but in theory ‘see’ could have been in the odd list.


Typing that is harder then solving.

Need a version that generates the grep from input


I generate those with VIM macros. For example, I might type "day", "may", and "buy" on separate lines, move cursor to "day" and then type something like

   qayy3pklli[^<ESC>A]|<ESC>gJli[^<ESC>la]<ESC>A|<ESC>gJi[^<ESC>la]<ESC>A|<ESC>gJi[^<ESC>la][^<ESC>la][^<ESC>la]<ESC>q
And then @a to apply the same expansion to "may" and "buy". (Rather than parsing the keystrokes above, it's probably easier to derive keys with similar effects by using VIM interactively).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: