Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
16
Task/Queue-Definition/Applesoft-BASIC/queue-definition.basic
Normal file
16
Task/Queue-Definition/Applesoft-BASIC/queue-definition.basic
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
0 DEF FN E(MPTY) = SP = FIRST
|
||||
10 GOSUB 150EMPTY
|
||||
20 LET A$ = "A": GOSUB 100PUSH
|
||||
30 LET A$ = "B": GOSUB 100PUSH
|
||||
40 GOSUB 150EMPTY
|
||||
50 GOSUB 120PULL FIRST
|
||||
60 GOSUB 120PULL FIRST
|
||||
70 GOSUB 150EMPTY
|
||||
80 GOSUB 120PULL FIRST
|
||||
90 END
|
||||
100 PRINT "PUSH "A$
|
||||
110 LET S$(SP) = A$:SP = SP + 1: RETURN
|
||||
120 GOSUB 130: PRINT "POP "A$: RETURN
|
||||
130 IF FN E(0) THEN PRINT "POPPING FROM EMPTY QUEUE";: STOP
|
||||
140 A$ = S$(FI): FI = FI + 1 : RETURN
|
||||
150 PRINT "EMPTY? " MID$ ("YESNO",4 ^ FN E(0),3): RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue