Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
- ( do ... until )
- ( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
- ( Value n is taken from the stack and stored to a virtual )
- ( variable. When this number is equal to the TOS at the time )
- ( until is executed, the loop terminates. )
- ( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
- {{
- : skipped-nop ( - ) 8 , here 2 + , 0 , ;
- : virtual-var ( R: -a C: -aa )
- here dup 1-
- dup literal, ;
- ---reveal---
- : target ( R: -n C: aa-aa )
- dup , ` @ ;
- : do ( R: nn-n? C: -aa )
- ` 2dup ` >if
- skipped-nop
- virtual-var ` ! ; compile-only
- : until ( R: ?n- C: aa- )
- ` dup literal, ` @
- ` > ` if swap 8 , 3 + ,
- ` then ` drop
- ` else ` 2drop ` then ; compile-only
- }}
- : test 10 11 do dup . 1- until ;
- test
- : test 10 10 do dup . 1- until ;
- test
- : test 10 1 do dup . 1- until ;
- test
Add Comment
Please, Sign In to add comment