Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Brainfuck
for(b=[],o='',i=c=l=0;u=s[i++];)l<0?u==']'&&l++:(b.push(0),u=='['?(l=b[c]?i-1:-1):u==']'?i=l:u=='.'?o+=b[c]:u=='+'?++b[c]:u=='-'?--b[c]:u=='>'?++c:u=='<'?--c:o)
@neizod

This comment has been minimized.

Copy link

neizod commented Oct 5, 2011

wow!

@Reinmar

This comment has been minimized.

Copy link
Owner Author

Reinmar commented Oct 5, 2011

hehe ;> i had to think for a while before i recalled what that was :D

@neizod

This comment has been minimized.

Copy link

neizod commented Oct 5, 2011

if you can save some more 30 bytes, may be this will be the coolest code on 140byt.es!!

@Reinmar

This comment has been minimized.

Copy link
Owner Author

Reinmar commented Oct 5, 2011

30 bytes is impossible - i tried and i'm nearly sure about that. But I wrote version without loops:

for(b=[],o='',i=c=0;u=s[i];)b[i++]=0,u=='.'?o+=b[c]:u=='+'?++b[c]:u=='-'?--b[c]:u=='>'?++c:u=='<'?--c:o

103 chars

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.