Is this a hard problem to solve? I’ve not attempted it yet myself.
I seem to remember this was a problem in Advent of Code one year?
I’m imagining there are plenty of algorithms to solve this already, right? With varying numbers of towers and plates? A general solution for solvable amounts of each? Maybe?
This is not a hard problem once you wrap your head around it. It is the earliest that some programmers learn about recursion which has a lot of pitfalls and can be frustrating at times.
Ah okay, that’s where the trauma comes from then, perhaps? 😅 Just being new to a concept and perhaps starting out with a problem that is a little too big while at the same time learning the concept?
I feel like it’s maybe a bit too much to say that it’s a trauma. The Vietnam-flashback picture is just very fitting, because the puzzle is called “Towers of Hanoi” (Hanoi is the capital of Vietnam).
A lot of programmer memes seem to be about first-year compsci students that just want to build video games, and don’t really like math. For those people, sure, algorithms could be a bit of a rude awakening.
I was once that first year compsci student. Hanoi kicked my ass, I had to go recruit help from my smarter friends. Though to be fair the teacher didn’t explain it that well and just sort of threw it at us to see which of us would sink or swim. After we all complained about it he gave us a proper lesson on recursion and it was a little easier after that but I still struggled a lot on that project. We also implemented Conway’s Game of Life that semester and I preferred that project by a lot.
See, when I was a comp sci undergrad 20-odd years ago our department wanted to do a programming competition for the local high schools. We set some ground rules that were similar to ACS programming competition rules, but a bit more lax - the big ones were that it had to run in command line, it had to take the problem dataset filename as the first parameter and it had to be able to solve all datasets attempted by the judges in less that 2 minutes per dataset, noting that the judgement datasets would be larger than example ones.
Some of the students were asked to come up with problem ideas. I was told mine was unfair, but mine was entirely about choosing the right algorithm for the job.
It went like this - the file would contain a pyramid of numbers. You were supposed to think of each number as connecting to the two numbers diagonally below it and all paths could only proceed down. The goal was to calculate the largest sum of any possible path down.
It’s an easy problem to solve… eventually - it’s more annoying to solve optimally and that’s what programmers usually get handed as a play problem within a year or two of starting to tinker.
Is this a hard problem to solve? I’ve not attempted it yet myself.
I seem to remember this was a problem in Advent of Code one year?
I’m imagining there are plenty of algorithms to solve this already, right? With varying numbers of towers and plates? A general solution for solvable amounts of each? Maybe?
This is not a hard problem once you wrap your head around it. It is the earliest that some programmers learn about recursion which has a lot of pitfalls and can be frustrating at times.
Ah okay, that’s where the trauma comes from then, perhaps? 😅 Just being new to a concept and perhaps starting out with a problem that is a little too big while at the same time learning the concept?
I feel like it’s maybe a bit too much to say that it’s a trauma. The Vietnam-flashback picture is just very fitting, because the puzzle is called “Towers of Hanoi” (Hanoi is the capital of Vietnam).
A lot of programmer memes seem to be about first-year compsci students that just want to build video games, and don’t really like math. For those people, sure, algorithms could be a bit of a rude awakening.
I was once that first year compsci student. Hanoi kicked my ass, I had to go recruit help from my smarter friends. Though to be fair the teacher didn’t explain it that well and just sort of threw it at us to see which of us would sink or swim. After we all complained about it he gave us a proper lesson on recursion and it was a little easier after that but I still struggled a lot on that project. We also implemented Conway’s Game of Life that semester and I preferred that project by a lot.
Ah right. 😁
See, when I was a comp sci undergrad 20-odd years ago our department wanted to do a programming competition for the local high schools. We set some ground rules that were similar to ACS programming competition rules, but a bit more lax - the big ones were that it had to run in command line, it had to take the problem dataset filename as the first parameter and it had to be able to solve all datasets attempted by the judges in less that 2 minutes per dataset, noting that the judgement datasets would be larger than example ones.
Some of the students were asked to come up with problem ideas. I was told mine was unfair, but mine was entirely about choosing the right algorithm for the job.
It went like this - the file would contain a pyramid of numbers. You were supposed to think of each number as connecting to the two numbers diagonally below it and all paths could only proceed down. The goal was to calculate the largest sum of any possible path down.
Sounds like a fun problem. Wonder why they thought it wasn’t fair. Sounds no harder than any mid-range Advent of Code problem.
Thank god my first time was building a dynamic tree with loads of metadata and sorting from database records and not some strange game 😐
You can easily tell if you did something wrong with Towers of Hanoi.
You can with a bitchy customer as well 💖
It’s an easy problem to solve… eventually - it’s more annoying to solve optimally and that’s what programmers usually get handed as a play problem within a year or two of starting to tinker.