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
4
Task/Stack/Oforth/stack-1.oforth
Normal file
4
Task/Stack/Oforth/stack-1.oforth
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
ListBuffer Class new: Stack
|
||||
Stack method: push self add ;
|
||||
Stack method: pop self removeLast ;
|
||||
Stack method: top self last ;
|
||||
11
Task/Stack/Oforth/stack-2.oforth
Normal file
11
Task/Stack/Oforth/stack-2.oforth
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
: testStack
|
||||
| s |
|
||||
Stack new ->s
|
||||
s push(10)
|
||||
s push(11)
|
||||
s push(12)
|
||||
s top println
|
||||
s pop println
|
||||
s pop println
|
||||
s pop println
|
||||
s isEmpty ifTrue: [ "Stack is empty" println ] ;
|
||||
Loading…
Add table
Add a link
Reference in a new issue