Skip to content

Instantly share code, notes, and snippets.

@juananpe juananpe/bf.c Secret
Created Jul 29, 2019

Embed
What would you like to do?
BrainFuck.c , level 1 de la EE 27
/* This is a translation of bf, generated by bftoc.py (by Paul Kaefer)
* It was generated on Saturday, July 27, 2019 at 12:26AM
*/
#include <stdio.h>
void main(void)
{
int size = 1000;
int tape[size];
int i = 0;
/* Clearing the tape (array) */
for (i=0; i<size; i++)
tape[i] = 0;
int ptr = 0;
ptr += 1;
tape[ptr] = getchar();
tape[ptr] -= 84;
while (tape[ptr] != 0)
{
ptr -= 1;
tape[ptr] += 1;
ptr += 1;
while (tape[ptr] != 0)
{
tape[ptr] -= 1;
}
}
tape[ptr] = getchar();
tape[ptr] -= 52;
while (tape[ptr] != 0)
{
ptr -= 1;
tape[ptr] += 1;
ptr += 1;
while (tape[ptr] != 0)
{
tape[ptr] -= 1;
}
}
tape[ptr] = getchar();
tape[ptr] -= 114;
while (tape[ptr] != 0)
{
ptr -= 1;
tape[ptr] += 1;
ptr += 1;
while (tape[ptr] != 0)
{
tape[ptr] -= 1;
}
}
tape[ptr] = getchar();
tape[ptr] -= 112;
while (tape[ptr] != 0)
{
ptr -= 1;
tape[ptr] += 1;
ptr += 1;
while (tape[ptr] != 0)
{
tape[ptr] -= 1;
}
}
tape[ptr] = getchar();
tape[ptr] -= 49;
while (tape[ptr] != 0)
{
ptr -= 1;
tape[ptr] += 1;
ptr += 1;
while (tape[ptr] != 0)
{
tape[ptr] -= 1;
}
}
tape[ptr] = getchar();
tape[ptr] -= 116;
while (tape[ptr] != 0)
{
ptr -= 1;
tape[ptr] += 1;
ptr += 1;
while (tape[ptr] != 0)
{
tape[ptr] -= 1;
}
}
tape[ptr] = getchar();
tape[ptr] -= 83;
while (tape[ptr] != 0)
{
ptr -= 1;
tape[ptr] += 1;
ptr += 1;
while (tape[ptr] != 0)
{
tape[ptr] -= 1;
}
}
tape[ptr] = getchar();
tape[ptr] -= 67;
while (tape[ptr] != 0)
{
ptr -= 1;
tape[ptr] += 1;
ptr += 1;
while (tape[ptr] != 0)
{
tape[ptr] -= 1;
}
}
tape[ptr] = getchar();
tape[ptr] -= 114;
while (tape[ptr] != 0)
{
ptr -= 1;
tape[ptr] += 1;
ptr += 1;
while (tape[ptr] != 0)
{
tape[ptr] -= 1;
}
}
tape[ptr] = getchar();
tape[ptr] -= 49;
while (tape[ptr] != 0)
{
ptr -= 1;
tape[ptr] += 1;
ptr += 1;
while (tape[ptr] != 0)
{
tape[ptr] -= 1;
}
}
tape[ptr] = getchar();
tape[ptr] -= 112;
while (tape[ptr] != 0)
{
ptr -= 1;
tape[ptr] += 1;
ptr += 1;
while (tape[ptr] != 0)
{
tape[ptr] -= 1;
}
}
tape[ptr] = getchar();
tape[ptr] -= 84;
while (tape[ptr] != 0)
{
ptr -= 1;
tape[ptr] += 1;
ptr += 1;
while (tape[ptr] != 0)
{
tape[ptr] -= 1;
}
}
tape[ptr] = getchar();
while (tape[ptr] != 0)
{
ptr -= 1;
tape[ptr] += 1;
ptr += 1;
while (tape[ptr] != 0)
{
tape[ptr] -= 1;
}
}
while (tape[ptr] != 0)
{
tape[ptr] -= 1;
}
tape[ptr] += 1;
ptr -= 1;
while (tape[ptr] != 0)
{
ptr += 3;
tape[ptr] += 2;
while (tape[ptr] != 0)
{
ptr += 1;
tape[ptr] += 3;
while (tape[ptr] != 0)
{
ptr += 1;
tape[ptr] += 19;
ptr -= 1;
tape[ptr] -= 1;
}
ptr -= 1;
tape[ptr] -= 1;
}
ptr += 2;
printf("%c",tape[ptr]);
tape[ptr] -= 13;
printf("%c",tape[ptr]);
tape[ptr] -= 1;
printf("%c",tape[ptr]);
ptr -= 4;
while (tape[ptr] != 0)
{
tape[ptr] -= 1;
}
ptr -= 1;
while (tape[ptr] != 0)
{
tape[ptr] -= 1;
}
}
ptr += 1;
while (tape[ptr] != 0)
{
ptr += 3;
tape[ptr] += 2;
while (tape[ptr] != 0)
{
ptr += 1;
tape[ptr] += 3;
while (tape[ptr] != 0)
{
ptr += 1;
tape[ptr] += 17;
ptr -= 1;
tape[ptr] -= 1;
}
ptr -= 1;
tape[ptr] -= 1;
}
ptr += 2;
tape[ptr] += 1;
printf("%c",tape[ptr]);
while (tape[ptr] != 0)
{
ptr += 1;
tape[ptr] += 1;
ptr += 1;
tape[ptr] += 1;
ptr -= 2;
tape[ptr] -= 1;
}
ptr += 1;
tape[ptr] += 11;
printf("%c",tape[ptr]);
ptr += 1;
tape[ptr] -= 2;
printf("%c",tape[ptr]);
printf("%c",tape[ptr]);
ptr -= 1;
tape[ptr] -= 4;
printf("%c",tape[ptr]);
ptr -= 3;
while (tape[ptr] != 0)
{
tape[ptr] -= 1;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.