• CanadaPlus@lemmy.sdf.org
    link
    fedilink
    arrow-up
    6
    ·
    edit-2
    15 hours ago

    An actual compsci professor would know real CPUs don’t run arbitrary recursion, right? Nobody could possibly be that siloed.

    • Redkey@programming.dev
      link
      fedilink
      arrow-up
      3
      ·
      5 hours ago

      Could someone expand a little on this statement, or point me toward an applicable resource? How do “real” (modern?) CPUs prevent unwanted recursion? As in, not the compiler or the OS, but the CPU itself? I’ve been searching for a while now but I haven’t found anything that clears this up for me.

  • Fiery@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    10
    ·
    edit-2
    14 hours ago

    I did it the other way around in uni, we got a task with no mention of it requiring recursion (even though I suppose it was somewhat well suited to it). I solved it with a double for loop and the teacher refused to accept my submission.

    This was a coding class on Unix thinclients, I’ll let you guess how long ago.

    Answer

    3 years

    edit: thx sleeplessone@lemmy.ml for making the spoiler work :)

    • Sleepless One@lemmy.ml
      link
      fedilink
      English
      arrow-up
      10
      arrow-down
      1
      ·
      16 hours ago

      The spoiler syntax is a bit different.

      :::spoiler <label>
      <body>
      :::
      

      For example:

      Answer

      3 years