1 |
torben |
1 |
/*************************************************************************** |
2 |
|
|
* Copyright (C) 2005 by Torben Nielsen * |
3 |
|
|
* torben@t-hoerup.dk * |
4 |
|
|
* * |
5 |
|
|
* This program is free software; you can redistribute it and/or modify * |
6 |
|
|
* it under the terms of the GNU General Public License as published by * |
7 |
|
|
* the Free Software Foundation; either version 2 of the License, or * |
8 |
|
|
* (at your option) any later version. * |
9 |
|
|
* * |
10 |
|
|
* This program is distributed in the hope that it will be useful, * |
11 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
12 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
13 |
|
|
* GNU General Public License for more details. * |
14 |
|
|
* * |
15 |
|
|
* You should have received a copy of the GNU General Public License * |
16 |
|
|
* along with this program; if not, write to the * |
17 |
|
|
* Free Software Foundation, Inc., * |
18 |
|
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
19 |
|
|
***************************************************************************/ |
20 |
|
|
#include "solution.h" |
21 |
|
|
|
22 |
torben |
5 |
#include <iostream> |
23 |
torben |
1 |
|
24 |
torben |
5 |
using namespace std; |
25 |
torben |
1 |
|
26 |
torben |
5 |
void Solution::print() |
27 |
torben |
1 |
{ |
28 |
torben |
5 |
print(false, -1, -1); |
29 |
torben |
1 |
} |
30 |
|
|
|
31 |
torben |
5 |
void Solution::print(bool debug, int row, int col) |
32 |
torben |
1 |
{ |
33 |
torben |
5 |
for (int i=0; i<m_size; i++) { |
34 |
torben |
1 |
for (int j=0; j<m_size; j++) |
35 |
torben |
5 |
cout << "+--"; |
36 |
|
|
cout << "+" << endl; |
37 |
torben |
1 |
for (int j=0; j<m_size; j++) { |
38 |
torben |
5 |
cout << "|"; |
39 |
|
|
if (debug==true && row!=-1 && i==row && j==col) |
40 |
|
|
cout << "??"; |
41 |
|
|
else |
42 |
|
|
cout << ( getMatrix(i,j)==true ? "QQ" : " "); |
43 |
torben |
1 |
} |
44 |
torben |
5 |
cout << "|" << endl; |
45 |
|
|
} |
46 |
|
|
for (int j=0; j<m_size; j++) |
47 |
|
|
cout << "+--"; |
48 |
|
|
cout << "+" << endl; |
49 |
torben |
1 |
} |