fun hanoi(disks: Int, src: String, dest: String, aux: String) {
if (disks > 0) {
hanoi(disks - 1, src, aux, dest)
println("Move disk from $src to $dest")
hanoi(disks - 1, aux, dest, src)
}
}
fun main() {
var disks = 3
println("Using $disks disk/s")
hanoi(disks, "A", "C", "B")
}
To embed this project on your website, copy the following code and paste it into your website's HTML: