Description Usage Arguments Details References See Also Examples
This function uses the recursive algorithm to solve the Tower of Hanoi puzzle, and demonstrates the game in animation.
1 | towerOfHanoi(n)
|
n |
an integer indicating the number of disks on the rot. |
This function was written by Linlin Yan <linlin.yan@cos.name> in a Chinese forum (See 'References') to show the usage of recursive algorithm.
Original code: http://cos.name/cn/topic/101199
About the Tower of Hanoi: http://en.wikipedia.org/wiki/Tower_of_Hanoi
1 2 3 4 | ## Not run:
towerOfHanoi(7)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.