Anonymous user
Queue/Definition: Difference between revisions
m
→version 2: simplief the viewQueue subroutine. -- ~~~~
m (→{{header|AWK}}: Handle empty queue.) |
m (→version 2: simplief the viewQueue subroutine. -- ~~~~) |
||
Line 2,638:
call viewQueue
a="Fred"
push /*puts a "null"
push a 2 /*puts "Fred 2"
call viewQueue
queue "Toft 2" /*put "Toft 2"
queue /*put a "null"
call viewQueue
do n=1 while queued()\==0
Line 2,651:
call viewQueue
exit /*stick a fork in it, we're done.*/
/*─────────────────────────────────────viewQueue subroutine─────────────*/
viewQueue:
else say 'There are' queued() 'elements in the queue'▼
▲ else say 'There are' queued() 'elements in the queue'
return</lang>
|