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