mirror of
https://github.com/louisrubet/rpn
synced 2025-01-01 18:20:06 +01:00
111 lines
1.6 KiB
Text
111 lines
1.6 KiB
Text
## BRANCH
|
|
|
|
# if then else end (1)
|
|
1 if then 'ok' end
|
|
-> stack should be 'ok'
|
|
erase
|
|
|
|
# if then else end (2)
|
|
1 if 'before' then 'ok' end
|
|
-> stack should be 'before', 'ok'
|
|
erase
|
|
|
|
# if then else end (3)
|
|
0 if then 'ok' end
|
|
-> stack size should be 0
|
|
erase
|
|
|
|
# if then else end (4)
|
|
0 if then 'ok' end
|
|
-> stack size should be 0
|
|
erase
|
|
|
|
# if then else end (5)
|
|
1 if then 'ok' else 'KO' end
|
|
-> stack should be 'ok'
|
|
erase
|
|
|
|
# if then else end (6)
|
|
1 if then 'ok' 'dokey' else 'KO' end
|
|
-> stack should be 'ok', 'dokey'
|
|
erase
|
|
|
|
# if then else end (7)
|
|
0 if then 'ok' else 'KO' end
|
|
-> stack should be 'KO'
|
|
erase
|
|
|
|
# start next (1)
|
|
1 2 start 0 next
|
|
-> stack should be 0, 0
|
|
erase
|
|
|
|
# start next (2)
|
|
2 1 start 0 next
|
|
-> stack size should be 0
|
|
erase
|
|
|
|
# start next (3)
|
|
-2 -1 start 0 next
|
|
-> stack should be 0, 0
|
|
erase
|
|
|
|
# start next (4)
|
|
-1 -2 start 0 next
|
|
-> stack size should be 0
|
|
erase
|
|
|
|
# start next (5)
|
|
1 1 start 0 next
|
|
-> stack should be 0
|
|
erase
|
|
|
|
# for next (1)
|
|
23 27 for i i next
|
|
-> stack should be 23, 24, 25, 26, 27
|
|
erase
|
|
|
|
# for next (2)
|
|
1 1 for i i next
|
|
-> stack should be 1
|
|
erase
|
|
|
|
# for next (3)
|
|
27 23 for i i next
|
|
-> stack size should be 0
|
|
erase
|
|
|
|
# for next (4)
|
|
-2 -1 for i i next
|
|
-> stack should be -2, -1
|
|
erase
|
|
|
|
# for next (5)
|
|
-1 -2 for i i next
|
|
-> stack size should be 0
|
|
erase
|
|
|
|
# for step (1)
|
|
23 27 for i 1 step
|
|
-> stack should be 23, 24, 25, 26, 27
|
|
erase
|
|
|
|
# for step (2)
|
|
0 1 for i i 0.25 step
|
|
-> stack should be 0, 0.25, 0.5, 0.75, 1
|
|
erase
|
|
|
|
# for step (3)
|
|
-1 0 for i i 0.25 step
|
|
-> stack should be -1, -0.75, -0.5, -0.25, 0
|
|
erase
|
|
|
|
# for step (4)
|
|
0 -1 for i i 0.25 step
|
|
-> stack size should be 0
|
|
erase
|
|
|
|
# for step (5)
|
|
0 -1 for i i -0.25 step
|
|
-> stack size should be 0, -0.25, -0.5, -0.75, -1
|
|
erase
|