-4

I'm trying to make 2D map but I have problem with setting a color for all elements which value is 'a' is it possible in any way??
^^^

if(map[a][b]=='a')
set color ..... ;  

void map_create(int lenght, int wide,char map[][100])
{

    for(int i=0; i<lenght; i++)
    {
        for(int i2=0; i2<wide-1; i2++)
        {
            if(i2==0)
            {
                map[i][i2]='x';
                continue;
            }
            if(i2%2!=0)
            {
                map[i][i2]=' ';
                continue;
            }
            if((i==0 || i==lenght-1) || (i2==0 || i2==wide-2))
               map[i][i2]='x';
            else
                map[i][i2]=' ';


        }


    }
    map[2][2]='o';
    if(tab[i][i2]=='o')
    {
        int problem_is_here;
    }
drescherjm
  • 10,365
  • 5
  • 44
  • 64

1 Answers1

0

If you are trying to print the 2D map (e.g. to terminal), this may be a duplicate. Reference this question for more information.

cjs
  • 190
  • 3
  • 15