I am trying to create an 'AI' engine to play hangman, Version 2 won every 1 in 5 games, it achieved this via frequency analysis of a list of 12500 words and then picking the highest frequency each time (so it would always pick the exact same letters. However I thought I had just finished version 3 which would use frequency analysis on the full 12500 list and it would then filter that list depending on whether the letter was in it or not and perform the same process - so each time the list will get smaller and in theory the analysis will be more accurate as it is using the frequency for possible words.
However after running my code until 100 wins, I have now found it only wins between 1 in 8 and 1 in 10 times. So it has definitely got less accurate.
Note: the word the engine chooses is from the initial list
There are two possibilities for this:
- My theory that filtering the list would yield a higher accuracy was wrong
- I have made an error in my code
Does anyone have any ideas?