Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #14956
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Slightly off-topic: Determining the strength of "Hangman" word. |
| Date | 2012-05-31 09:44 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <00546a61-0951-4417-8d8d-79801837d8da@googlegroups.com> (permalink) |
| References | <GYMxr.5280$Bn.3533@newsfe12.iad> |
Daniel Pitts wrote: > I've been playing a bit of Zynga's "Hanging with friends". I was > thinking about how to go about creating an "aid" for this. I don't > cheat, but I like solving these kinds of problems, just to prove I can. > > There are two phases in Hanging with Friends. One phase is to guess the > word that your opponent has constructed, and the other phase is to > construct a word yourself. > > In the construction phase, you are given a "bag" of 12 letters. I'm not > sure if its a completely random distribution. I suspect its weighted in > some way. Anyway, that's not relevant for this question. > > So, It is relatively easy to write a program that uses a word list (such > the "official scrabble dictionary" word lists in the Moby collection), > to find all words in that list that can be constructed from the bag. > > The problem is determining the strength of the word, how hard it is to > guess. > > There is probably a psychological component to this, since the "average" > player isn't likely to use logic and will more likely just "guess" > letters that seem likely. A program (or expert) has the advantage > (somewhat) in that it can figure out statistically which letters are > most likely based on the remaining possible words, and it would then > "guess" that letter. Although I'm not certain that is actually the most > effective strategy either. > > The algorithm for the "guess-ability" of a word is made more complicated > by the fact that the word itself effects how many failed guesses > opponent can have before losing the round. I'm not sure what the > algorithm is for that, though I suspect it has to do with the number of > distinct letters and word-length. > > Any thoughts on algorithms or data structures you might use to solve > this kind of problem? > > I've solved parts of this already. I've created "LetterBag", "Word", > "LetterSet", and "WordIndex" classes. > > The WordIndex makes it easy to find "All words that match a pattern, but > don't contain letters in a specific LetterSet" and "All words that can > be made from a specific LetterBag". > > Oh, and to tie this into a previous thread, the whole thing fits in > memory with room to spare ;-) You could run a neural net over words opponents have constructed in historical games and run it as a predictor for new games. www.syncleus.com has an open-source NN (and more) implementation. -- Lew
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Slightly off-topic: Determining the strength of "Hangman" word. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-05-31 09:26 -0700
Re: Slightly off-topic: Determining the strength of "Hangman" word. Lew <lewbloch@gmail.com> - 2012-05-31 09:44 -0700
Re: Slightly off-topic: Determining the strength of "Hangman" word. Roedy Green <see_website@mindprod.com.invalid> - 2012-05-31 10:43 -0700
Re: Slightly off-topic: Determining the strength of "Hangman" word. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-05-31 11:34 -0700
Re: Slightly off-topic: Determining the strength of "Hangman" word. Roedy Green <see_website@mindprod.com.invalid> - 2012-06-01 02:55 -0700
Re: Slightly off-topic: Determining the strength of "Hangman" word. Gene Wirchenko <genew@ocis.net> - 2012-06-01 09:34 -0700
Re: Slightly off-topic: Determining the strength of "Hangman" word. Roedy Green <see_website@mindprod.com.invalid> - 2012-06-01 11:58 -0700
Re: Slightly off-topic: Determining the strength of "Hangman" word. Lew <lewbloch@gmail.com> - 2012-06-01 12:46 -0700
Re: Slightly off-topic: Determining the strength of "Hangman" word. Lew <lewbloch@gmail.com> - 2012-06-01 12:45 -0700
Re: Slightly off-topic: Determining the strength of "Hangman" word. Gene Wirchenko <genew@ocis.net> - 2012-06-01 13:46 -0700
csiph-web