Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
33
Task/Subleq/Sinclair-ZX81-BASIC/subleq.basic
Normal file
33
Task/Subleq/Sinclair-ZX81-BASIC/subleq.basic
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
10 DIM M(32)
|
||||
20 INPUT P$
|
||||
30 LET W=1
|
||||
40 LET C=1
|
||||
50 IF C<LEN P$ THEN GOTO 80
|
||||
60 LET M(W)=VAL P$
|
||||
70 GOTO 150
|
||||
80 IF P$(C)=" " THEN GOTO 110
|
||||
90 LET C=C+1
|
||||
100 GOTO 50
|
||||
110 LET M(W)=VAL P$( TO C-1)
|
||||
120 LET P$=P$(C+1 TO )
|
||||
130 LET W=W+1
|
||||
140 GOTO 40
|
||||
150 LET P=0
|
||||
160 LET A=M(P+1)
|
||||
170 LET B=M(P+2)
|
||||
180 LET C=M(P+3)
|
||||
190 LET P=P+3
|
||||
200 IF A=-1 THEN GOTO 260
|
||||
210 IF B=-1 THEN GOTO 290
|
||||
220 LET M(B+1)=M(B+1)-M(A+1)
|
||||
230 IF M(B+1)<=0 THEN LET P=C
|
||||
240 IF P<0 THEN STOP
|
||||
250 GOTO 160
|
||||
260 INPUT C$
|
||||
270 LET M(B+1)=1+CODE C$
|
||||
280 GOTO 160
|
||||
290 IF M(A+1)<>118 THEN GOTO 320
|
||||
300 PRINT
|
||||
310 GOTO 160
|
||||
320 PRINT CHR$ (M(A+1)-1);
|
||||
330 GOTO 160
|
||||
Loading…
Add table
Add a link
Reference in a new issue