1 data Move = Move Int Int
4 instance Show Move where
5 show (Move a b) = show a ++ " " ++ show b
10 let nDisks = read line1 :: Int
11 let moves = solve nDisks 1 2 3
13 putStrLn $ unlines $ map show moves
15 solve :: Int -> Int -> Int -> Int -> [Move]
17 solve n a b c = solve (n-1) a c b ++ [Move a c] ++ solve (n-1) b a c