About Animal, Vegetable, Mineral
Think of something, tell it whether it's an animal, a vegetable or a mineral, and answer its questions YES or NO. Then it guesses. When it's wrong, you tell it what you were thinking of and give it a question that tells your thing apart from its guess. It remembers, so next time it knows one more thing. Its brain shows everything it knows, as a tree of questions, with this game's path lit up.
THE STORY
"Is it animal, vegetable or mineral?" goes back to Carl Linnaeus, who in 1735 sorted the whole of nature into three kingdoms: animals, plants and stones. It became the classic first question of the parlour game Twenty Questions, and in Dickens's A Christmas Carol (1843) Scrooge's nephew plays a game of "Yes and No" at his Christmas party in which the animal everyone has to guess turns out to be Scrooge. From 1952 to 1959 the BBC ran a television quiz called Animal, Vegetable, Mineral?, in which a panel of experts, Sir Mortimer Wheeler among them, tried to identify curious objects from museums.
A computer that plays the guessing game and learns new things as it goes is one of the oldest computer games. A program called ANIMAL was a favourite on the shared computers of the early 1970s and was printed in David Ahl's book BASIC Computer Games (1978), and in 1975 John Walker made his version for UNIVAC computers quietly copy itself to other users, an early forerunner of computer viruses. This page is a port of a Python version of the game, and starts from the questions and things that version was taught.
HOW IT WORKS
Each category is a tree. Every question has a YES branch and a NO branch, and every branch ends in a guess. Your answers walk it from the top question down to one guess. When the guess is wrong, that guess is swapped for your new question, with your thing on one side and its old guess on the other. So every lesson adds exactly one question and one thing, and it always knows one more thing than it has questions.
It never learns what a question means, only where it goes, so it's only as good as its teachers: a wrong answer sends it down the wrong branch. That's why the same thing can end up in two places. If every question split the things exactly in half, twenty questions could tell apart over a million things (2 to the power 20 is 1,048,576); the Average to a guess figure shows how close its tree is to that, against the best a tree that size could do.
What you teach it is saved in this browser only. Export saves its brain as a file you can keep or send to a friend, and Import loads one (the file is in the same layout as the original Python game uses). Forget takes it back to the starting trees. Keys: Y and N answer, U undoes your last answer, A, V and M pick a category, Enter plays again.
FURTHER WATCHING AND READING