Towers of Hanoi: Difference between revisions
Content added Content deleted
Line 1,127: | Line 1,127: | ||
putStrLn $ "Move " ++ show a ++ " to " ++ show b |
putStrLn $ "Move " ++ show a ++ " to " ++ show b |
||
hanoiM' (n - 1) c b a</lang> |
hanoiM' (n - 1) c b a</lang> |
||
=={{header|Elena}}== |
|||
ELENA 3.2 : |
|||
<lang elena>move = (:n:from:to:via) |
|||
[ |
|||
if (n == 1) |
|||
[ |
|||
console printLine("Move disk from pole ",from," to pole ",to). |
|||
]; |
|||
[ |
|||
move eval(n-1,from,via,to). |
|||
move eval(1,from,to,via). |
|||
move eval(n-1,via,to,from) |
|||
] |
|||
].</lang> |
|||
=={{header|Elixir}}== |
=={{header|Elixir}}== |