enum pole:String{
case a = "a"
case b = "b"
case c = "c"
}

func hanoi(num:Int, from:pole, to:pole, workWith:pole)->[(pole,pole)]{
var operation:[(pole,pole)]=[]
if num == 1 {
operation+=[(from,to)]
}
else {
operation += hanoi(num:num-1, from:from, to:workWith, workWith:to)
operation += hanoi(num:1, from:from, to:to, workWith:workWith)
operation += hanoi(num:num-1, from:workWith, to:to, workWith:from)
}
return operation
}

let moveList = hanoi(num:9, from:pole.a, to:pole.b, workWith:pole.c)

print(moveList.count)
print(moveList)