Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
23
Task/Stack/Lingo/stack.lingo
Normal file
23
Task/Stack/Lingo/stack.lingo
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
-- parent script "Stack"
|
||||
|
||||
property _tos
|
||||
|
||||
on push (me, data)
|
||||
me._tos = [#data:data, #next:me._tos]
|
||||
end
|
||||
|
||||
on pop (me)
|
||||
if voidP(me._tos) then return VOID
|
||||
data = me._tos.data
|
||||
me._tos = me._tos.next
|
||||
return data
|
||||
end
|
||||
|
||||
on peek (me)
|
||||
if voidP(me._tos) then return VOID
|
||||
return me._tos.data
|
||||
end
|
||||
|
||||
on empty (me)
|
||||
return voidP(me.peek())
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue