-
Notifications
You must be signed in to change notification settings - Fork 1
/
KEYWORDSABBR-R41.BAS
55 lines (55 loc) · 2.18 KB
/
KEYWORDSABBR-R41.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
1 REM KEYWORDS&ABBR. (C) 2022 MIKAEL O. BONNIER, LUND, SWEDEN. FOSS LIC.:GPLV3.
10 GOTO 1010:REM COMMANDER X16 R39-R41
1010 SCREEN $FF:COLOR 14,0:CLS: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+16),A$(107+16):REM -"-
1030 FOR P=BASE TO BASE+388+128: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 1410
1070 NEXT
1080 M=I-1
1090 COLOR 7:PRINT CHR$($0E)
1100 FOR J=1 TO M
1110 N=2
1120 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 1310:GOTO 1180
1170 H$=LEFT$(A$(J),LEN(A$(J))-1):TL=ASC(RIGHT$(A$(J),1)):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 CLS: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
1210 NEXT:COLOR 14:PRINT "q TO qUIZ"
1220 GET K$:IF K$<>"" THEN IF (ASC(K$) AND 31)=17 GOTO 1224
1222 GOTO 1220
1224 CLS:PRINT "Q TO QUIT QUIZ. wHAT IS THE ABBR. FOR:"
1230 J=RND(-TI):FOR J=1 TO M:K%(J)=J:NEXT:GOSUB 1510: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:RUN
1299 END
1310 IF A$(J)="PRINT" THEN A$(J)="?"
1320 RETURN
1410 K$(I)=W$:PRINT W$" ";:W$="":IF I=1 AND K$(I)<>"END" THEN RETURN
1420 IF LEFT$(K$(I),4)="TOO " GOTO 1080:REM POP WOULD BE USEFUL
1430 I=I+1:RETURN
1510 FOR I=M TO 2 STEP -1:J=INT(I*RND(1))+1:T=K%(I):K%(I)=K%(J):K%(J)=T
1530 NEXT:RETURN