Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
23
Task/Queue-Definition/Phixmonti/queue-definition.phixmonti
Normal file
23
Task/Queue-Definition/Phixmonti/queue-definition.phixmonti
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
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 ?
|
||||
Loading…
Add table
Add a link
Reference in a new issue