| changeset 742 | 155426396b5f |
| parent 706 | 7d85a4599549 |
| child 790 | 71ef7d9ef635 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/progs/fun-tests/hanoi.fun Thu Jul 30 13:50:54 2020 +0100 @@ -0,0 +1,10 @@ +// towers of hanoi in Fun + +let rec hanoi = fun 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 ();; + +impure $ hanoi 4 1 2 3;; \ No newline at end of file