I'm trying to write a chessboard simulation basically the black and white colors are represented by either #'s or spaces
so something like:
my program currently prints:Code:# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
the column and row's are both 8 in length.Code:# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
so basically for each column i do the following:
if (col % 2 == 1)
which either returns a 0 or 1. if it's 0 i put board[row][col] = ' '; otherwise board[row][col] = '#';
Now my problem: I *want* every second row to start off with board[row][col] = '#'; so it looks like a chessboard... Any ideas?
so something like (where 0 = space and 1 = #)
0101010
1010101
0101010
1010101
0101010
1010101
0101010