Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
23
Task/Stack/Arturo/stack.arturo
Normal file
23
Task/Stack/Arturo/stack.arturo
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
Stack: $[]-> []
|
||||
|
||||
pushTo: function [st val]-> 'st ++ val
|
||||
popStack: function [st] [
|
||||
result: last st
|
||||
remove 'st .index (size st)-1
|
||||
return result
|
||||
]
|
||||
emptyStack: function [st]-> empty 'st
|
||||
printStack: function [st]-> print st
|
||||
|
||||
st: new Stack
|
||||
|
||||
pushTo st "one"
|
||||
pushTo st "two"
|
||||
pushTo st "three"
|
||||
printStack st
|
||||
|
||||
print popStack st
|
||||
printStack st
|
||||
|
||||
emptyStack st
|
||||
print ["finally:" st]
|
||||
Loading…
Add table
Add a link
Reference in a new issue