in reply to AI Animals

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.

1,1 /\ / \ Y / \ N / \ 2,1 2,2 /\ / \ Y / \ N Y / \ N / \ / \ 3,1 3,2 3,3 3,4

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:

  • Improve the I/O interface
  • Improve the regex's to ensure proper capitalization
  • Check dict if possible for typos on animals Anyone wanting to play around with these or your own ideas are more than welcome. Improvement on the logic tree would greatly be appreciated.

    Thanks,

    Limbic~Region