chess program help

Hello all
I have some project about chess so I have 2 rooks and I have to mark which part of matrix is marked by rook.

Something like this A1 and B2 are rooks in this case :
http://i.imgur.com/51fGtsn.png

Problem is if I have rooks in the same column (A1,B1) :
http://i.imgur.com/m4oxbcj.png


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
for(i=0;i<8;i++){
    	for(j=0;j<8;j++){
    
			if((board[i][j]==rook1)||(board[i][j]==rook2))
			{
				for(q=0;q<8;q++)
				{
      				for(p=j;p<j+1;p++)
            		{
                    	   board[q][p]="1";
            		}
            		for(q=0;q<8;q++)
					{
      				for(p=i;p<i+1;p++)
            		{
                	       board[q][p]="1";
            		}
		        }   
		}
	}
}
}
Duplicate post:
http://www.cplusplus.com/forum/beginner/97122/

Please don't do that memkara588, it makes different people say the same thing
instead you help me you say about forum rulz . I know but it's urgent for me . sry :(
jebem i vas i vas forum
Topic archived. No new replies allowed.