Towers of Hanoi: Difference between revisions
Content added Content deleted
(Added code for Standard ML) |
|||
Line 3,281: | Line 3,281: | ||
14: Move disc from A to C |
14: Move disc from A to C |
||
15: Move disc from B to C</pre> |
15: Move disc from B to C</pre> |
||
=={{header|Standard ML}}== |
|||
<land StandardML> 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);</lang> |
|||
=={{header|Swift}}== |
=={{header|Swift}}== |
||
{{trans|JavaScript}} |
{{trans|JavaScript}} |