im trying to implement the n-queen problem board game and im having problems with the board
so what am i doing wrong here in this displayboard function? its suppose to implement an 8 by 8 empty board sorry im just a beginner
#include <iostream>
#include <limits>
using namespace std;
const int rows = 8;
const int columns =8;
int board[rows][columns] = {0,0};
void displayboard();
int main(){
displayboard();
system("pause");
}
void displayboard ()
{
cout << " 1 2 3 4 5 6 7 8" << endl;
cout << " ---------------";
for (int bRow = 0; bRow<rows; bRow++)
{
for (int bCol = 0; bCol<columns; bCol++)
if (board[bRow][bCol] == 0)
cout << " ";
else
cout << " ";
}
cout << endl;
return;
}
?? Both do the same thing ! Printing a blank space. Moreover, you haven’t populated your array
board[8][8]anything other than0s.