Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
20
Task/Stack/Genie/stack.genie
Normal file
20
Task/Stack/Genie/stack.genie
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
[indent=4]
|
||||
/*
|
||||
Stack, in Genie, with GLib double ended Queues
|
||||
valac stack.gs
|
||||
*/
|
||||
init
|
||||
var stack = new Queue of int()
|
||||
|
||||
// push
|
||||
stack.push_tail(2)
|
||||
stack.push_tail(1)
|
||||
|
||||
// pop (and peek at top)
|
||||
print stack.pop_tail().to_string()
|
||||
print stack.peek_tail().to_string()
|
||||
|
||||
// empty
|
||||
print "stack size before clear: " + stack.get_length().to_string()
|
||||
stack.clear()
|
||||
print "After clear, stack.is_empty(): " + stack.is_empty().to_string()
|
||||
Loading…
Add table
Add a link
Reference in a new issue