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