From 8889c13d26478be757ceb8fb019735a61ad2f3d9 Mon Sep 17 00:00:00 2001 From: Radovan Kofira Date: Sat, 9 Jan 2021 21:03:10 +0100 Subject: [PATCH] hotovo --- sk4/Meno.txt | 15 +++++++++++++++ sk4/kod.txt | 14 +------------- sk4/program.c | 15 ++++++++++----- sk4/program.exe | Bin 47522 -> 47522 bytes 4 files changed, 26 insertions(+), 18 deletions(-) create mode 100644 sk4/Meno.txt 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 e0caf47aaf1e11aa0e02d80c0fe04cea45b6b658..84605f0585ce663940948fc328df49b7fec9e8ef 100644 GIT binary patch delta 2556 zcmbtWdr(wW7(eH77ghyXT<`^mxeJ7dpt6z=bXDNW(g`1;lW7)R_=;C0Rt- z^~ zc(oiKP90eJ2pR>4_yzPb+~?!{98+CZG!o}ENR&+vEl0$3TDtPxLrEIo&of3gSY-36 ze`kz7-l_B@#IDe3iJ4bBQv%UmfKlxE=44XaZA^1EB5!L@AR{Q8(?_7wrEAXZe#on0 z7Gh3P%k88F&6uX0XB`yUJfntoTa#U^HdF(hw>*joCt52DaaWT*%TyFl7fl>Wn4w!s4 z(Ho+-T*g<|<5bpE-6sB<_1Lq^by_UKbZ3bFmiai|%GVx8FR9ngqrv}Uh3P1*Q(TE; zR5$VmLxS9hshhSj%M~vV;_OGR<81eP5&zG-StS)Q(S%(20S&mCNf^nQgMf1*Hs+%) zZk@v7ti++|&QRkm*ynq7)(WZw$lD2MEXP^hmgGZf1m<2g?%u>?-L($xv#iqWDTQXlP zh%*j%Mu|&?|H?<|lC{KiPclT+{%8o;W{4mbDX`fEUZuvH7>$HsG#e~a22-85UU?`y z?CMvNWO;l^cxh3EU91n;GunZl87R+3kO5-A3%zv5Y@HVwPhjzEb9K*XEg3sTOG@!R zjQvVdT2VCFu+D%A4@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