This commit is contained in:
Radovan Kofira 2021-01-09 21:03:10 +01:00
parent 2089ceee18
commit 8889c13d26
4 changed files with 26 additions and 18 deletions

15
sk4/Meno.txt Normal file
View File

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

View File

@ -1,15 +1,3 @@
TUK 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 KUK [ DEK BREK INK BREK INK GLEK GLEK ] BREK BREK [ GLEK PUK BREK DEK ]
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 FUK

View File

@ -4,8 +4,8 @@
#include <stdbool.h> #include <stdbool.h>
typedef enum { typedef enum {
INK, DEK, INK, DEK,//Enum je pouzity ,
BREK, GLEK, BREK, GLEK,//polia 2 rozmerne atd
PUK, KUK, PUK, KUK,
LP, RP, LP, RP,
TUK, FUK TUK, FUK
@ -16,10 +16,11 @@ inst ptape[30000] = {0};//hlava ph
size_t validRP[15000]={0}; size_t validRP[15000]={0};
inst* loops[2][15000] = {{0},{0}};//adresy zatvoriek inst* loops[2][15000] = {{0},{0}};//adresy zatvoriek
size_t loopscount=0; size_t loopscount=0;//v globalnych premennych su ulozene udaje z pasky
char* dhead = dtape; char* dhead = dtape;//smerniky
inst* phead = ptape; inst* phead = ptape;
void run_tukafuk(const char* code) { void run_tukafuk(const char* code) {
char current_char; char current_char;
bool running = false; bool running = false;
@ -134,9 +135,12 @@ void run_tukafuk(const char* code) {
if(running){ if(running){
switch(*phead){ switch(*phead){
case INK: case INK:
//printf("Ink..%c",*dhead);
(*dhead)++; (*dhead)++;
//printf("->%c\n",*dhead);
break; break;
case DEK: case DEK:
//printf("Dek..%c",*dhead);
(*dhead)--; (*dhead)--;
//printf("->%c\n",*dhead); //printf("->%c\n",*dhead);
break; break;
@ -154,6 +158,7 @@ void run_tukafuk(const char* code) {
case KUK: case KUK:
printf("Zadaj vstup:\n"); printf("Zadaj vstup:\n");
*dhead=getchar(); *dhead=getchar();
while(getchar()!='\n'){}
//printf("Kukol %c\n",*dhead); //printf("Kukol %c\n",*dhead);
break; break;
case FUK: case FUK:

Binary file not shown.