--- title: "Animals" id: 72326 type: "computer_media" slug: "animals" url: "http://localhost/computer_media/animals/" markdown_url: "http://localhost/computer_media/animals.md" published_at: "2026-10-23T07:47:17+00:00" modified_at: "2026-10-23T07:47:17+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/10/animals-5.png" excerpt: "A guessing game that learns: think of an animal, answer its yes/no questions, and when it fails it asks what your animal is and how to tell them apart." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Alvin Albrecht" slug: "albrecht-alvin" taxonomy: "indiv" url: "http://localhost/indiv/albrecht-alvin/" genre: - name: "Artificial Intelligence" slug: "artificial-intelligence" taxonomy: "genre" url: "http://localhost/type/artificial-intelligence/" media_type: "Program" programmers: - name: "Alvin Albrecht" slug: "albrecht-alvin" taxonomy: "indiv" url: "http://localhost/indiv/albrecht-alvin/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Animals%20%281989%29%28Albrecht%2C%20Alvin%29%28TS2068%29%28US%29%28Program%29.zip" tsrun_member: "Animals (1989)(Albrecht, Alvin)(TS2068)(US)(Program)/Animals (1989)(Albrecht, Alvin)(TS2068)(US)(Program).tap" mediadate: "1989" images: - url: "http://localhost/wp-content/uploads/2026/10/animals-5.png" - url: "http://localhost/wp-content/uploads/2026/10/animals-1.png" media_type_tags: "Artificial Intelligence" license: false --- # Animals Animals is the guessing game in which you think of an animal and the computer works through yes/no questions such as “DOES IT HAVE A …” and “IS IT A …”. When it runs out of ideas it says “I give up. What’s your animal?”, then asks what your animal has that its own guess doesn’t, and stores the new animal and question so it can find it next time. Words in a feature are joined with dots, as in LONG.TAIL. The database supplied already knows about 70 animals, and Santa Claus. When you answer N to “TRY AGAIN?”, the program offers to save what it has learned to tape. The title screen reads “A N I M A L S (c) 1989 Alvin Albrecht, Calgary, AB, Canada”, and the REM banner in line 1 is dated February 1989. It was on the disk SNUG_9_10 as a BASIC loader, `Animal`, with the machine code `Animal C` (1401 bytes at 28000) and the database `animals.1` (35610 bytes at 29390). ## Program Analysis The BASIC is only a loader. Line 5 sets the colours, line 10 loads `Animal C` and `animals.1`, and line 15 starts the game with `RANDOMIZE USR 28671`. When the game returns to BASIC, the same line asks whether to save the animals it learned and, on y, saves `animals.1` as `CODE 29390,35610`. Everything else is in the 1401 bytes of machine code. The animals and questions form a binary tree stored in a fixed 35610-byte block, of which the supplied database uses about 3155 bytes. The code has not been decoded beyond the disk calls described below. ## Notable Techniques - The whole game, including its learning, runs in machine code. BASIC only loads it and saves the database. - New knowledge is added by inserting a question that tells the new animal from the old guess, so the tree grows with each game. ## Potential Issues - The save writes the whole 35610-byte block whatever the size of the tree, so it takes about three and a half minutes of tape. - The disk version could spill into further files (`animals.2`, `animals.3` and so on) when its block was full. The tape version has no equivalent, but with about 3155 of the 35610 bytes in use this is unlikely to matter. - The unused bytes past the end of the database hold leftover fragments of the author’s assembler source. They are harmless. This program came from an Oliger (JLO SAFE) disk, where the machine code read and wrote its database directly through the JLO disk system and saved it after every new animal. For tape, the code’s three disk calls (load, save and directory search) were patched to return, with the search reporting the file as found. Line 10 now loads the code and database from tape, and line 15 offers to save the database at the end of a session. It was tested in ZEsarUX: the program asked its questions, gave up, learned a mouse with the feature LONG.TAIL, guessed it on the next round and offered to save on exit. ## Source Code ``` 1 REM *********************** * * * A N I M A L S * * * * * FEB 1989 * * Albrecht, Calgary * * * *********************** 5 PAPER 0: INK 7: BORDER 0: CLS 10 LOAD "Animal C"CODE 28000: LOAD "animals.1"CODE 29390 15 RANDOMIZE USR 28671: INPUT "Save the animals it learned? (y/n) "; LINE s$: IF s$="y" OR s$="Y" THEN SAVE "animals.1"CODE 29390,35610 ```