colorful rat Ratfactor.com > Dave's Repos

meow5

A stack-based pure inlining concatenative programming language written in NASM assembly
git clone http://ratfactor.com/repos/meow5/meow5.git

meow5/loop.meow

Download raw file: loop.meow

1 # A meow5 program to test looping 2 3 # A chunk of code to be looped! 4 def foo 5 dup # duplicate the number on the stack 6 printnum # print it 7 " " print # and a space 8 dec # reduce the one still on the stack 9 ; 10 11 # Another def that loops! 12 def foo-loop 13 loop? foo 14 "\n" print # put a newline after calling loop 15 ; 16 17 # Try some loops! 18 5 foo-loop 19 10 foo-loop