1 2 3 4 5 6 7 8 9 10 11 12
: countdown ( Int -- Int ) dup 0 i.<= if drop 0 else dup 1 i.- countdown i.+ then ; : test-countdown ( -- ) 5 countdown 15 test.assert-eq ;