This program was developed from a question presented in the Sunday Oregonian (Portland newspaper) of October 25 by Marilyn in her weekly column of many odities and head scratchers.
The first display of text is the whole definition and question. This was all there was to work with except the answer was given. My program provides for input from the player. If it is not the correct answer additional answers may be given. If the answer is correct the player is so notified plus the books are displayed on the shelf with the bookworm making its way through the books according to the details given at the beginning.
If the reader desires this to be a self starting program then the SAVE command should end with LINE 50. Put in your own SAVE command based on your storage medium. I named the program “BOOKWORM” because Oliger DOS with accept ten characters in the name.
The DATA defines graphic characters (CAPSHIFT + 9 key) for keys “A”, “B”, and “C”. When RUN is pressed, these keys will change to the graphic characters.
40 REM BOOKWORM PROGRAM
45 REM DICK WAGNER
50 PRINT AT 0,0;"There is a set of 5 books on a shelf. Each book has 100 pages. A bookworm starts eating on the first page of the first book."
60 PRINT "From there the bookworm eats in a straight line through to the last page of the last book."
70 PRINT "Through how many pages did the bookworm eat?": INPUT p: PRINT : PRINT p: PAUSE 50: PRINT AT 10,0;" "
80 IF P<>302 THEN GO TO 50: IF P=302 THEN GO TO 90
90 CLS : PRINT AT 12,0;"CORRECT, 302 PAGES. HERE IS THE BOOKWORM AT WORK"
120 FOR n=65368 TO 65368+23
130 READ d: POKE n,d: NEXT n
140 DATA 130,254,254,254,254,254,254,254
150 DATA 254,254,254,254,254,254,254,254
160 DATA 254,254,254,254,254,254,254,124
200 PRINT AT 5,5;"A";"A";"A";"A";"A"
210 PRINT AT 6,5;"B";"B";"B";"B";"B"
220 PRINT AT 7,5;"C";"C";"C";"C";"C"
230 PLOT 0,108: DRAW 100,0
240 PLOT 0,140: DRAW 100,0
250 PLOT 0,139: DRAW 100,0
260 PLOT 0,138: DRAW 100,0
270 PRINT AT 0,0;"Top view of 5 books"
280 PRINT " on book shelf."
310 FOR X=45 TO (45+27)
320 PLOT 45,124: DRAW INVERSE 1;(X-45),0
325 PAUSE 50
330 NEXT X
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.