Basically, I'm loading up a 12 X 16 array of 0's, 1's and 2's from a text file. I want to assign each of those to a spot in the array.
This is what the text file looks like:
Code:
1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1
1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1
1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1
1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1
1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1
1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1
1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1
1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1
1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1
1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1
1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1
1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1
This is my code so far to cycle through the array:
Code:
#include <fstream.h>
char map[12][16];
void main()
{
ofstream file("test.txt");
for(int y=0,y<13,y++)
{
for(int x=0,x<17,x++)
{
map[y][x]=
}
}
file.close();
}