Ḹḗṃɯӳ
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@lemmy.zip to Programmer Humor@programming.dev · 2 months ago

More code = more better

lemmy.zip

message-square
81
link
fedilink
622

More code = more better

lemmy.zip

cm0002@lemmy.zip to Programmer Humor@programming.dev · 2 months ago
message-square
81
link
fedilink
  • Grandwolf319@sh.itjust.works
    link
    fedilink
    arrow-up
    26
    ·
    2 months ago

    How about

    x=x-x

    x++

    x++

    x++

    x++

    x++

    x++

    x++

    x++

    x++

    x++

    • okmko@lemmy.world
      link
      fedilink
      arrow-up
      8
      ·
      2 months ago

      Freshman year of college doing assembly programming, I spent a while figuring out a “programmic” way to solve a problem, trying to wrangle labels and gotos. My friend came in with essentially this but as lookup table. It blew my mind.

      It was then that I learned to trade space for complexity.

    • xthexder@l.sw0.com
      link
      fedilink
      arrow-up
      7
      ·
      2 months ago

      This is actually a valid brainf*ck program, but it results in 19, not 10.

      • Grandwolf319@sh.itjust.works
        link
        fedilink
        arrow-up
        5
        ·
        2 months ago

        How so? It’s only 10 increments

        • juliebean@lemmy.zip
          link
          fedilink
          arrow-up
          2
          ·
          2 months ago

          it’s been a long time since i looked at brainfuck, but i suspect that ‘+’ denotes an increment, and ‘-’ denotes a decrement, so we’ve got one decrement and 20 increments.

    • olenkoVD@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      1
      ·
      2 months ago

      Make sure you initialize x with x=x/x-x/x for better precision

      • Grandwolf319@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        2 months ago

        What if it’s already 0?

        • optional@sh.itjust.works
          link
          fedilink
          arrow-up
          1
          ·
          2 months ago

          Just add // @TODO find out why this crashes our application sometimes to fix that issue

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.18K users / day
  • 4.23K users / week
  • 8.48K users / month
  • 18.2K users / 6 months
  • 1 local subscriber
  • 29.3K subscribers
  • 2.01K Posts
  • 72.3K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.15
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org