BrainFuck
Off topic → Programming → BrainFuck
I am making some shiz in Brainfuck http://fatiherikli.github.io/brainfuck-visualizer/ Thats the interpreter i use. This is just to print A. FUCKING A.
+++++ + Setup counter (add 6 to cell #0)
[
> +++++ +++++ Go to Cell #1 and add 10 to cell #1
< - Go to Cell #0 and subtract 1 from cell #0 (Effectively multiplying 6 by 10)
]
> +++++ . Go to Cell #1 and add 5 to cell #1 and output a character (A)
Here i am going to print Redstoner
By Ralp:
+++++ +++++ initialize counter (cell #0) to 10
[ use loop to set 80/100/30/10
> +++++ +++ add 8 to cell #1
> +++++ +++++ add 10 to cell #2
> +++ add 3 to cell #3
> + add 1 to cell #4
<<<< - decrement counter (cell #0)
]
> ++ . print 'R'
> + . print 'e'
- . print 'd'
+++++ +++++ +++++ . print 's'
+ . print 't'
----- . print 'o'
- . print 'n'
----- ---- . print 'e'
+++++ +++++ +++ . print 'r'
> +++ . print '!'
> . print '\n'
Redstoner:
+++++ +++++ initialize counter (cell #0) to 10
[ use loop to set 80/100/30/10
> +++++ +++ add 8 to cell #1
> +++++ +++++ add 10 to cell #2
> +++ add 3 to cell #3
> + add 1 to cell #4
<<<< - decrement counter (cell #0)
]
> ++ . print 'R'
> + . print 'e'
- . print 'd'
+++++ +++++ +++++ . print 's'
+ . print 't'
----- . print 'o'
- . print 'n'
----- ---- . print 'e'
+++++ +++++ +++ . print 'r'
> +++ . print '!'
> . print '\n'
Ralp
it is 3 `
And this is what you need to add two, two digit numbers together. JUST TWO DIGITS!!
,------------------------------------------------>
,------------------------------------------------>
,------------------------------------------------>
,------------------------------------------------
<<[->>>+>+<<<<]>>>>[-<<<<+>>>>]<<[-<<+>>>+<]>
[-[-[-[-[-[-[-[-[-[<<<<+>---------->>>[-]]]]]]]]]]][-]
<<<<[->>>+>+<<<<]>>>>[-<<<<+>>>>]<<[-<<+>>>+<]>
[-[-[-[-[-[-[-[-[-[>+<<<<---------->>>[-]]]]]]]]]]][-]
>++++++++++++++++++++++++++++++++++++++++++++++++.
<<<<++++++++++++++++++++++++++++++++++++++++++++++++.
>++++++++++++++++++++++++++++++++++++++++++++++++.
JUST TWO!!!
Ralp