hanoi :: num -> [char] -> [char] -> [char] -> [char]
|| number of disks -> start peg -> finish peg -> spare peg -> final output
|| pre:  number of disks is a non-negative integer
|| post: final output is a description of how to solve the hanoi problem
||       for that many disks

hanoi n start finish spare
  = "", if n=0
  = hanoi (n-1) start spare finish
    ++ "Move disk "
    ++ shownum n
    ++ " from peg "
    ++ start
    ++ " to peg "
    ++ finish
    ++ "\n"
    ++ hanoi (n-1) spare finish start, otherwise
