Mercurial > repo
changeset 7603:bf18a0e0bae5
<Moon_> revert
author | HackBot |
---|---|
date | Fri, 29 Apr 2016 00:12:47 +0000 |
parents | c340aa00c2aa |
children | 3ddb3ea01af1 |
files | Something.c wGAUV3ER |
diffstat | 2 files changed, 54 insertions(+), 54 deletions(-) [+] |
line wrap: on
line diff
--- a/Something.c Fri Apr 29 00:11:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -#include <stdio.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - - -// initialize the tape with 30,000 zeroes -unsigned long long int tape[30000] = {0}; -unsigned long long int registrar[3] = {0}; // R1, R2, and R3 -// set the pointer to point at the left-most cell of the tape -unsigned long long int* ptr = tape; - - - -void interpret(char* input) { - char current_char; - size_t i; - size_t i2; - size_t i3; - size_t loop; - int i4; - time_t t; - srand((unsigned) time(&t)); - for (i = 0; input[i] != 0; i++) { - current_char = input[i]; - - i4 = rand() % 7; - if (i4 == 0) { - ++ptr; - } else if (i4 == 1) { - --ptr; - } else if (i4 == 2) { - ++*ptr; - } else if (i4 == 3) { - --*ptr; - } else if (i4 == 4) { - putchar(*ptr); - } else if (i4 == 5) { - - *ptr = getchar(); - - } else if (i4 == 6) { - continue; - } - // More commands to come, the CIOL specs are not done - } -} - - -int main( int argc, char *argv[] ) { - - interpret(argv[1]); // outputs input - return 0; -} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wGAUV3ER Fri Apr 29 00:12:47 2016 +0000 @@ -0,0 +1,54 @@ +#include <stdio.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + + +// initialize the tape with 30,000 zeroes +unsigned long long int tape[30000] = {0}; +unsigned long long int registrar[3] = {0}; // R1, R2, and R3 +// set the pointer to point at the left-most cell of the tape +unsigned long long int* ptr = tape; + + + +void interpret(char* input) { + char current_char; + size_t i; + size_t i2; + size_t i3; + size_t loop; + int i4; + time_t t; + srand((unsigned) time(&t)); + for (i = 0; input[i] != 0; i++) { + current_char = input[i]; + + i4 = rand() % 7; + if (i4 == 0) { + ++ptr; + } else if (i4 == 1) { + --ptr; + } else if (i4 == 2) { + ++*ptr; + } else if (i4 == 3) { + --*ptr; + } else if (i4 == 4) { + putchar(*ptr); + } else if (i4 == 5) { + + *ptr = getchar(); + + } else if (i4 == 6) { + continue; + } + // More commands to come, the CIOL specs are not done + } +} + + +int main( int argc, char *argv[] ) { + + interpret(argv[1]); // outputs input + return 0; +} \ No newline at end of file