(8 K ROM)
Many people think computers are a black boxes with answers in them, and that programming is a way of extracting answers from the computer. On the TV series, Hitchhiker’s Guide to the Galaxy (a BBC production broadcast on PBS), the second greatest computer of all time answers “the” question. It took 7 1/2 million years to run the program to completion.
Fortunately, we had a monkey typing at random on our computer, and it came up with a program which answers “the” question in only a few minutes. I was frankly disappointed with the result. But, anyway, here is the program:
1 LET A$="I-SQR I>EXP(-PI*I)/PI**2"
10 PRINT "ENTER YOUR AGE"
20 INPUT I
30 CLS
40 PRINT ,,,,"THE ANSWER TO LIFE, THE UNIVERSE, AND EVERYTHING IS ";
42 LET I=VAL A$ (3 TO 4)
50 IF VAL A$ THEN GOTO 42
60 PRINT (STR$ (VAL A$ (6 TO 12)))(3 TO 4)
70 PRINT "ENTER A FRIENDS AGE"
80 GOTO 20
The answer is, of course, a number. In case you do not believe that there is a number which answers the mysteries of the Universe, I refer you to Martin Gardner’s column in the November 1979 issue of Scientific American.
Transcription note: the listing is corrected so it can be entered. As printed, line 60 has one closing bracket too few: PRINT (STR$ (VAL A$ (6 TO 12))(3 TO 4).
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.