Keep It Simple, Stupid | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Ok, so a few people have mentioned that they remember playing the same game I got the idea from back in the day on an Apple something or other. Zaxo thinks he might even have the original source code in a book some place. Other people have asked how the logic tree works.
It starts with a root question at ($x = 1,$y = 1) (it is very important to pick a good root question because you are eliminating half of the possibilities every time you answer a question. To get to the next entry in the logic tree, you need only determine if the answer was yes or no. $x always increases by 1, and $y either becomes 2 * $y or (2 * $y) - 1. You continue through the logic tree until you find a Guess and not another Question. It is then a simple matter of modifying the logic tree with the new information to get "smarter". I want to remind everyone that my code is a guess as to what the original looks like. It was many years ago, and I am sure it could be much cleaner. Some ideas that I had are: Thanks, In reply to Re: AI Animals
by Limbic~Region
|
|