lonestar-lemmy
  • 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

message-square
30
link
fedilink
645

It’s a game for kids!

i.imgur.com

Gollum@feddit.de to Programmer Humor@programming.dev · 2 years ago
message-square
30
link
fedilink
alert-triangle
You must log in or # to comment.
  • brophy@lemmy.world
    link
    fedilink
    arrow-up
    100
    ·
    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
    87
    ·
    2 years ago

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

  • expatriado@lemmy.world
    link
    fedilink
    arrow-up
    62
    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
      47
      ·
      2 years ago

      You’re hired, welcome to the team!

      • LetterboxPancake@sh.itjust.works
        link
        fedilink
        Deutsch
        arrow-up
        14
        arrow-down
        1
        ·
        2 years ago

        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.

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

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

    • Anonymousllama@lemmy.world
      link
      fedilink
      arrow-up
      13
      arrow-down
      2
      ·
      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
        23
        ·
        2 years ago

        screams in that’s not the point

        • fsxylo@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          11
          ·
          2 years ago

          Pfft, writing a program that collects user input and displays it is just trite. I’m going to skip straight to building an MMO.

          • frickineh@lemmy.world
            link
            fedilink
            arrow-up
            13
            ·
            2 years ago

            Science-based, 100% dragon MMO or gtfo.

            • CurlyChopz@programming.dev
              link
              fedilink
              arrow-up
              4
              ·
              2 years ago

              I need 100k in my kick starter by tomorrow, sharp

        • Rodeo@lemmy.ca
          link
          fedilink
          arrow-up
          1
          arrow-down
          1
          ·
          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
      28
      arrow-down
      1
      ·
      2 years ago

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

      That pretty much sums that language up

      • DarkenLM@artemis.camp
        link
        fedilink
        arrow-up
        9
        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
            11
            ·
            2 years ago

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

      • mindbleach@sh.itjust.works
        link
        fedilink
        arrow-up
        2
        ·
        2 years ago

        Functional programming flips your brain around backwards, but shader programming will turn it inside-out.

        • manpacket@lemmyrs.org
          link
          fedilink
          English
          arrow-up
          1
          ·
          2 years ago

          For more brain flipping try looking into hardware description languages (Verilog) or proof assistants (Coq).

    • Knusper@feddit.de
      link
      fedilink
      arrow-up
      6
      ·
      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

      • DumbAceDragon@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        8
        ·
        edit-2
        2 years ago

        Edit: I understand it now. That first line is just a really weird way to define a function.

  • nothacking@discuss.tchncs.de
    link
    fedilink
    arrow-up
    10
    ·
    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.

  • 🔻Sleepless One🔻@lemmygrad.ml
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 years ago

    I took a test once where one of the questions was to solve the tower of hanoi with 2 pegs and 3 disks.

    • learningduck@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      2 years ago

      How is that possible? is it has a different rule?

      • 🔻Sleepless One🔻@lemmygrad.ml
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 years ago

        No, it was a trick question. The test taker was supposed to pick up on that.

    • jackie_jormp_jomp@lemm.ee
      link
      fedilink
      arrow-up
      0
      ·
      2 years ago

      That’s just unfair

      • 🔻Sleepless One🔻@lemmygrad.ml
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 years ago

        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.

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

    Example for stack

  • stingpie@lemmy.world
    link
    fedilink
    arrow-up
    2
    arrow-down
    3
    ·
    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.

  • 561 users / day
  • 900 users / week
  • 7.9K users / month
  • 19.3K users / 6 months
  • 2 local subscribers
  • 24.7K subscribers
  • 1.54K Posts
  • 55.2K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.12
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org