mirror of
https://github.com/louisrubet/rpn
synced 2024-12-28 09:58:52 +01:00
#95: added 10-program.txt
This commit is contained in:
parent
d07c9ca36f
commit
c1d5dbca90
1 changed files with 29 additions and 0 deletions
29
test/10-program.txt
Normal file
29
test/10-program.txt
Normal file
|
@ -0,0 +1,29 @@
|
|||
## PROGRAM
|
||||
|
||||
# program entry
|
||||
<< 1 >> dup eval
|
||||
-> stack should be << 1 >>, 1
|
||||
erase
|
||||
|
||||
# program imbrication
|
||||
<< 1 << 2 >> >>
|
||||
-> stack should be << 1 << 2 >> >>
|
||||
erase
|
||||
|
||||
# program evaluation
|
||||
<< 1 << 2 >> >> dup eval
|
||||
-> stack should be << 1 << 2 >> >>, 1, << 2 >>
|
||||
erase
|
||||
|
||||
# program 1 arg
|
||||
default
|
||||
10
|
||||
<< -> n << 0 1 n for i i 2 * inv + next >> >>
|
||||
eval
|
||||
-> stack should be 1.4644841269841269841
|
||||
erase
|
||||
|
||||
# program several args
|
||||
0 1 10 << -> u0 u1 n << u0 u1 1 n start dup2 + rot drop next swap drop >> >> eval
|
||||
eval
|
||||
-> stack should be 89
|
Loading…
Reference in a new issue