This commit is contained in:
Radovan Kofira 2021-01-08 18:37:10 +01:00
parent bcd0e38ddf
commit 44522e6917
6 changed files with 53 additions and 0 deletions

0
a3/program.exe Normal file
View File

View File

@ -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];

BIN
cv8/program.exe Normal file

Binary file not shown.

47
sk4/program.c Normal file
View File

@ -0,0 +1,47 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
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;
}

BIN
sk4/program.exe Normal file

Binary file not shown.

2
sk4/readme.MD Normal file
View File

@ -0,0 +1,2 @@
Riesenie inspirovane https://gist.github.com/maxcountryman/1699708