• xmunk@sh.itjust.works
        link
        fedilink
        arrow-up
        4
        ·
        9 months ago

        I have a production bug… it only happens on Saturdays ever our ops folks have no idea - this can be replicated on a test server that gets no traffic.

        Saturday why!

        • CanadaPlus@lemmy.sdf.org
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          9 months ago

          Please tell me it doesn’t still happen when you emulate a different day of the week. Or is that non-trivial to even do because of technical debt? Either way, RIP weekends.

  • harrys_balzac@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    21
    ·
    9 months ago

    I didn’t have to program this, thankfully. The code was used as an example of recursion but the explanation was lacking so I ended up writing out each frame by end until I understood it. Took a few pages and a couple of hours.

    I am grateful that I learned what I did going through it but I’d rather not do it again.

  • Victor@lemmy.world
    link
    fedilink
    arrow-up
    15
    ·
    9 months ago

    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?

    • Akrenion@programming.dev
      link
      fedilink
      arrow-up
      34
      ·
      9 months ago

      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.

      • Victor@lemmy.world
        link
        fedilink
        arrow-up
        7
        ·
        9 months ago

        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?

        • Ephera@lemmy.ml
          link
          fedilink
          arrow-up
          7
          ·
          9 months ago

          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).

          • CanadaPlus@lemmy.sdf.org
            link
            fedilink
            arrow-up
            3
            ·
            9 months ago

            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.

      • RamblingPanda@lemmynsfw.com
        link
        fedilink
        arrow-up
        4
        ·
        9 months ago

        Thank god my first time was building a dynamic tree with loads of metadata and sorting from database records and not some strange game 😐

    • xmunk@sh.itjust.works
      link
      fedilink
      arrow-up
      9
      ·
      9 months ago

      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.

    • sv1sjp@lemmy.world
      link
      fedilink
      English
      arrow-up
      3
      ·
      9 months ago

      In myuniversity, we used to play with these to find the fastest path in AI (A*, first depth etc)

  • akash_rawal@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    9 months ago

    Replacing “Programmers:” with “Program:” is more accurate.

    spoiler

    Tower of Hanoi is actually easy to write program for. Executing it on the other hand…

    • CanadaPlus@lemmy.sdf.org
      link
      fedilink
      arrow-up
      3
      ·
      9 months ago

      It’d be a trick if you didn’t already know the answer. Or at least, it would be for me. It’s also hard to actually visualise.

  • pmk@lemmy.sdf.org
    link
    fedilink
    arrow-up
    5
    ·
    9 months ago

    “You mean I just made a very complicated array-manipulating way of calculating (2^n)-1?”