Towers of Hanoi: Difference between revisions

Content added Content deleted
m (Standard ML Towers of Hanoi solution)
(Standard ML Towers of Hanoi solution)
Line 3,283: Line 3,283:
=={{header|Standard ML}}==
=={{header|Standard ML}}==
fun hanoi(0, a, b, c) = [] |
fun hanoi(0, a, b, c) = [] |
hanoi(n, a, b, c) = hanoi(n-1, a, c, b) @ [(a,b)] @ hanoi(n-1, c, b, a);
hanoi(n, a, b, c) = hanoi(n-1, a, c, b) @ [(a,b)] @ hanoi(n-1, c, b, a);


=={{header|Swift}}==
=={{header|Swift}}==