September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
14
Task/Stack/Lang5/stack.lang5
Normal file
14
Task/Stack/Lang5/stack.lang5
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
: cr "\n" . ;
|
||||
: empty? dup execute length if 0 else -1 then swap drop ;
|
||||
: pop dup execute length 1 - extract swap drop ;
|
||||
: push dup execute rot append over ;
|
||||
: s. stack execute . ;
|
||||
|
||||
[] '_ set
|
||||
: stack '_ ;
|
||||
stack # local variable
|
||||
1 swap push set
|
||||
2 swap push set s. cr # [ 1 2 ]
|
||||
pop . s. cr # 2 [ 1 ]
|
||||
pop drop
|
||||
empty? . # -1
|
||||
Loading…
Add table
Add a link
Reference in a new issue