17 |
* Free Software Foundation, Inc., * |
* Free Software Foundation, Inc., * |
18 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
19 |
***************************************************************************/ |
***************************************************************************/ |
20 |
|
/* |
21 |
#include "solutionint.h" |
#include "solutionint.h" |
22 |
|
|
23 |
SolutionInt::SolutionInt(int size) |
SolutionInt::SolutionInt(int size) |
43 |
m_matrix[i] = input.m_matrix[i]; |
m_matrix[i] = input.m_matrix[i]; |
44 |
} |
} |
45 |
|
|
46 |
|
void SolutionInt::set(unsigned char input[MAX_SIZE]) |
47 |
|
{ |
48 |
|
for (int i=0; i<m_size; i++) |
49 |
|
m_matrix[i] = input[i]; |
50 |
|
} |
51 |
|
|
52 |
bool SolutionInt::getMatrix(int x, int y) |
bool SolutionInt::getMatrix(int x, int y) |
53 |
{ |
{ |
54 |
return (m_matrix[x] == y); |
return (m_matrix[x] == y); |
70 |
return false; |
return false; |
71 |
return true; |
return true; |
72 |
} |
} |
73 |
/* |
|
|
bool SolutionInt::operator !=(const Solution& s) |
|
|
{ |
|
|
const SolutionInt& sol = dynamic_cast<const SolutionInt&>(s); |
|
|
return !operator==(s); |
|
|
} |
|
|
*/ |
|
74 |
Solution* SolutionInt::copy() |
Solution* SolutionInt::copy() |
75 |
{ |
{ |
76 |
return new SolutionInt(*this); |
return new SolutionInt(*this); |
78 |
|
|
79 |
void SolutionInt::mirror() |
void SolutionInt::mirror() |
80 |
{ |
{ |
81 |
|
unsigned char temp[MAX_SIZE]; |
82 |
|
for (int i=0; i<m_size; i++) |
83 |
|
temp[i] = (m_size-1) - m_matrix[i]; |
84 |
|
set( temp ); |
85 |
} |
} |
86 |
|
|
87 |
|
|
88 |
void SolutionInt::rotate90() |
void SolutionInt::rotate90() |
89 |
{ |
{ |
90 |
} |
unsigned char temp[MAX_SIZE]; |
91 |
|
|
92 |
|
for (int i=0; i<m_size; i++) |
93 |
|
{ |
94 |
|
int x = i; |
95 |
|
int y = m_matrix[i]; |
96 |
|
|
97 |
|
temp[y] = (m_size-1) - x; |
98 |
|
} |
99 |
|
|
100 |
|
set( temp); |
101 |
|
} |
102 |
|
*/ |