Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 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