Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,41 @@
sub push(x$)
queue$ = queue$ + x$ + "#"
end sub
sub pop$()
local i, r$
if queue$ <> "" then
i = instr(queue$, "#")
if i then
r$ = left$(queue$, i-1)
stack$ = right$(queue$, len(queue$) - i)
else
r$ = queue$
queue$ = ""
end if
return r$
else
print "--Queue is empty--"
end if
end sub
sub empty()
return queue$ = ""
end sub
// ======== test ========
for n = 3 to 5
print "Push ", n : push(str$(n))
next
print "Pop ", pop$()
print "Push ", 6 : push(str$(6))
while(not empty())
print "Pop ", pop$()
wend
print "Pop ", pop$()