home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
genie-commodore-file-library
/
C128Educational
/
S-P-C
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
6KB
|
181 lines
10 REM STATES, PROVIDENCES & CAPITALS 1984
20 REM
30 REM PRACTICE IN MATCHING IN STATES AND CAPITALS (AND CANANADIAN PROVIDENCES)
40 REM
50 REM
60 REM COMMMODORE 128, BASIC 7.0 80-COLUMN MONITOR 5 1/2 K
70 REM
80 PRINT "[147]" :W=3:Q=5:GOSUB 1760
90 PRINT"************* STATES, PROVINCES AND CAPITALS ************"
100 DIM A(62),B(4),C$(62),S$(62)
110 REM READ IN STATES AND CAPITAL ARRAYS
120 FOR I=1 TO 62
130 READ S$(I),C$(I):NEXT I
140 FOR I=1 TO 62:A(I)=0:NEXT I:G=0:N=0
150 FOR I=1 TO 1000:NEXT I
160 PRINT"[147]":W=1:Q=1:GOSUB 1760
170 PRINT:PRINT"YOU HAVE YOUR CHOICE OF TAKING A FILL IN OR A ":PRINT "MULTIPLE CHOICE TEST"
180 PRINT
190 PRINT"WOULD YOU LIKE TO FILL IN THE ANSWERS?"
200 PRINT"(Y FOR 'YES', N FOR 'NO') "
210 GET Z$:IF Z$="" THEN 210
220 IF Z$="Y" THEN PRINT:GOTO 300
230 IF Z$<>"N" THEN PRINT:GOTO 160
240 PRINT:PRINT
250 PRINT"MULTIPLE CHOICE -- ANSWER EACH QUESTION WITH 1,2,3 OR 4"
260 PRINT
270 X=1:PRINT"TO STOP, TYPE 0 (ZERO) FOR YUR ANSWER"
280 GOTO 330
290 PRINT
300 PRINT:PRINT"FOR FILL-INS, YOU MUST SPELL EXACTLY! (SAINT IS ":PRINT"ABBREVIATED ST.)"
310 PRINT
320 X=2:PRINT"TO STOP, TYPE 'S' FOR YOUR ANSWER"
330 PRINT
340 PRINT"YOU HAVE YOUR CHOICE OF WHETHER THE STATE/PROVINCE OR CAPITAL IS ASKED"
350 PRINT
360 PRINT"WOULD YOU LIKE TO ANSWER WITH THE CAPITAL?[160](Y OR N)"
370 GET Z$:IF Z$="" THEN 370
380 IF Z$="Y" THEN Y=1:GOTO 410
390 IF Z$<>"N" THEN 370
400 Y=2
410 PRINT
420 REM PICK A STATE
430 PRINT"[147]":Q=1:W=1:GOSUB 1760
440 FOR I=1 TO 10
450 R=INT(RND(1)*62 +1)
460 IF A(R)<>2 THEN 520
470 NEXT I
480 REM DON'T WASTE TIME PICKING ONE
490 FOR R=1 TO 62
500 IF A(R)<>2 THEN 520
510 NEXT R:GOTO 1220
520 IF A(R)=1 THEN PRINT"TRY THIS ONE AGAIN."
530 PRINT
540 FOR MM=1 TO 700:NEXT MM
550 IF X=1 THEN 700
560 REM THIS SECTION ASKS FOR FILL-IN ANSWERS
570 IF Y=2 THEN 630
580 A$=C$(R)
590 PRINT"[147]":Q=1:W=1:GOSUB 1760
600 PRINT"WHAT IS THE CAPITAL OF ";S$(R);
610 PRINT
620 GOTO 650
630 A$=S$(R)
640 PRINTC$(R);" IS THE CAPITAL OF ";
650 INPUT Z$
660 PRINT
670 IF LEN (Z$)=1 THEN 1160
680 IF Z$=A$ THEN GOTO 1050
690 GOTO 1040
700 REM THIS SECTION ASKS MULTIPLE CHOICE QUESTIONS
710 REM THE VALUE 4 OF C IS THE CORRECT ONE
720 PRINT"[147]":Q=1:W=1:GOSUB 1760
730 C=INT(RND(1)*4+1)
740 REM PICK FOUR STATES OR PROVINCES FOR THE CHOICES
750 FOR I=1 TO 4
760 B(I) = INT(RND(1)*50+1)
770 NEXT I
780 B(C)=R
790 REM MAKE SURE NONE ARE THE SAME
800 IF B(1)=B(2) OR B(1)=B(3) OR B(1)=B(4) THEN 750
810 IF B(2)=B(3) OR B(3)=B(4) OR B(2)=B(4) THEN 750
820 IF Y=2 THEN 920
830 REM PRINT CAPITAL CHOICES
840 PRINT"1, ";C$(B(1))
850 PRINT"2, ";C$(B(2))
860 PRINT"3, ";C$(B(3))
870 PRINT"4, ";C$(B(4))
880 PRINT
890 PRINT"THE CAPITAL OF ";S$(R); " IS ";
900 A$=C$(B(C))
910 GOTO 1000
920 REM PRINT STATE OR PROVIDENCE CHOICES
930 PRINT"1, ";S$(B(1))
940 PRINT"2, ";S$(B(2))
950 PRINT"3, ";S$(B(3))
960 PRINT"4, ";S$(B(4))
970 PRINT
980 A$=S$(B(C))
990 PRINT C$(R); " IS THE CAPITAL OF ";
1000 INPUT Z:Z=INT(ABS(Z))
1010 IF Z<1 OR Z>4 THEN 1160
1020 IF Z=C THEN 1050
1030 PRINT
1040 A(R)=1:PRINT"WRONG...THE ANSWER IS ";A$:GOTO 1080
1050 A(R)=2:N=N+1
1060 PRINT
1070 PRINT"RIGHT! YOU HAVE ";N;" CORRECT."
1080 PRINT:G=G+1
1090 W=15:Q=1:GOSUB 1760:PRINT"PRESS <RETURN> TO CONTINUE......OR '0' TO END PROGRAM=>"
1100 GET Z2$:IF Z2$="" THEN 1100
1110 IF ASC(Z2$)= 48 THEN 1150
1120 IF ASC(Z2$)<>13 THEN GOTO 420
1130 IF N<62 THEN GOTO 420
1140 IF N=62 THEN 1220
1150 PRINT"[147]":Q=1:W=1:GOSUB 1760
1160 PRINT"DO YOU WANT TO STOP?[160](Y OR N)"
1170 GET Z$:IF Z$="" THEN 1170
1180 IF Z$="Y" THEN 1220
1190 IF Z$<>"N" THEN 1150
1200 PRINT
1210 GOTO 1130
1220 PRINT"[147]":Q=1:W=1:GOSUB 1760
1230 PRINT"YOU GOT ";N;" RIGHT IN ";G;" GUESSES"
1240 PRINT
1250 ANS=INT (N/G*100+.5)
1260 PRINT"THAT IS ";ANS;"%--";:IF ANS>95 THEN PRINT"EXCELLENT"
1270 IF ANS>80 AND ANS<96 THEN PRINT"GOOD"
1280 IF ANS>75 AND ANS<81 THEN PRINT"YOU DID ALL RIGHT"
1290 IF ANS<76 AND ANS>64 THEN PRINT"THERE'S A LOT OF ROOM FOR IMPROVEMENT."
1300 IF ANS<65 THEN PRINT"THAT ISN'T GOOD AT ALL. YOU OUGHT TO TRY AGAIN."
1310 PRINT
1320 PRINT"WOULD YOU LIKE TO TRY THE OTHER SECTION?"
1330 PRINT
1340 PRINT"(Y FOR YES OR N FOR NO)=>";
1350 GET Z$:IF Z$="" THEN 1350
1360 IF Z$="Y" THEN RUN
1370 IF Z$<>"N" THEN 1350
1380 PRINT
1390 PRINT:PRINT"IS ANYONE ELSE WAITING (Y OR N) ==>";
1400 GET Z$:IF Z$="" THEN 1400
1410 IF Z$="Y" THEN RUN
1420 IF Z$<>"N" THEN 1400
1430 PRINT"[147]":W=13:Q=16:GOSUB 1760:PRINT"* * * G O O D B Y E * * *"
1440 PRINT
1450 DATA "ALABAMA","MONTGOMERY","ALASKA","JUNEAU","ARIZONA"
1460 DATA "PHOENIX","ARKANSAS","LITTLE ROCK","CALIFORNIA"
1470 DATA "SACRAMENTO","COLORADO","DENVER","CONNECTICUT","HARTFORD"
1480 DATA "DELAWARE","DOVER","FLORIDA","TALLAHASSEE","GEORGIA"
1490 DATA "ATLANTA","HAWAII","HONOLULU","IDAHO","BOISE","ILLINOIS"
1500 DATA "SPRINGFIELD","INDIANA","INDIANAPOLIS","IOWA"
1510 DATA"DES MOINES","KANSAS","TOPEKA","KENTUCKY","FRANKFORT"
1520 DATA "LOUISIANA","BATON ROUGE","MAINE","AUGUSTA","MARYLAND"
1530 DATA"ANNAPOLIS","MASSACHUSETTS","BOSTON","MICHIGAN"
1540 DATA "LANSING","MINNESOTA","ST. PAUL","MISSISSIPPI","JACKSON"
1550 DATA "MISSOURI","JEFFERSON CITY","MONTANA","HELENA","NEBRASKA"
1560 DATA "LINCOLN","NEVADA","CARSON CITY","NEW HAMPSHIRE"
1570 DATA "CONCORD","NEW JERSEY","TRENTON","NEW MEXICO","SANTA FE"
1580 DATA "NEW YORK","ALBANY","NORTH CAROLINA","RALEIGH"
1590 DATA "NORTH DAKOTA","BISMARK","OHIO","COLUMBUS","OKLAHOMA"
1600 DATA "OKLAHOMA CITY","OREGON","SALEM","PENNSYLVANIA"
1610 DATA "HARRISBURG","RHODE ISLAND","PROVIDENCE","SOUTH CAROLINA"
1620 DATA "COLUMBIA","SOUTH DAKOTA","PIERRE","TENNESSEE"
1630 DATA "NASHVILLE","TEXAS","AUSTIN","UTAH","SALT LAKE CITY"
1640 DATA "VERMONT","MONTPELIER","VIRGINIA","RICHMOND","WASHINGTON"
1650 DATA "OLYMPIA","WEST VIRGINIA","CHARLESTON","WISCONSIN","MADISON"
1660 DATA "WYOMING","CHEYENNE"
1670 DATA "ALBERTA","EDMONTON","BRITISH COLUMBIA","VICTORIA","MANITOBA"
1680 DATA "WINNIPEG","NEW BRUNSWICK","FREDERICTON","NEWFOUNDLAND","ST. JOHN'S"
1690 DATA "NOVA SCOTIA","HALIFAX","ONTARIO","TORONTO","PRINCE EDWARD ISLAND"
1700 DATA "CHARLOTTETOWN","QUEBEC","QUEBEC","SASKATCHEWAN","REGINA"
1710 DATA "NORTHWEST TERRITORIES","YELLOWKNIFE"
1720 DATA "YUKON TERRITORIES","YELLOWKNIFE"
1730 PRINT:PRINT" PRESS <RUN/STOP> TO RETURN TO BASIC"
1740 GOTO 1740
1750 END
1760 REM W=DOWN AND Q=ACROSS
1770 REM SUBROUTINE FOR TEXT LOCATION.................
1780 PRINT"":FOR L1=1 TO W-2:PRINT:NEXT:PRINT;
1790 IF Q>2 THEN PRINT "" TAB(Q-1)"";
1800 RETURN