Kids get infinite registers and no restrictions on stack ordering. Programmers are constrained to solving it with one register and restrictions on stack put operations.
./insert we-are-not-the-same-meme
It’s even called tower of Hanoi because of the Vietnam war flashbacks.
oh, i solved that assignment in school… by finding the algorithm online
You’re hired, welcome to the team!
Bonus points for leveraging the work of others contributing to their success
As it should be, there’s way too much reengineering of the wheel. Let the big brains of the past do the heavy lifting
screams in that’s not the point
You’re right. The learning is the point. So rather than flail in the dark, why not learn the optimal solution?
Before studying CS, I recognized it as ‘the bioware puzzle’. They were probably copying their own scribbles fron back then.
Haskell was the hardest, but it looked the most beautiful.
Haskell was the hardest, but it looked the most beautiful.
That pretty much sums that language up
In order to write a haskell program, you must first write the corresponding haskell program.
And in order to do that, you have to imagine sisyphus happy
Strange. I find the language hideous, most likely because it resembles math, or maybe because I’m already used to the C-like syntax.
Haskell is beautiful because it resembles math
It’s also beautiful because it doesn’t have C-like syntax.
hanoi :: 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
Oh but we don’t play it, we put lighting into rocks and trick them into doing it.
Towers of Hanoi? I don’t think so.
Example for stack
Did you guys find this hard? There are only four possible ways to move a ring, two of which are disallowed by the rules. Out of the remaining two, one of them is simply undoing what you just did.