Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hanoi :: Int -> Position -> Position -> [Move]
- {- n Anzahl der Scheiben, i Startposition, j Zielposition -}
- hanoi 1 i j = [(i,j)]
- hanoi n i j = hanoi n' i otherT ++ [(i,j)] ++ hanoi n' otherT j
- where n' = n-1
- otherT = 1+2+3-i-j -- other tower
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement