/[projects]/queensgui/src/solutionint.cpp
ViewVC logotype

Diff of /queensgui/src/solutionint.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 5 by torben, Fri Jul 20 01:22:53 2007 UTC revision 655 by torben, Fri Apr 23 05:57:28 2010 UTC
# Line 17  Line 17 
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)
# Line 42  SolutionInt::SolutionInt(const SolutionI Line 43  SolutionInt::SolutionInt(const SolutionI
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);
# Line 63  bool SolutionInt::operator ==(const Solu Line 70  bool SolutionInt::operator ==(const Solu
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);
# Line 77  Solution* SolutionInt::copy() Line 78  Solution* SolutionInt::copy()
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    */

Legend:
Removed from v.5  
changed lines
  Added in v.655

  ViewVC Help
Powered by ViewVC 1.1.20