Data update
This commit is contained in:
parent
ed705008a8
commit
0df55f9f24
2196 changed files with 32999 additions and 3075 deletions
9
Task/Queue-Usage/EasyLang/queue-usage.easy
Normal file
9
Task/Queue-Usage/EasyLang/queue-usage.easy
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
##
|
||||
# queue definition
|
||||
#
|
||||
qu_enq 2
|
||||
qu_enq 5
|
||||
qu_enq 7
|
||||
while qu_empty = 0
|
||||
print qu_deq
|
||||
.
|
||||
|
|
@ -6,9 +6,9 @@ public program()
|
|||
// Create a queue and "push" items into it
|
||||
var queue := new Queue();
|
||||
|
||||
queue.push:1;
|
||||
queue.push:3;
|
||||
queue.push:5;
|
||||
queue.push(1);
|
||||
queue.push(3);
|
||||
queue.push(5);
|
||||
|
||||
// "Pop" items from the queue in FIFO order
|
||||
console.printLine(queue.pop()); // 1
|
||||
|
|
@ -20,5 +20,5 @@ public program()
|
|||
|
||||
// If we try to pop from an empty queue, an exception
|
||||
// is thrown.
|
||||
queue.pop() \\ on:(e){ console.writeLine:"Queue empty." }
|
||||
queue.pop() \\ on::(e){ console.writeLine("Queue empty.") }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import "/queue" for Queue
|
||||
import "./queue" for Queue
|
||||
|
||||
var q = Queue.new()
|
||||
q.push(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue