tucson.social
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Gollum@feddit.de to Programmer Humor@programming.dev · 2 years ago

It’s a game for kids!

i.imgur.com

external-link
message-square
20
link
fedilink
785
external-link

It’s a game for kids!

i.imgur.com

Gollum@feddit.de to Programmer Humor@programming.dev · 2 years ago
message-square
20
link
fedilink
alert-triangle
You must log in or # to comment.
  • brophy@lemmy.world
    link
    fedilink
    arrow-up
    121
    ·
    edit-2
    2 years ago

    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

  • odium@programming.dev
    link
    fedilink
    arrow-up
    89
    ·
    2 years ago

    It’s even called tower of Hanoi because of the Vietnam war flashbacks.

  • expatriado@lemmy.world
    link
    fedilink
    arrow-up
    79
    arrow-down
    1
    ·
    2 years ago

    oh, i solved that assignment in school… by finding the algorithm online

    • Karfkengrumble@lemmings.world
      link
      fedilink
      arrow-up
      57
      ·
      2 years ago

      You’re hired, welcome to the team!

      • ChlorineAddict@lemmy.world
        link
        fedilink
        English
        arrow-up
        6
        ·
        2 years ago

        Bonus points for leveraging the work of others contributing to their success

    • Anonymousllama@lemmy.world
      link
      fedilink
      arrow-up
      20
      arrow-down
      4
      ·
      2 years ago

      As it should be, there’s way too much reengineering of the wheel. Let the big brains of the past do the heavy lifting

      • DragonTypeWyvern@literature.cafe
        link
        fedilink
        arrow-up
        29
        arrow-down
        1
        ·
        2 years ago

        screams in that’s not the point

        • Rodeo@lemmy.ca
          link
          fedilink
          arrow-up
          5
          arrow-down
          2
          ·
          2 years ago

          You’re right. The learning is the point. So rather than flail in the dark, why not learn the optimal solution?

  • PapstJL4U@lemmy.world
    link
    fedilink
    English
    arrow-up
    30
    arrow-down
    2
    ·
    2 years ago

    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.

    • lugal@sopuli.xyz
      link
      fedilink
      arrow-up
      29
      arrow-down
      1
      ·
      2 years ago

      Haskell was the hardest, but it looked the most beautiful.

      That pretty much sums that language up

      • TheBananaKing@lemmy.world
        link
        fedilink
        arrow-up
        9
        arrow-down
        1
        ·
        2 years ago

        In order to write a haskell program, you must first write the corresponding haskell program.

        • lugal@sopuli.xyz
          link
          fedilink
          arrow-up
          3
          ·
          2 years ago

          And in order to do that, you have to imagine sisyphus happy

      • DarkenLM@artemis.camp
        link
        fedilink
        arrow-up
        8
        arrow-down
        1
        ·
        2 years ago

        Strange. I find the language hideous, most likely because it resembles math, or maybe because I’m already used to the C-like syntax.

        • lugal@sopuli.xyz
          link
          fedilink
          arrow-up
          13
          ·
          2 years ago

          Haskell is beautiful because it resembles math

          • xigoi@lemmy.sdf.org
            link
            fedilink
            arrow-up
            12
            ·
            2 years ago

            It’s also beautiful because it doesn’t have C-like syntax.

    • Knusper@feddit.de
      link
      fedilink
      arrow-up
      9
      ·
      2 years ago
      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

  • nothacking@discuss.tchncs.de
    link
    fedilink
    arrow-up
    22
    arrow-down
    1
    ·
    2 years ago

    Oh but we don’t play it, we put lighting into rocks and trick them into doing it.

  • ArmokGoB@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    4
    ·
    2 years ago

    Towers of Hanoi? I don’t think so.

  • Aathi@lemmus.org
    link
    fedilink
    English
    arrow-up
    4
    arrow-down
    1
    ·
    edit-2
    2 years ago

    Example for stack

  • stingpie@lemmy.world
    link
    fedilink
    arrow-up
    2
    arrow-down
    4
    ·
    2 years ago

    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.

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1.43K users / day
  • 4.1K users / week
  • 7.61K users / month
  • 19.5K users / 6 months
  • 1 local subscriber
  • 25.2K subscribers
  • 1.57K Posts
  • 51.6K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.12
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org