Live data from Hacker News

Show HN: Whittle – A shrinking word game

playwhittle.com

51–60 of 64 posts

Re: Show HN: Whittle – A shrinking word game

#52
post #6

Is it always possible to go all the way down to a single letter? I'm working on August 4, and it's proving challenging

Yes, 1 August and 4 August have me stumped. Interestingly it says I have discovered 100% of words on 1 August, but I wasn't able to whittle it down to 0. I'm not sure if that just means I missed an opportunity to remove the space somewhere.

August 1st can be done with

https://gist.github.com/IanCal/f3deffd5961a2cc2860094a4d68ed...

Re: Show HN: Whittle – A shrinking word game

#54
post #22

This is cool, it's kind of the inverse of a game I used to play with my mother: One player says a letter and thinks of a word that starts with that letter, the next player adds a letter (while thinking of a valid word that that could be created with the new prefix). Play continues in this fashion until someone is forced to spell an actual word, then they lose and you can start a new round.

Ghostwriter. https://youtu.be/sGByxW2R3hQ?t=1080

Re: Show HN: Whittle – A shrinking word game

#55
post #23

WOW, we had a similar idea: https://www.shrinkle.org https://news.ycombinator.com/item?id=44714167 Great work!

FWIW I like yours better. I'd just love to play the ones from previous days.

Thank you! You are actually able to play ones from previous days, through the archive (calendar button on the main page).

Re: Show HN: Whittle – A shrinking word game

#56
A solver in SWI Prolog: https://swish.swi-prolog.org/p/PlayWhittle_Solver.pl which you can run by querying in the lower right window:

    solve("brats herbs", Steps).
and seeing:

    Steps = ['rats herbs', 'rat herbs', 'rat hers', 'rat her', rather, rater, rate, ate, at, a, ''] ;
The core is this grammar:

    whittle(S0) --> [S1],                  % state S1 comes from
                    { select(_, S0, S1),   % removing a char from S0,
                      phrase(valid_state(_), S1) }, % S1 must be all words,
                      whittle(S1).         % and recurse.
    whittle([]) --> [].
which describes a solution as a list of successful state changes from input to empty string. Each change removes one character from the string and must leave a valid state after doing that. Prolog's implicit backtracking search means that when it tries "cat","at","t" the valid_state check fails because "t" is not in the wordlist, it backtracks to the previous state "cat","at" and retries, getting to "cat,"at","a","" and success.

So it's doing a depth-first search of the tree of all possible game states that come from removing each letter from each substring, only exploring each branch as deep as the first failure. It stops at the first success, but spacebar or 'next' will search for another solution. Find all 136 solutions by querying: findall(Steps, solve("brats herbs", Steps), Solutions).

It won't work in Scryer, it would need select/3 and the DCG helpers ported/included in the code, then changes to run on strings instead of character code lists. It would likely be more memory efficient then.

Post reply on HN