Created
June 14, 2012 10:38
-
-
Save lutoma/2929518 to your computer and use it in GitHub Desktop.
Converts Brainfuck code from stdin to C on stdout (Compile with GCC or similar)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x='char';p,s=(print,{'>':'++p;','<':'--p;','+':'++*p;','-':'--*p;','.':'put'+x+'(*p);',',':'*p=get'+x+'();','[':'for(;*p;){',']':'}'});l=(x+' a[0x'+'f'*4+'];'+x+'*p=a;int main(){',[s[c]for(c)in __import__('os').fdopen(0).read()if(c)in s],'}');[[p(z) for z in i]if type(i)is(list)else p(i)for(i)in l] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment