Towers of Hanoi: Difference between revisions

Frink
(Frink)
Line 1,660:
Move disk 1 from pole 3 to pole 2
</pre>
 
=={{header|Frink}}==
<lang frink>
/** Set up the recursive call for n disks */
hanoi[n] := hanoi[n, 1, 3, 2]
 
/** The recursive call. */
hanoi[n, source, target, aux] :=
{
if n > 0
{
hanoi[n-1, source, aux, target]
println["Move from $source to $target"]
hanoi[n-1, aux, target, source]
}
}
 
hanoi[7]
</lang>
 
=={{header|FutureBasic}}==
494

edits