Jotto Insomnia
Jan. 22nd, 2002 04:40 amI can't sleep, because my mind has latched onto a very big project that I need to write out. This cup may pass, but at the moment I'm inspired to write a Jotto-playing perl program with a better AI than any I've found on the net, so I'll have something to cut my teeth on between jotto-by-email rounds with
queue. This would have the very beneficial side effect of making me Really Learn Perl.
Step1: write a program that will play "Jotto: Guess My Word".
-requires a function to randomly pick a secret word, and another function to report the score of the user's guessed word.
-enhancement: check to see if user's word would be allowed given previous guesses.
Step2: write "Jotto: Guess Your Word".
-requires an AI. Best I've seen described on the net is an algorithm that keeps track of the set of all possible possible words given previous guesses (which is not hard), and randomly picks a word from that set each round. The author of this AI said he could rarely beat it.
-enhancement: write "Jotto: Guess My Own Word", ie have the program play Jotto against itself. Iterate enough times for the same secret word and calculate an average number of guesses that secret word requires. Record this "par" value for every word in the dictionary. Have J:GMW and J:GYW report the par score at the end of each game. This is a distraction from the main project, but I'm really curious.
Step3: write "Evil Jotto".
-Requires smarter AI. That the above AI can be improved upon should be clear from this observation: "fuzzy" is a bad first-guess word, since over 2/3 of 5-letter words have no f, u, z, or y. At any time, the best guess will be one that divides the possible-word space most evenly between answers of 0, 1, 2, 3, 4, and 5. In the ideal case, this would rule out 5/6 of the remaining words, as opposed to 1/3 in the likely case for "fuzzy". It will require some mathematical thinking to come up with the best way of calculating this quality.
-This will be processor-intensive. Need to make sure that the algorithm that calculates the score of a guess is optimized. I may need to determine a ceiling of word-space space size above which the program uses the dumb AI. However, I could come up with an "opening book" of first-guess words that are good.
-Step4: write "Jotto Master".
-This would be the cleaned-up version that I make available to the world, with options to play J:GMW, J:GYW, and J: Guess Each-Others' Words (the 2-player game). Have user-definable dictionary and various kinds of smartness in the user interface.
-For maximum Evilness, have an option to usually pick secret words with a high "par" value for the user to guess.
I imagine this would be the hardest step, since it would take a lot of research to find out how to make the program run happily in various settings, and satisfy various user desires.
Step1: write a program that will play "Jotto: Guess My Word".
-requires a function to randomly pick a secret word, and another function to report the score of the user's guessed word.
-enhancement: check to see if user's word would be allowed given previous guesses.
Step2: write "Jotto: Guess Your Word".
-requires an AI. Best I've seen described on the net is an algorithm that keeps track of the set of all possible possible words given previous guesses (which is not hard), and randomly picks a word from that set each round. The author of this AI said he could rarely beat it.
-enhancement: write "Jotto: Guess My Own Word", ie have the program play Jotto against itself. Iterate enough times for the same secret word and calculate an average number of guesses that secret word requires. Record this "par" value for every word in the dictionary. Have J:GMW and J:GYW report the par score at the end of each game. This is a distraction from the main project, but I'm really curious.
Step3: write "Evil Jotto".
-Requires smarter AI. That the above AI can be improved upon should be clear from this observation: "fuzzy" is a bad first-guess word, since over 2/3 of 5-letter words have no f, u, z, or y. At any time, the best guess will be one that divides the possible-word space most evenly between answers of 0, 1, 2, 3, 4, and 5. In the ideal case, this would rule out 5/6 of the remaining words, as opposed to 1/3 in the likely case for "fuzzy". It will require some mathematical thinking to come up with the best way of calculating this quality.
-This will be processor-intensive. Need to make sure that the algorithm that calculates the score of a guess is optimized. I may need to determine a ceiling of word-space space size above which the program uses the dumb AI. However, I could come up with an "opening book" of first-guess words that are good.
-Step4: write "Jotto Master".
-This would be the cleaned-up version that I make available to the world, with options to play J:GMW, J:GYW, and J: Guess Each-Others' Words (the 2-player game). Have user-definable dictionary and various kinds of smartness in the user interface.
-For maximum Evilness, have an option to usually pick secret words with a high "par" value for the user to guess.
I imagine this would be the hardest step, since it would take a lot of research to find out how to make the program run happily in various settings, and satisfy various user desires.
no subject
Date: 2002-01-22 06:02 am (UTC)In any case, good luck on the project, and I'd love to discuss a smarter AI sometime.
no subject
Date: 2002-01-22 09:45 am (UTC)I've never taken comp sci, nor ever written a perl program longer than 10 lines, but the degree to which I've been able to think about this like a mathematically-minded programmer is heartening!
no subject
Date: 2002-01-22 10:48 am (UTC)no subject
Date: 2002-01-22 05:36 pm (UTC)Wouldn't *that* make for an interesting Fun-With-Perl writeup?
-Matt, now in search of a wordlist that omits proper nouns like "texas" and technical jargon like "abohm" yet includes upstanding words like "ethic"... I'll probably end up sifting through diffs and putting together my own.
no subject
Date: 2002-01-22 07:06 pm (UTC)no subject
Date: 2002-01-22 08:56 pm (UTC)no subject
Date: 2002-01-23 06:11 am (UTC)re: texas
Date: 2002-01-23 09:53 am (UTC)according to webster's, it is
"A structure on a river steamboat containing the pilothouse and the officers' quarters."
Re: texas
Date: 2002-01-23 10:08 am (UTC)Another welcome side-effect of this project is that my vocabulary of 5-letter words is going to improve markedly!