RosettaCodeData/Task/Queue-Definition/Phixmonti/queue-definition.phixmonti

24 lines
306 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
include ..\Utilitys.pmt
def push /# l i -- l&i #/
0 put
enddef
def empty? /# l -- flag #/
len 0 ==
enddef
def pop /# l -- l-1 #/
empty? if
"Empty"
else
head swap tail nip swap
endif
enddef
( ) /# empty queue #/
1 push 2 push 3 push
pop ? pop ? pop ? pop ?