diff --git a/sk4/Meno.txt b/sk4/Meno.txt new file mode 100644 index 0000000..79e3bae --- /dev/null +++ b/sk4/Meno.txt @@ -0,0 +1,15 @@ +TUK +INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK PUK +INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK PUK +INK INK INK PUK +INK INK INK INK INK INK INK INK INK INK INK PUK +BREK +INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK PUK +GLEK +DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK PUK +INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK PUK +DEK DEK DEK DEK DEK DEK DEK DEK DEK PUK 102 +INK INK INK PUK 105 +INK INK INK INK INK INK INK INK INK PUK 114 +DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK PUK 97 +FUK \ No newline at end of file diff --git a/sk4/kod.txt b/sk4/kod.txt index 79e3bae..c968562 100644 --- a/sk4/kod.txt +++ b/sk4/kod.txt @@ -1,15 +1,3 @@ TUK -INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK PUK -INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK PUK -INK INK INK PUK -INK INK INK INK INK INK INK INK INK INK INK PUK -BREK -INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK PUK -GLEK -DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK PUK -INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK INK PUK -DEK DEK DEK DEK DEK DEK DEK DEK DEK PUK 102 -INK INK INK PUK 105 -INK INK INK INK INK INK INK INK INK PUK 114 -DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK DEK PUK 97 +KUK [ DEK BREK INK BREK INK GLEK GLEK ] BREK BREK [ GLEK PUK BREK DEK ] FUK \ No newline at end of file diff --git a/sk4/program.c b/sk4/program.c index fcb748b..0f7de35 100644 --- a/sk4/program.c +++ b/sk4/program.c @@ -4,8 +4,8 @@ #include typedef enum { -INK, DEK, -BREK, GLEK, +INK, DEK,//Enum je pouzity , +BREK, GLEK,//polia 2 rozmerne atd PUK, KUK, LP, RP, TUK, FUK @@ -16,10 +16,11 @@ inst ptape[30000] = {0};//hlava ph size_t validRP[15000]={0}; inst* loops[2][15000] = {{0},{0}};//adresy zatvoriek -size_t loopscount=0; -char* dhead = dtape; +size_t loopscount=0;//v globalnych premennych su ulozene udaje z pasky +char* dhead = dtape;//smerniky inst* phead = ptape; + void run_tukafuk(const char* code) { char current_char; bool running = false; @@ -134,9 +135,12 @@ void run_tukafuk(const char* code) { if(running){ switch(*phead){ case INK: + //printf("Ink..%c",*dhead); (*dhead)++; + //printf("->%c\n",*dhead); break; case DEK: + //printf("Dek..%c",*dhead); (*dhead)--; //printf("->%c\n",*dhead); break; @@ -152,8 +156,9 @@ void run_tukafuk(const char* code) { //printf("\nPukEnd\n"); break; case KUK: - printf("Zadaj vstup: \n"); + printf("Zadaj vstup:\n"); *dhead=getchar(); + while(getchar()!='\n'){} //printf("Kukol %c\n",*dhead); break; case FUK: diff --git a/sk4/program.exe b/sk4/program.exe index e0caf47..84605f0 100644 Binary files a/sk4/program.exe and b/sk4/program.exe differ