To use:
make                             #Compile the game

hangman dict 1   0 human         #Play the game interactively
hangman dict 1   1 human         #Play the game on easy
hangman dict 100 0 greedysimple  #See how well greedysimple plays over 100 games
newdict dict 2   10              #Make a new dictionary of 10 words from the old one
newdict dict 3   100 | organize > outfile #Put a new dictionary in outfile
Format:
hangman <dictionary> <# trials> <showwords> <strategy 1> <strategy 2> ...
Plays hangman
dictionary = the file containing the words to select from
# trials = how many times to play the game
showwords = if it should show the words matching the pattern (0 or 1)
strategy = which strategy that player should use (see below)

newdict <dictionary> <level> <quantity>
Creates a new dictionary based on the statistical properties of the given one. Should be piped through the organize program from alphamet
dictionary = the file containing the words to use
level = the number of consecutive characters to remember (0 to 3)
quantity = how many new words to make

Implemented strategies:
Note that strategies can try to minimize (T)urns needed or number (W)rong.
Numbers given are over 10000 trials.
NameType DescriptionAvgTurnsSTDTurnsMaxTurns AvgWrongSTDWrongMaxWrong
human N/A allow the user to play N/A N/A N/A N/A N/A N/A
random N/A guess letters at random 11.3 5.0 25 8.0 4.5 24
randomrestricted N/A guess letters at random from those that appear in the remaining words 9.1 3.8 24 5.7 3.6 22
greedysimple W count how many times each letter occurs in the remaining words and guess the most frequent one 5.7 2.5 18 1.7 1.9 15
greedyunique W greedysimple, but only counts a letter at most once per remaining word 5.9 2.5 23 1.7 1.9 22
minimax T takes the minimum of the maximum of the number of words remaining in each category for each guess (greedily minimize worst case) 5.2 2.1 25 1.9 1.9 24
minex T takes the minimum of the sum squared (greedily minimize average case) 5.1 2.1 21 1.8 1.9 20
cheatersequential W guesses letter in the order that they appear in the answer 4.0 1.5 12 0 0 0
cheatergreedy W guess the letters from the answer that eliminate the most from the remaining possible words 2.6 0.7 6 0 0 0
cheatersmart T cheatergreedy, but will be wrong if beneficial 2.6 0.7 6 .0025 .05 1

Technical:
Given a word and a letter, the places that the letter occurs in a word can be converted into a bitstring. For example, wordval("google",'g') -> 100100 (reversed) -> 9. Initially, the remaining words list has all the words of a given length. For each guess, the wordval of the answer is compared to those in the list. Any word with a different wordval cannot possibly be the answer, so it is removed from the list of remaining words. Each strategy is passed the array of letters that have been guessed, the pattern of the word including blanks, and the list of remaining words. The cheater strategies look at the answer before making the decision, which is how they are able to get 0 wrong. The other strategies do not.

The length is chosen with the same distribution of the given dictionary. For level 0, letters are chosen uniformly at random. For level 1, the letters are chosen with the same frequency as they occur in the original dictionary. For level 2, the first letter is chosen as in level 1. Subsequent letters are chosen using the letter pair frequencies. If there is not a pair beginning with the preceding letter, level 1 is used. Level 3 works similarly, using triplets of letters and going to level 2 when necessary.

Observations:
It is commonly thought that 'e' is the best first guess. This is true in medium length words. However, it turns out that for long words, 'i' is the most discriminating first guess and for very short words, 'a' is. Try the minex strategy to see.
cheatersmart is able to make wrong guesses if it eliminates more possibilities from the list of remaining words, but this is only the case about .1% of the time. It does not significantly affect the number of turns needed to guess the word.

Downloads:
Hangman C++ source code to the game without the dictionary
Dictionary The dictionary for use with hangman