tower_of_hanoi {fun} | R Documentation |
Demonstrate the Tower of Hanoi puzzle in R
Description
This function uses the recursive algorithm to solve the Tower of Hanoi puzzle, and demonstrates the game in animation.
Usage
tower_of_hanoi(n = 7)
Arguments
n |
an integer indicating the number of disks on the rot. |
Details
This function was written by Linlin Yan <linlin.yan@cos.name> in a Chinese forum (See 'References') to show the usage of recursive algorithm.
Author(s)
Linlin Yan <linlin.yan@cos.name>
References
Original code: https://d.cosx.org/d/101199
About the Tower of Hanoi: https://en.wikipedia.org/wiki/Tower_of_Hanoi
See Also
Examples
## Not run:
tower_of_hanoi(7)
## End(Not run)
[Package fun version 0.3 Index]