Anonymous user
Towers of Hanoi: Difference between revisions
m
→{{header|D}}: Highlighting, headings
(→{{header|C}}: Added lang tag) |
m (→{{header|D}}: Highlighting, headings) |
||
Line 130:
=={{header|D}}==
===Recursive===
<
import std.stdio;
Line 147 ⟶ 148:
void main() {
Hanoi(3, "L","M","R") ;
}</
===Iterative===
ref : [http://hanoitower.mkolar.org/shortestTHalgo.html The shortest and "mysterious" TH algorithm]
<
import std.stdio;
import std.conv ;
Line 169 ⟶ 170:
int n = (args.length > 1) ? to!(int)(args[1]) : 3 ;
Hanoi(n, "L","M","R") ;
}</
=={{header|Dc}}==
|