

At first, the available information is only the length of the word, but later we will know some of the letters and their positions and also some of the letters that are not in the word. My hangman algorithm uses all available information to produce a list of candidate words. First, let me describe the algorithm that we are attacking. It is claimed that the game dates back to Victorian England, when hanging was probably an acceptable punishment for poor spelling! My design, the 13-game, is easier for the guesser, as he or she is allowed more mistakes before losing.

There are various designs of gallows and man I learned on the one above, which has 13 elements, but I have seen many possibilities between 10 and 13, and there are probably others. If the gallows and man are complete before the word is fully guessed, the second player has been hanged and loses. If it is not, then the chooser takes great pleasure in drawing a component of a gallows with a man hanging from it. If a guessed letter is in the word, the word chooser must reveal the position of every occurrence of the letter in the word. The second player repeatedly guesses letters. In case you don’t know, the idea of hangman is that one player thinks of a word and tells the other player how many letters it has. She asked the obvious question that never occurred to me at the time: “What are the hardest words I can choose, so that I can beat it?” Now, three years later, my daughter is old enough to play, but the Demonstration annoys her, as it can always guess her words. It successfully guessed my test words and I was satisfied, so I submitted both to the Wolfram Demonstrations Project. I spent the time on the London Underground thinking about optimal strategies for playing it, and wrote the version for the computer doing the guessing on the return journey. A simple question from a six-year-old about hangman turned into another analysis obsession that made me play 15 million games of hangman recently.īack in 2007, I wrote a game of hangman for a human guesser on the train journey from Oxford to London.
