1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
union scenenames
{
char names20[20];
char names19[19];
char names18[18];
char names17[17];
char names16[16];
char names15[15];
char names14[14];
char names13[13];
char names12[12];
char names11[11];
char names10[10];
char names9[9];
char names8[8];
};
struct scene
{
int objectsy[25][25];
};
struct scene reader(struct scene direct, char filen[], int length, int height)
{
int tab0;
int tab1;
int position = 1;
int data0;
int data1;
for(tab1 = 0;tab1 < height;tab1++)
{
for(tab0 = 0;tab0 < length;tab0++)
{
data0 = readfile(filen, position); //Reads specified character in specified file
switch(data0)
{
case(10):
tab0--;
break;
default:
direct.objectsy[tab1][tab0] = data0;
}
position++;
}
}
return direct;
}
int main()
{
union scenenames naming;
struct scene cmdintro;
naming.names13 = 'c','m','d','i','n','t','r','o','.','t','x','t','\0';
cmdintro = reader(cmdintro, naming.names13, 20, 12);
return 0;
}
|