rfk-c/everything else/scantest.c
2022-05-05 08:43:42 -06:00

102 lines
2.7 KiB
C

#include <stdio.h>
#include <stdlib.h>
//#include <windows.h>
int main() {
int textline = 0;
int textchar = 0;
char text[512][127];
char textstore[512];
int *textp; textp = &textstore;
FILE *texts;
texts = fopen("texts.rfk", "r");
if (texts == NULL) {
exit(1);
} else {
textp = fgets(textp, (512 * 128), texts);
}
for (int i = 0; i < (512 * 128); i++) {
if (textstore[i] == '\0') {
break;
} else {
printf("%c", textstore[i]);
}
}
printf("\n---------------------------------------\n");
/*for (int i = 0; i < (512 * 128); i++) {
if (textstore[i] == '\0') {
break;
} else if (textstore[i] == ';') {
text[textline][textchar] = '\0';
textline++;
textchar = 0;
} else {
text[textline][textchar] = textstore[i];
//textline++;
textchar++;
}
printf("%d %d ", textchar, textline);
}
printf("\n---------------------------------------\n");
for (int i = 0; i < 32; i++) {
for (int j = 0; j < 127; j++) {
printf("%c",text[i][j]);
}
printf("\n");
}
printf("\n---------------------------------------\n");
/*for (int balls = 0; balls < 3; balls++) {
for (int i = 0; i < (512 * 128); i++) {
if (textstore[i] != ';') {
//textstore[i] = '\0';
textstore[i - 1] = textstore[i];
} else {
break;
}
}
}*/
/*//for (int i = 0; i < (512 * 128); i++) {
int deadcount = 0;
for (int j = 0; j < (512 * 128); j++) {
if (deadcount) {
break;
} else {
if (textstore[i] != ';') {
textstore[i] = '\0';
} else {
break;
}
}
}
for (int j = 0; j < 127; j++) {
if (textstore[i] != ';') {
printf("%c",textstore[i]);
} else {
break;
}
}
//}*/
int deadcount = 0;
for (int i = 0; i < (512 * 128); i++) {
if (textstore[i] == ';') {
textstore[i] = '\0';
deadcount = deadcount + 1;
//break;
} else {
textstore[i] = '\0';
}
//printf("%d, %d ",deadcount, i);
if (deadcount == 32) {
for (int j = 0; j < 127; j++) {
if (textstore[j] == ';') {
break;
}
if (textstore[j] != '\0') {
printf("%c",textstore[j]);
}
}
break;
}
}
}