Back in the early 80’s, children around the world spent endless hours solving multiple-choice quizzes on an electronic toy called “TOMY Teacher” (AKA “Sears Quiz-A-Tron”). In those days, bytes weren’t cheap; so how did this device remember all the solutions to all of its quizzes?
This ancient game is made up of two parts: the electronic device (with buttons, LEDs and a speaker), and printed notebooks with quiz cards. The user puts a notebook in the device, selects a quiz, and presses the color buttons to input the quiz color code that’s printed on the card. This tells the device which quiz was selected and, therefore, what the correct answers are. The user then selected answers to the ten questions, using the 1-4 buttons, and if there were no mistakes, the LEDs flashed and a primitive happy music played. It was glorious.
Let’s do some math. The quiz code is always three parts long, and there are three colors to choose from, so there are only 3^3 = 27 possible codes. Each quiz has ten answers, and each of those occupies – if handled economically – two bits. Overall, that’s 68 bytes. Not too much even in 1980; A well-randomized answer key could be saved on some ROM chip.
Since my kids are still playing with this old unit, I didn’t want to open it up and risk damage; who knows what thin threads of rust are holding its components together now! But I suspected that the answers were not actually stored anywhere, because it was probably cheaper, thirty-five years ago, to generate them on the fly.
The Quest Begins
So I fired up Excel, assigned digits to the code colors (Red=1, Yellow=2, Blue=3), and painstakingly wrote down the codes and the correct answers to a sample of 16 different quizzes. Then, Zen-like, I gazed at the numbers and waited for an enlightenment to come.
Almost immediately, I noticed a few repeating sequences. For instance, the first six answers for quiz 312 and quiz 222 are identical. For me, this was proof enough that the sequences were indeed generated; no one would have put such blatant repetitions in a truly randomized data table.
Zen only took me this far, though, so I turned to more “western” ways of thinking: what would a 1980 electronic circuit designer do to create sequences of pseudo-random numbers? I calculated the sum of each codes’ digits (e.g. 312 is 3+1+2 = 6), and took the remainder from dividing by 4 (because there are only 4 possible answers). Bingo! When replacing the 0’s with 4’s, the results of this calculation matched the correct answers to question #1 in all quizzes!
Keep Adding Up
Okay, but what about the other nine answers? After pursuing a few small red herrings, I decided to look not at the raw numbers, but at the differences between consecutive answers. Why? Because if the first answer is a result of some accumulation process, the following answers probably result from the same kind of process, and the differences will help me see what’s being added on each step.
BAM! The moment I created the “difference” columns, I could clearly see that answer #5 was always answer #4 plus one (again, taking the remainder), answer #6 was always #5 plus two, and #10 was always #9 plus one. Awesome. Now, what about the remaining six columns, where the difference was not uniform?
A careful examination revealed that on three of these columns, the numbers ranged only from 1 to 3, and did not include the perfectly legitimate zero difference. Gee, I wonder where we can possibly find three different pseudo-random numbers ranging from 1 to 3! And indeed, the difference between answer #2 and #1 is the last digit of the quiz code, answer #7 is #6 plus the middle digit of the code, and #9 is #8 plus the first digit.
Three down, three to go. These I solved fast, because I’ve already got the hang of this game: they were exact duplication of previous answers. Answer #3 was #2 plus #1 (which also happens to be the code digit sum), Answer #4 was #3 plus #2, and Answer #8 was #7 plus #5.
So, to summarize, the running sum that provides the answer sequence for each quiz is:
Answer[1 to 10] = Sum + Last Digit + Answer + Answer + 1 + 2 + Middle Digit + Answer + First Digit + 1
I ran this model on two new quizzes, which were not included in the original sample, and the answers came out perfect.
I broke the code, but I still don’t understand it. Given that the toy plays “music”, I assumed there’s some sort of processor in there, not just simple logic ICs; but from a low-level programming perspective, it’s not obvious why anyone would choose this exact sequence of additions. Was it obfuscated intentionally, to prevent casual curious cats from figuring out the sequence (remember there was no Excel in 1980)? Is there something in the architecture of the specific processor that makes calculating this sequence really economical, in terms of assembly instructions and memory?
[Addendum] Well, I couldn’t resist the urge and opened the toy up. There was indeed only a single IC there, made by TI but marked with some TOMY code that I couldn’t find on the internet. I didn’t even find TI MCUs from that era that could be it.
I turned to TOMY’s customer service, asking whether they have some information or contact I can consult regarding this mystery. Unfortunately, they said they didn’t.
So, what do you think? Is there anyone still out there with more information?