progs/fun-tests/hanoi.fun
changeset 790 31a9f89776a3
parent 742 b5b5583a3a08
--- a/progs/fun-tests/hanoi.fun	Sun Oct 25 01:25:01 2020 +0000
+++ b/progs/fun-tests/hanoi.fun	Mon Oct 26 10:24:59 2020 +0000
@@ -1,10 +1,10 @@
 // towers of hanoi in Fun
 
-let rec hanoi = fun n a b c ->
-  if n != 0 then (
+def hanoi(n, a, b, c) =
+  if n != 0 then {
     hanoi (n - 1) a c b;
     print_endline ("Move disk from pole " ^ (show a) ^ " to pole " ^ (show b));
     hanoi (n - 1) c b a
-  ) else ();;
+  } else write("")
 
 impure $ hanoi 4 1 2 3;;
\ No newline at end of file