Show HN: Whittle – A shrinking word game
51–60 of 64 posts
Re: Show HN: Whittle – A shrinking word game
#52Is 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.
https://gist.github.com/IanCal/f3deffd5961a2cc2860094a4d68ed...
Re: Show HN: Whittle – A shrinking word game
#53Other than that, nicely done game.
Re: Show HN: Whittle – A shrinking word game
#54This 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.
Re: Show HN: Whittle – A shrinking word game
#55WOW, 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.
Re: Show HN: Whittle – A shrinking word game
#56 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.
Re: Show HN: Whittle – A shrinking word game
#57Re: Show HN: Whittle – A shrinking word game
#58Re: Show HN: Whittle – A shrinking word game
#59— my wife
That’s three puzzles in a row that she did first try. Nice work on the game.
Re: Show HN: Whittle – A shrinking word game
#60If anyone else likes simple but fun word games, I made one for iOS here: https://apps.apple.com/app/id1248738929