Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Queue-Usage/Wren/queue-usage.wren
Normal file
13
Task/Queue-Usage/Wren/queue-usage.wren
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import "/queue" for Queue
|
||||
|
||||
var q = Queue.new()
|
||||
q.push(1)
|
||||
q.push(2)
|
||||
System.print("Queue contains %(q)")
|
||||
System.print("Number of elements in queue = %(q.count)")
|
||||
var item = q.pop()
|
||||
System.print("'%(item)' popped from the queue")
|
||||
System.print("First element is now %(q.peek())")
|
||||
q.clear()
|
||||
System.print("Queue cleared")
|
||||
System.print("Is queue now empty? %((q.isEmpty) ? "yes" : "no")")
|
||||
Loading…
Add table
Add a link
Reference in a new issue