Created
March 19, 2013 02:21
-
-
Save linstantnoodles/5193227 to your computer and use it in GitHub Desktop.
hanoi recursive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function move(n, f, d, t) { | |
if (n > 0) { | |
move(n - 1, f, t, d); | |
d.push(f.pop()); | |
move(n - 1, t, d, f); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment