-
Notifications
You must be signed in to change notification settings - Fork 0
/
unobf.h
35 lines (35 loc) · 1.32 KB
/
unobf.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <stdlib.h>
#include <stdio.h>
#define BRAINF(c) { \
char *p, *b, *u, *i; \
p = b = calloc(30000, 1); \
u = i = c; \
while(*i) { \
int m = 0; \
if(*i == '>') p++; \
if(*i == '<') p--; \
if(*i == '+') ++*p; \
if(*i == '-') --*p; \
if(*i == '.') putchar(*p); \
if(*i == ',') *p = getchar(); \
if(*i == '[' && !*p) { \
while(*(++i) != 0) { \
if(*i == '[') m++; \
if(*i == ']' && !m--) \
break; \
} \
if(!*i) goto end; \
} \
if(*i == ']' && *p) { \
while(--i != u-1) { \
if(*i == ']') m++; \
if(*i == '[' && !m--) \
break; \
} \
if(i == u-1) goto end; \
} \
i++; \
} \
end: \
free(b); \
}