Gollum@feddit.de to Programmer Humor@programming.dev · 1 year agoIt’s a game for kids!i.imgur.comimagemessage-square20fedilinkarrow-up1796
arrow-up1784imageIt’s a game for kids!i.imgur.comGollum@feddit.de to Programmer Humor@programming.dev · 1 year agomessage-square20fedilink
minus-squareKnusper@feddit.delinkfedilinkarrow-up9·1 year agohanoi :: Integer -> a -> a -> a -> [(a, a)] hanoi 0 _ _ _ = [] hanoi n a b c = hanoi (n-1) a c b ++ [(a, b)] ++ hanoi (n-1) c b a From here: https://www.rosettacode.org/wiki/Towers_of_Hanoi#Haskell
From here: https://www.rosettacode.org/wiki/Towers_of_Hanoi#Haskell