object Hanoi{ def move(n:Int, fromTower:String, toTower:String, usingTower:String):Unit = { if (n==0) return move(n-1, fromTower, usingTower, toTower); println("Moving from " + fromTower + " to " + toTower) move(n-1, usingTower, toTower, fromTower); } }
No comments:
Post a Comment