-
-
Save juananpe/df4f9ff488aefe2fc1b05ff508216ef4 to your computer and use it in GitHub Desktop.
BrainFuck.c , level 1 de la EE 27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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