Towers of Hanoi: Difference between revisions

m
no edit summary
mNo edit summary
Line 410:
| 3 2 1</pre>
 
=={{header|Dart}}==
<lang dart>main() {
moveit(from,to) {
print("move ${from} ---> ${to}");
}
 
hanoi(height,toPole,fromPole,usePole) {
if (height>0) {
hanoi(height-1,usePole,fromPole,toPole);
moveit(fromPole,toPole);
hanoi(height-1,toPole,usePole,fromPole);
}
}
 
hanoi(3,3,1,2);
}
</lang>
Output:
<pre>move 1 ---> 3
move 1 ---> 2
move 3 ---> 2
move 1 ---> 3
move 2 ---> 1
move 2 ---> 3
move 1 ---> 3
</pre>
=={{header|Dc}}==
From [http://se.aminet.net/pub/OpenBSD/src/regress/usr.bin/dc/t20.in Here]