MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / printBoard

Function printBoard

CPP/recursion/N_Queens/N_Queens.cpp:5–22  ·  view source on GitHub ↗

Function to print the bord

Source from the content-addressed store, hash-verified

3
4// Function to print the bord
5void printBoard(std::vector<std::vector<int>> &board, int n)
6{
7 for (int i = 0; i < n; ++i)
8 {
9 for (int j = 0; j < n; ++j)
10 {
11 if (board[i][j] == 1)
12 {
13 std::cout << 'Q' << ' ';
14 }
15 else
16 {
17 std::cout << '_' << ' ';
18 }
19 }
20 std::cout << std::endl;
21 }
22}
23
24// Function for checking valid squares.
25bool canBePlaced(std::vector<std::vector<int>> &board, int i, int j, int n)

Callers 1

N_QueensFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected