Skip to content

Instantly share code, notes, and snippets.

@eigenpaul
Forked from lifthrasiir/bf.c
Created February 15, 2023 22:37
Show Gist options
  • Select an option

  • Save eigenpaul/918e4f42d7b6acd2a70dbc1704413e08 to your computer and use it in GitHub Desktop.

Select an option

Save eigenpaul/918e4f42d7b6acd2a70dbc1704413e08 to your computer and use it in GitHub Desktop.

Revisions

  1. @lifthrasiir lifthrasiir created this gist Sep 25, 2010.
    4 changes: 4 additions & 0 deletions bf.c
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    /* The world's smallest Brainfuck interpreter in C, by Kang Seonghoon
    * http://j.mearie.org/post/1181041789/brainfuck-interpreter-in-2-lines-of-c */
    s[99],*r=s,*d,c;main(a,b){char*v=1[d=b];for(;c=*v++%93;)for(b=c&2,b=c%7?a&&(c&17
    ?c&1?(*r+=b-1):(r+=b-1):syscall(4-!b,b,r,1),0):v;b&&c|a**r;v=d)main(!c,&a);d=v;}