Last active
September 21, 2018 07:17
-
-
Save v1b3m/2976527b296b2dab48ae43bf9310fe3e to your computer and use it in GitHub Desktop.
This file contains 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 to simuate tower of hanoi */ | |
var hanoi = function(disc,src,aux,dst) { | |
if (disc > 0) { | |
hanoi(disc - 1,src,dst,aux); | |
$('#lists').append("Move disc " + disc + " from " + src + " to " + dst + "<br />"); | |
hanoi(disc - 1,aux,src,dst); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment