Towers of Hanoi: Difference between revisions
Content added Content deleted
Line 1,199: | Line 1,199: | ||
hanoiM' (n - 1) c b a</lang> |
hanoiM' (n - 1) c b a</lang> |
||
=={{header|Elena}}== |
=={{header|Elena}}== |
||
ELENA |
ELENA 4.x : |
||
<lang elena>move = ( |
<lang elena>move = (n,from,to,via) |
||
{ |
|||
[ |
|||
if (n == 1) |
if (n == 1) |
||
{ |
|||
console |
console.printLine("Move disk from pole ",from," to pole ",to) |
||
} |
|||
else |
|||
{ |
|||
⚫ | |||
move(1,from |
move(n-1,from,via,to); |
||
⚫ | |||
move(n-1,via,to,from) |
move(n-1,via,to,from) |
||
} |
|||
};</lang> |
|||
=={{header|Elixir}}== |
=={{header|Elixir}}== |