-
Notifications
You must be signed in to change notification settings - Fork 1
/
KEYWORDSABBR.BAS
58 lines (58 loc) · 2.3 KB
/
KEYWORDSABBR.BAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
1 REM KEYWORDS&ABBR. (C) 2022 MIKAEL O. BONNIER, LUND, SWEDEN. FOSS LIC.:GPLV3.
10 CLR:GOTO 1010:REM COMMANDER X16 R38-R42
64 CLR:C64=1:GOTO 1010
931 IF A$(J)="PRINT" THEN A$(J)="?"
932 RETURN
941 K$(I)=W$:PRINT W$" ";:W$="":IF I=1 AND K$(I)<>"END" THEN RETURN
942 IF LEFT$(K$(I),4)="TOO " GOTO 1080:REM POP WOULD BE USEFUL
943 I=I+1:RETURN
951 FOR I=M TO 2 STEP -1:J=INT(I*RND(1))+1:T=K%(I):K%(I)=K%(J):K%(J)=T
952 NEXT:RETURN
1010 COLOR 14,0:SCREEN $FF:I=1:Z=256:A=780:X=A+I:Y=X+I:SU=Y+I:W=$7E:W1=W+I
1014 FETCH=$FF74:B=4:REM MAY CHANGE FOR NEW ROM
1020 BASE=$C0DE-18:REM -"-
1024 DIM K$(107+27),A$(107+27):REM -"-
1030 FOR P=BASE TO BASE+633:REM -"-
1033 H=INT(P/Z):L=P-Z*H
1040 POKE W,L:POKE W1,H:POKE A,W:POKE X,B:POKE Y,.:SYS FETCH:G=PEEK(A)
1044 IF (G AND 127)<32 GOTO 1070
1050 W$=W$+CHR$(G AND 127)
1060 IF G>127 THEN GOSUB 941
1070 NEXT
1080 M=I-1
1090 PRINT:COLOR 7:PRINT CHR$($0E);
1100 FOR J=1 TO M
1110 N=2:IF LEN(K$(J))<=N THEN A$(J)=K$(J):GOTO 1166
1130 A$(J)=LEFT$(K$(J),N)
1134 IF J=1 GOTO 1166
1140 FOR I=1 TO J-1
1150 IF LEFT$(K$(I),N)=A$(J) THEN N=N+1:A$(J)=LEFT$(K$(J),N):GOTO 1140
1160 NEXT
1166 IF LEN(K$(J))=LEN(A$(J)) THEN GOSUB 931:GOTO 1180
1170 H$=LEFT$(A$(J),LEN(A$(J))-1):TL=ASC(RIGHT$(A$(J),1))
1174 IF TL=ASC("2") THEN TL=ASC("C"):H$="I2"
1176 A$(J)=H$+CHR$(TL+128)
1180 PRINT MID$(STR$(10*J),2)" ";
1182 IF ASC(RIGHT$(A$(J),1))<=127 THEN PRINT A$(J);:GOTO 1186
1184 PRINT H$;CHR$(TL+32);
1186 PRINT ":REM "K$(J)
1190 NEXT:DIM K%(M)
1200 SCREEN $FF:COLOR 15:PRINT "cOMMANDER x16 basic V2 aBBREVIATIONS:":COLOR 13
1204 FOR J=1 TO M:IF LEN(K$(J))=1 GOTO 1210
1206 PRINT A$(J)"="K$(J),:IF K$(J)="GO" THEN COLOR 1:IF C64 THEN M=J:GOTO 1214
1210 NEXT
1214 COLOR 14:PRINT "q TO qUIZ";
1220 GET K$:IF K$<>"" THEN IF (ASC(K$) AND 31)=17 GOTO 1224
1222 GOTO 1220
1224 SCREEN $FF:PRINT "Q TO QUIT QUIZ. wHAT IS THE ABBR. FOR:"
1230 J=RND(-TI):FOR J=1 TO M:K%(J)=J:NEXT:GOSUB 951:COLOR 7:TS=TI
1234 FOR J=1 TO M:IF LEN(K$(K%(J)))=1 THEN PRINT "SKIP "K$(K%(J)):GOTO 1260
1240 PRINT:PRINT K$(K%(J));:INPUT A$:IF A$="Q" GOTO 1270
1244 IF A$<>A$(K%(J)) THEN PRINT CHR$(7);:E=E+1:GOTO 1240
1250 PRINT "rIGHT!"M-J"LEFT."
1260 NEXT
1270 PRINT:PRINT E"ERRORS."INT((TI-TS)/36)/100"MIN.":PRINT
1280 INPUT "tAKE QUIZ AGAIN (Y OR N)";A$:IF A$="Y" GOTO 1200
1284 IF A$<>"N" GOTO 1280
1290 PRINT CHR$($8E):SCREEN $FF:ON C64+1 GOTO 10,64
1299 END