\(hanoi[n_, a_, b_, c_] := 
      If[n == 1, Print["Move disk from ", a, " to ", c], 
        hanoi[n - 1, a, c, b]; 
        Print["Move disk from ", a, " to ", 
          c]; 
hanoi[n - 1, b, a, 
          c]]
\)
hanoi[3, "A", "B", "C"]