Archived

This topic is now archived and is closed to further replies.

cohen1

Another error

Recommended Posts

Here is what the code should look like:

        
#include <iostream.h>

void main()
{
unsigned char map[10][10]=
{ {1,1,1,1,1,1,1,1,1,2},
{1,0,0,0,0,0,0,0,1,2},
{1,0,0,0,0,0,0,0,1,2},
{1,0,0,0,0,0,0,0,1,2},
{1,0,0,0,0,0,0,0,1,2},
{1,0,0,0,0,0,0,0,1,2},
{1,0,0,0,0,0,0,0,1,2},
{1,0,0,0,0,0,0,0,1,2},
{1,0,0,0,0,0,0,0,1,2},
{1,1,1,1,1,1,1,1,1,2}
};

for (int scx=0; scx<10; scx++)
{
for (int scy=0; scy<10; scy++)
{
if (map[scy][scx] == 0)
cout << " ";
if (map[scy][scx] == 1)
cout << "1";
if (map[scy][scx] == 2)
cout << endl;
}
}
}


This should work fine!

-------------------------------
That's just my 200 bucks' worth!

..-=gLaDiAtOr=-..

Edited by - Gladiator on July 24, 2000 12:54:33 PM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Gladiator

if (map[scx][scy] == 0)



you probably want to have it be map[scy][scx] too, to get your desired coordinates. But that all depends on your mapping preference.

Lep

Share this post


Link to post
Share on other sites