Usinb a matrix in windows...

How can I make and use a 50x50 matrix in windows 98? I tried doing it this way, but it doesn't seem to work.



int matrixname[50][50];



int winmain()

{

(i open the level file for reading here)

(it contains just 1s and 0s)

for(x = 0; x <= 49; x++)<br>
{

for(y = 0; y <= 49; y++)<br>
{

fscanf(filename, "%d", &matrixname[x][y]);

}

}

(close the file)

}



I read form the matrix in a similar way, posted below.



if(matrixname[playerx][playery-1] >= 1)

{

draws a wall right in front of you if >= 1

}



But it never does, even if I just make a 3x3 level, all 1s except the middle (2,2) which i set as the start point. Am I doing something wrong here??


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories