I am trying to create a 2 dimation array for a game...
The table will look like that!!!
**0 1 2 3 4 5 6 7 **
**0|0 0 0 0 9 0 0 0 **
**1|0 0 0 0 0 0 0 0 **
**2|9 0 9 0 0 0 9 0 **
**3|0 0 0 0 0 0 0 0 **
**4|0 9 0 9 0 0 0 0 **
**5|0 9 0 0 9 0 9 0 **
**6|0 0 0 0 0 0 0 0 **
**7|0 0 0 0 0 0 9 0 **
Below it's my code my serioue problem is that it's prints 7 rows insted of 8 and
it's set the number '9' only into the first row, besiclly it's ingnore the other rows
... Any help appritiate..!!
Thank you in advance!!!
int main(){
int counter2 = 0;
int counter3 =0;
int board[8][8];
cout<<""<<endl;
cout<<" 0 1 2 3 4 5 6 7 "<<endl;
cout<<" - - - - - - - - "<<endl;
for(int x=0;x<7;x++){
if(x==0)
cout<<counter2++<<"|0 0 0 0 9 0 0 0";
else
if (x==1 || x == 3 || x== 6)
cout<<counter2++<<"|0 0 0 0 0 0 0 0";
else
for(int y=0;y<8;y++){
if(y==0 )
cout<<counter2++<<"|0 0 0 0 0 0 0 0";
if(board[x][y] == 0 )
cout<<setw(1);
}
cout <<endl;
}
return 0;
}