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.
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.
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.
How about
x=x-x
x++
x++
x++
x++
x++
x++
x++
x++
x++
x++
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.
This is actually a valid brainf*ck program, but it results in 19, not 10.
How so? It’s only 10 increments
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.
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.