Knight's Tour Generator
Tourneys and the Fast Generation and Obfuscation of Closed Knight's Tours
Board.h
Go to the documentation of this file.
1 
4 // MIT License
5 //
6 // Copyright (c) 2019 Ian Parberry
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to
10 // deal in the Software without restriction, including without limitation the
11 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 // sell copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // The above copyright notice and this permission notice shall be included in
16 // all copies or substantial portions of the Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 // IN THE SOFTWARE.
25 
26 #ifndef __Board__
27 #define __Board__
28 
29 #include "Includes.h"
30 #include "Structs.h"
31 #include "Helpers.h"
32 #include "Rail.h"
33 #include "BaseBoard.h"
34 
35 
41 
42 class CBoard: public CBaseBoard{
43  private:
44  void FindRails(std::vector<CRail>& rails);
45  void Switch(CRail& r);
46 
47  bool IsRail(int s0, int d0, int s1, int d1);
48  bool IsRail(CRail& r);
49 
50  bool Join();
51 
52  public:
53  CBoard();
54  CBoard(UINT n);
55  CBoard(UINT w, UINT h);
56  CBoard(int move[], UINT w, UINT h);
57 
58  void Shatter();
59  void JoinUntilTour();
60 
61  void Obfuscate();
62 }; //CBoard
63 
64 #endif
65 
void Shatter()
Shatter tourneys into more tourneys.
Definition: Board.cpp:199
Base chessboard.
Definition: BaseBoard.h:69
A rail.
Definition: Rail.h:41
bool Join()
Join cycles to reduce tourney size.
Definition: Board.cpp:239
Useful includes.
bool IsRail(int s0, int d0, int s1, int d1)
Rail test.
Definition: Board.cpp:86
Header for the structs CSearchRequest, CSearchResult, and CRect.
Header for helper functions.
CBoard()
Constructor.
Definition: Board.cpp:36
void JoinUntilTour()
Join cycles to reduce tourney size.
Definition: Board.cpp:305
unsigned int UINT
Abbreviation for unsigned integer.
Definition: Defines.h:84
Header for the base chessboard CBaseBoard.
Header for CRail.
Chessboard.
Definition: Board.h:42
void Switch(CRail &r)
Switch a rail.
Definition: Board.cpp:177
void FindRails(std::vector< CRail > &rails)
Find all rails.
Definition: Board.cpp:141
void Obfuscate()
Obfuscate function.
Definition: Board.cpp:214