(print "------------------------------------------------") (print "Testing while loops") (print) (def countdown (fun (count) : (while (count > 0) : (print count) (count := (count - 1))) (print "BOOM!"))) (print "Countdown...") (countdown 3) (print) (def collatz (fun (n) : (with [steps = 0] : (print n) (while (n > 1) : (if ((n % 2) == 0) then (n := (n / 2)) else (n := ((3 * n) + 1))) (print n) (steps := (steps + 1))) (print "Took" steps "steps to reach 1")))) (print "The Collatz sequence...") (collatz 13)