diff --git a/a3/program.exe b/a3/program.exe new file mode 100644 index 0000000..e69de29 diff --git a/cv8/program.c b/cv8/program.c index 3a2cbcd..f9e9adc 100644 --- a/cv8/program.c +++ b/cv8/program.c @@ -41,6 +41,10 @@ struct tree* read_tree(){ return node; } int main(){ + printf("Expert z bufetu to vie.\n"); + printf("Pozna 2 druhov ovocia a zeleniny.\n"); + printf("Odpovedajte␣'a'␣pre␣prvu␣moznost␣alebo␣'n'␣pre␣druhu␣moznost.\n"); + printf("Je to ovocie alebo zelenina ?\n"); /*int counter = 0; int si = 0; struct tree* stack[SIZE]; diff --git a/cv8/program.exe b/cv8/program.exe new file mode 100644 index 0000000..2acd088 Binary files /dev/null and b/cv8/program.exe differ diff --git a/sk4/program.c b/sk4/program.c new file mode 100644 index 0000000..2f53ec5 --- /dev/null +++ b/sk4/program.c @@ -0,0 +1,47 @@ +#include +#include +#include + +unsigned char tape[30000] = {0}; +unsigned char* ptr = tape; + +void interpret(char* input) { + char current_char; + size_t i; + size_t loop; + size a; + for (i = 0; input[i] != 0; i++) { + current_char = input[i]; + if (current_char == 'TUK') {// + ++ptr; + } else if (current_char == 'FUK') {// + --ptr; + } else if (current_char == 'INK') {//+ + ++*ptr; + } else if (current_char == 'DEK') {//- + --*ptr; + } else if (current_char == 'PUK' ) {//. + putchar(*ptr); + } else if (current_char == 'KUK') {//, + *ptr = getchar(); + } else if (current_char == '[') {// + continue; + } else if (current_char == ']' && *ptr) {// + loop = 1; + while (loop > 0) { + current_char = input[--i]; + if (current_char == '[') { + loop--; + } else if (current_char == ']') { + loop++; + } + } + } + } +} + + +int main() { + interpret(",[.[-],]"); // outputs input + return 0; +} \ No newline at end of file diff --git a/sk4/program.exe b/sk4/program.exe new file mode 100644 index 0000000..47aa69b Binary files /dev/null and b/sk4/program.exe differ diff --git a/sk4/readme.MD b/sk4/readme.MD new file mode 100644 index 0000000..db20947 --- /dev/null +++ b/sk4/readme.MD @@ -0,0 +1,2 @@ +Riesenie inspirovane https://gist.github.com/maxcountryman/1699708 +