Name the Presidents!

Type
Education
Category
History quiz
Author
Peter Loeser
Published in
Antic, October 1987 (Vol. 6, No. 6)
Year
1987
Language
Atari BASIC
Requirements
Any Atari 8-bit, Atari BASIC; disk or cassette
Maroon text screen: instructions, PRESIDENT NUMBER 1 WAS... GEORGE ?WASHINGTON being typed, and a boxed reminder that answers must be spelled correctly in uppercase

About the program

Peter Loeser taught high-school social science and was president of The Educator's Atari Club (TEAC) of Laytonville, California, a group that had built up a library of more than 25 classroom-tested educational disks. Name the Presidents! ("Woodrow who…?") was his short drill program in the October 1987 Antic. It asks for all 40 presidents up to that date, in order. It gives you each one's number and first name (with middle initial where there is one), and you type the last name.

Get it right and you move on. Get it wrong and you can try again or type HELP to be told. At the end the program reports how many tries you needed for the 40.

Typing it in

The title screen uses inverse text ({inv}…{/inv}, the Atari key) and the boxes use CTRL-key line graphics: {CTRL-Q}, {CTRL-E}, {CTRL-Z} and {CTRL-C} are the four corners and {CTRL-R} the horizontal bar (hold CTRL and press the letter). {CLEAR} is ESC then SHIFT-CLEAR.

The surnames in DATA lines 530–920 look like gibberish on purpose. As the article put it, they're "encoded, to discourage students from peeking". Each letter is replaced by the next one in the alphabet, so FORD becomes GPSE and the space in VAN BUREN becomes !. Copy them exactly. Line 4 really does read REM REM.

How to use it

RUN it. After the title screen, each question reads "PRESIDENT NUMBER n WAS…" followed by the first name. Type the surname in capitals and press RETURN. The program turns caps lock on for you, and a box reminds you that spelling must be exact. The BREAK key is disabled while the quiz runs. Finally, press START to run it again or OPTION to quit.

How it works

  • Decoding on the fly. READ NUMBER,F$,P$ (line 120) loads one president. The first time the reminder box is drawn for that president (line 1140), each character of P$ is shifted down by one with CHR$(ASC(...)-1), and the FLAG variable makes sure it's decoded only once.
  • End marker. The DATA ends with 0,END,END. The decoding step turns that END into DMC, which is what line 160 checks for.
  • Settings. POKE 702,64 turns caps lock on, and POKE 16,112 with POKE 53774,112 turns off the BREAK-key interrupt. G counts every attempt, right or wrong, including HELP.

Updating it

The quiz stops at Ronald Reagan, number 40. Loeser explained how to extend it: change TL in line 115, encode the new surname by moving each letter one place on, and add a DATA line after 920, keeping DATA 0,END,END last. For example:

115 DIM A$(20):TL=41:G=0
925 DATA 41,GEORGE H.,CVTI

Carry on in the same way for later presidents. P$ holds up to 20 characters.

Listing

2 REM NAME THE PRESIDENTS!
4 REM REM BY PETER LOESER
6 REM (c)1987, ANTIC PUBLISHING
15 GRAPHICS 2+16:POKE 712,34:POSITION 0,1
20 ? #6;"NAME THE PRESIDENTS!"
30 SOUND 0,50,10,2:GOSUB 1150
35 POSITION 0,3:? #6;"{inv}name{/inv} {inv}the presidents!{/inv}"
40 SOUND 0,100,10,5:GOSUB 1150
50 POSITION 0,5:? #6;"name the presidents!"
55 SOUND 1,150,10,8:SOUND 0,0,0,0:GOSUB 1150
65 POSITION 0,7:? #6;"{inv}NAME{/inv} {inv}THE PRESIDENTS!{/inv}"
67 SOUND 2,200,10,11:SOUND 1,0,0,0:GOSUB 1150
80 POSITION 0,9:? #6;"NAME THE PRESIDENTS!"
82 SOUND 3,250,10,14:SOUND 2,0,0,0:GOSUB 1150
85 SOUND 3,0,0,0
90 ? "{CLEAR}":POKE 752,1:POKE 710,34:POKE 712,34:POSITION 5,2:? "Let's see if you know the names"
95 ? "of our Presidents in their correct"
100 ? "order.   I'll give you their first    names, you give their last..."
110 DIM P$(20):DIM F$(20)
115 DIM A$(20):TL=40:G=0
120 READ NUMBER,F$,P$:FLAG=1
130 POSITION 7,9:? "PRESIDENT NUMBER ";NUMBER;" WAS..."
140 GOSUB 1100:POKE 16,112:POKE 53774,112:POKE 702,64
160 IF P$="DMC" THEN 1000
170 POSITION 8,11:POKE 752,1:? F$;" ";:INPUT A$
180 IF A$="HELP" THEN 390
190 IF A$<>P$ THEN 320
200 GRAPHICS 2+16:POKE 712,34:G=G+1
210 POSITION 3,2:? #6;"* * * * * * *"
230 POSITION 3,4:? #6;"*  YOU ARE  *"
250 POSITION 3,6:? #6;"*  CORRECT  *"
270 POSITION 3,8:? #6;"* * * * * * *"
280 GOSUB 440
290 POKE 752,1
310 GOTO 120
320 ? "{CLEAR}":POSITION 8,8:? "SORRY, THAT'S WRONG ...":G=G+1
330 ? :? :? " If you can't get it you may type"
335 ? :? "        HELP, but first..."
340 FOR X=1 TO 750:NEXT X
350 ? "{CLEAR}"
360 POSITION 8,9:? "TRY PRESIDENT ";NUMBER;" AGAIN"
370 GOSUB 1100
380 GOTO 170
390 ? "{CLEAR}":POSITION 4,10:? "THE ANSWER WAS ";F$;" ";P$:G=G+1
400 GOSUB 1150
410 ? "{CLEAR}":GOTO 290
430 GOTO 150
440 FOR I=1 TO 3
450 FOR X=1 TO 75
460 SOUND 0,X,10,8
470 NEXT X
480 SOUND 0,0,0,0
490 FOR DELAY=1 TO 50:NEXT DELAY
500 NEXT I
510 PRINT "{CLEAR}":POKE 710,34:POKE 712,34
520 RETURN
530 DATA 1,GEORGE,XBTIJOHUPO
540 DATA 2,JOHN,BEBNT
550 DATA 3,THOMAS,KFGGFSTPO
560 DATA 4,JAMES,NBEJTPO
570 DATA 5,JAMES,NPOSPF
580 DATA 6,JOHN QUINCY,BEBNT
590 DATA 7,ANDREW,KBDLTPO
600 DATA 8,MARTIN,WBO!CVSFO
610 DATA 9,WILLIAM H.,IBSSJTPO
620 DATA 10,JOHN,UZMFS
630 DATA 11,JAMES K.,QPML
640 DATA 12,ZACHARY,UBZMPS
650 DATA 13,MILLARD,GJMMNPSF
660 DATA 14,FRANKLIN,QJFSDF
670 DATA 15,JAMES,CVDIBOBO
680 DATA 16,ABRAHAM,MJODPMO
690 DATA 17,ANDREW,KPIOTPO
700 DATA 18,ULYSSES S.,HSBOU
710 DATA 19,RUTHERFORD B.,IBZFT
720 DATA 20,JAMES A.,HBSGJFME
730 DATA 21,CHESTER A.,BSUIVS
740 DATA 22,GROVER,DMFWFMBOE
750 DATA 23,BENJAMIN,IBSSJTPO
760 DATA 24,GROVER,DMFWFMBOE
770 DATA 25,WILLIAM,NDLJOMFZ
780 DATA 26,THEODORE,SPPTFWFMU
790 DATA 27,WILLIAM H.,UBGU
800 DATA 28,WOODROW,XJMTPO
810 DATA 29,WARREN G.,IBSEJOH
820 DATA 30,CALVIN,DPPMJEHF
830 DATA 31,HERBERT C.,IPPWFS
840 DATA 32,FRANKLIN D.,SPPTFWFMU
850 DATA 33,HARRY S.,USVNBO
860 DATA 34,DWIGHT D.,FJTFOIPXFS
870 DATA 35,JOHN F.,LFOOFEZ
880 DATA 36,LYNDON B.,KPIOTPO
890 DATA 37,RICHARD M.,OJYPO
900 DATA 38,GERALD R.,GPSE
910 DATA 39,JAMES E.,DBSUFS
920 DATA 40,RONALD,SFBHBO
930 DATA 0,END,END
1000 ? "{CLEAR}":POKE 710,34:POKE 712,34:POKE 752,1
1005 POSITION 2,7:? "{inv}{CTRL-Q}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-E}{/inv}"
1010 ? "{inv}|         {CTRL-Q}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-E}                  |{/inv}"
1015 POSITION 2,9:? "{inv}| YOU TOOK|{/inv} ";G
1020 POSITION 18,9:? "{inv}|TRIES TO IDENTIFY |{/inv}"
1025 POSITION 2,10:? "{inv}|         |{/inv} ";TL
1030 POSITION 18,10:? "{inv}|PRESIDENTS!       |{/inv}"
1035 ? "{inv}|         {CTRL-Z}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-C}                  |{/inv}"
1040 ? "{inv}{CTRL-Z}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-C}{/inv}"
1050 POSITION 0,16:? "PUSH {inv}OPTION{/inv} TO QUIT {inv}NAME THE PRESIDENTS{/inv}"
1055 POSITION 0,18:? "PUSH {inv}START{/inv} TO RERUN {inv}NAME THE PRESIDENTS{/inv}":? :?
1060 IF PEEK(53279)=3 THEN GRAPHICS 0:END
1065 IF PEEK(53279)=6 THEN RUN
1070 GOTO 1060
1100 POSITION 3,16:? "{CTRL-Q}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-E}     |    ANSWERS MUST BE SPELLED    |"
1110 ? " |   CORRECTLY TO BE ACCEPTED!   |     |                               |"
1120 ? " |  USE ONLY UPPERCASE LETTERS.  | "
1130 ? " {CTRL-Z}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-C}"
1140 IF FLAG=1 THEN FOR X=1 TO LEN(P$):P$(X,X)=CHR$(ASC(P$(X,X))-1):NEXT X:FLAG=0
1145 RETURN
1150 FOR X=1 TO 200:NEXT X:RETURN

Download

The original program from the Antic disk, to LOAD or ENTER instead of typing it: PRESQUIZ.BAS.

Credits