Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function hanoi(src,dst,n)
- {
- var helper = 6 - (src+dst)
- if(n==1)
- {
- move(src);
- move(dst);
- }
- else
- {
- hanoi(src,helper,n-1);
- hanoi(src,dst,1);
- hanoi(helper,dst,n-1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement