you are viewing a single comment's thread
view the rest of the comments
[–] 24 points 11 months ago (8 children)

How about

x=x-x

x++

x++

x++

x++

x++

x++

x++

x++

x++

x++

  • source
  • hideshow 8 child comments
  • [–] 8 points 11 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.

  • source
  • parent
  • [–] 6 points 11 months ago (3 children)

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

  • source
  • parent
  • hideshow 3 child comments
  • [–] 6 points 11 months ago (2 children)

    How so? It’s only 10 increments

  • source
  • parent
  • hideshow 2 child comments
  • [–] 4 points 11 months ago

    Because the only brainfuck instructions in your comment where a - which decrements and 20 +, each of which increments.
    Mine echos the first two characters from stdin, because of the commas and dots.

  • source
  • parent
  • [–] 1 point 11 months ago (2 children)

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

  • source
  • parent
  • hideshow 2 child comments