Queue/Definition: Difference between revisions

m
Line 5,608:
|
{ } ''''QUEUE'''' STO== ≫ ''''EMPTY'''' STO
'''QUEUE''' + ''''QUEUE'''' STO ≫ ''''PUSH'''' STO
IF '''QUEUE''' SIZE THEN
Line 5,621 ⟶ 5,623:
|
''( -- )''
StoreTest anthe emptyglobal list in thevariable QUEUE variable
''( item -- )''
Add the item at the beginning of the list
''( -- item )''
Line 5,635 ⟶ 5,639:
{{in}}
<pre>
''{ } 'QUEUE''' STO
'''EMPTY'''
"The" '''PUSH'''
7"The" '''PUSH'''
{7 Wonders } '''PUSH'''
2: { 'Wonders' 7} "The" }PUSH
'''QUEUE'''
QUEUE
'''POP'''
EMPTY
POP
</pre>
{{out}}
<pre>
4: 1
2: { 'Wonders' 7 "The" }
3: { 'Wonders' 7 "The" }
2: 0
1: "The"
</pre>
1,150

edits