/* Brainfuck
*
* http://j...content-available-to-author-only...a.org/wiki/Brainfuck
*/
#include <stdio.h>
#define P5 "+++++"
#define P10 P5 P5
#define P20 P10 P10
#define P50 P20 P20 P10
#define C1 P50 P20 "++."
#define C2 ">" P50 P50 "+."
#define C3 P5 "++.."
#define C4 "+++."
#define Hello C1 C2 C3 C4
#define SP ">" P10 P20 "++."
#define C5 "<<" P10 P5 "."
#define C6 ">."
#define C7 "+++."
#define C8 "<" P20 "+."
#define C9 ">>" P50 P10 P5 "+++."
#define World SP C5 C6 C7 C8 C9
#define HELLO_WORLD "+++++++++[>++++++++>+++++++++++>+++++<<<-]>.>++.+++++++..+++.>-.------------.<++++++++.--------.+++.------.--------.>+."
int main(void) {
char data[30000] = {0};
char code[] = HELLO_WORLD;
char *dp = data;
char *cp = code;
puts("#include <stdio.h>"); puts("int main(void) {"); puts("char data[30000] = {0};"); puts("char *ptr = data;"); while (*cp) {
switch (*cp) {
case '>': printf("ptr++;"); break; case '<': printf("ptr--;"); break; case '+': printf("(*ptr)++;"); break; case '-': printf("(*ptr)--;"); break; case '.': printf("putchar(*ptr);"); break; case ',': printf("*ptr = (char)getchar();"); break; case '[': printf("while (*ptr) {"); break; default: puts("Syntax Error!"); return 0; }
cp++;
}
return 0;
}
LyogQnJhaW5mdWNrCiAqCiAqIGh0dHA6Ly9qLi4uY29udGVudC1hdmFpbGFibGUtdG8tYXV0aG9yLW9ubHkuLi5hLm9yZy93aWtpL0JyYWluZnVjawogKi8KI2luY2x1ZGUgPHN0ZGlvLmg+CgojZGVmaW5lIFA1ICIrKysrKyIKI2RlZmluZSBQMTAgUDUgUDUKI2RlZmluZSBQMjAgUDEwIFAxMAojZGVmaW5lIFA1MCBQMjAgUDIwIFAxMAojZGVmaW5lIEMxIFA1MCBQMjAgIisrLiIKI2RlZmluZSBDMiAiPiIgUDUwIFA1MCAiKy4iCiNkZWZpbmUgQzMgUDUgIisrLi4iCiNkZWZpbmUgQzQgIisrKy4iCiNkZWZpbmUgSG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