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!
I had enough colleagues unable to type exactly what they asked me into whatever search engine they preferred to accept your statement. If you don’t know how to use a search engine go ask for another job.
“Hey pancake, how do I run all tests via gradle?”
Open your browser, head to Google and type “run all tests in gradle”
“Oh, nice. Thank you for your help!”
And the next day the game starts all over again.
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
Pfft, writing a program that collects user input and displays it is just trite. I’m going to skip straight to building an MMO.
Science-based, 100% dragon MMO or gtfo.
I need 100k in my kick starter by tomorrow, sharp
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
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.
Functional programming flips your brain around backwards, but shader programming will turn it inside-out.
For more brain flipping try looking into hardware description languages (Verilog) or proof assistants (Coq).
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
Edit: I understand it now. That first line is just a really weird way to define a function.
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.
I took a test once where one of the questions was to solve the tower of hanoi with 2 pegs and 3 disks.
How is that possible? is it has a different rule?
No, it was a trick question. The test taker was supposed to pick up on that.
That’s just unfair
I was lucky enough to figure out that it was a trick question, but I second guessed every answer I put on tests and homework for that professor ever since.
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.