Skip to content

Instantly share code, notes, and snippets.

@leomastoras
Created April 14, 2024 09:46
Show Gist options
  • Save leomastoras/eb5a482af4a68a53b3fc48cb766028d4 to your computer and use it in GitHub Desktop.
Save leomastoras/eb5a482af4a68a53b3fc48cb766028d4 to your computer and use it in GitHub Desktop.
shortest (140 bytes) BF interpreter with whitespace
// shortest BF interpreter with whitespace:
s[999], *r=s, *d, c;
main(a, b)
{
char *v=1[d=b];
for(;c = *v++ % 93;)
for(b = c%7 ?
a &&
(c & 17 ?
c & 1 ?
(*r -= c - 44)
:(r += c - 61)
:c & 2 ?
putchar(*r)
:(*r = getchar())
,0)
:v;
b&&c | a * *r;
v=d)
main(!c,&b-1);
d = v;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment