Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Stack/Retro/stack.retro
Normal file
15
Task/Stack/Retro/stack.retro
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
: stack ( n"- ) create 0 , allot ;
|
||||
: push ( na- ) dup ++ dup @ + ! ;
|
||||
: pop ( a-n ) dup @ over -- + @ ;
|
||||
: top ( a-n ) dup @ + @ ;
|
||||
: empty? ( a-f ) @ 0 = ;
|
||||
|
||||
10 stack st
|
||||
|
||||
1 st push
|
||||
2 st push
|
||||
3 st push
|
||||
st empty? putn
|
||||
st top putn
|
||||
st pop putn st pop putn st pop putn
|
||||
st empty? putn
|
||||
Loading…
Add table
Add a link
Reference in a new issue