We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 20373e2 commit affed2dCopy full SHA for affed2d
1 file changed
JavaScript_The_Good_Parts.js
@@ -0,0 +1,13 @@
1
+// following JavaScript will run in a JS console, e.g. Firebug
2
+
3
+var hanoi = function hanoi(disc, src, aux, dst) {
4
+ if (disc > 0) {
5
+ hanoi(disc - 1, src, dst, aux);
6
+ console.log('Move disc ' + disc + ' from '
7
+ + src + ' to ' + dst);
8
+ hanoi(disc - 1, aux, src, dst);
9
+ }
10
+};
11
12
+hanoi(3, 'Src', 'Aux', 'Dst');
13
0 commit comments