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

View File

@ -4,8 +4,8 @@
#include <stdbool.h>
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:

Binary file not shown.