Knight's Tour Generator
Tourneys and the Fast Generation and Obfuscation of Closed Knight's Tours
Public Member Functions | Protected Attributes | Static Private Attributes | List of all members
CTile Class Reference

Base tours for the divide-and-conquer generation algorithm. More...

#include <Tile.h>

Inheritance diagram for CTile:
CDivideAndConquer

Public Member Functions

 CTile ()
 Constructor. More...
 
 ~CTile ()
 Destructor. More...
 

Protected Attributes

CBoardm_pTile6x6 = nullptr
 Pointer to a 6x6 chessboard.
 
CBoardm_pTile6x8 = nullptr
 Pointer to a 6x8 chessboard.
 
CBoardm_pTile8x6 = nullptr
 Pointer to an 8x6 chessboard.
 
CBoardm_pTile8x8 = nullptr
 Pointer to an 8x8 chessboard.
 
CBoardm_pTile8x10 = nullptr
 Pointer to an 8x10 chessboard.
 
CBoardm_pTile10x8 = nullptr
 Pointer to a 10x8 chessboard.
 
CBoardm_pTile10x10 = nullptr
 Pointer to a 10x10 chessboard.
 
CBoardm_pTile10x12 = nullptr
 Pointer to a 10x12 chessboard.
 
CBoardm_pTile12x10 = nullptr
 Pointer to a 12x10 chessboard.
 

Static Private Attributes

static int m_nTile6x6 [36]
 6x6 move table. More...
 
static int m_nTile6x8 [48]
 6x8 move table. More...
 
static int m_nTile8x6 [48]
 8x6 move table. More...
 
static int m_nTile8x8 [64]
 8x8 move table. More...
 
static int m_nTile8x10 [80]
 8x10 move table. More...
 
static int m_nTile10x8 [80]
 10x8 move table. More...
 
static int m_nTile10x10 [100]
 10x10 move table. More...
 
static int m_nTile10x12 [120]
 10x12 move table. More...
 
static int m_nTile12x10 [120]
 12x10 move table. More...
 

Detailed Description

These are the closed knight's tours at the base of the recursive generation algorithm in CDivideAndConquer. See I. Parberry, "An efficient algorithm for the knight's tour problem", Discrete Applied Mathematics, 73:251-260,

  1. There are hard-coded move tables for each of the tiles, but it's more convenient to have them in board form in the rest of the program.
Tiles.png

Definition at line 41 of file Tile.h.

Constructor & Destructor Documentation

◆ CTile()

CTile::CTile ( )

Create the CBoard instances from the move tables.

Definition at line 141 of file Tile.cpp.

◆ ~CTile()

CTile::~CTile ( )

Delete all of the CBoard instances created by the constructor.

Definition at line 158 of file Tile.cpp.

Member Data Documentation

◆ m_nTile10x10

int CTile::m_nTile10x10
staticprivate
Initial value:
= {
21, 20, 10, 15, 12, 13, 14, 19, 16, 17,
22, 23, 0, 1, 35, 7, 4, 29, 37, 38,
32, 40, 3, 2, 5, 44, 45, 6, 9, 8,
11, 50, 51, 25, 46, 47, 24, 56, 59, 18,
61, 62, 30, 55, 63, 66, 27, 26, 36, 28,
42, 70, 31, 41, 33, 34, 75, 65, 39, 67,
52, 80, 54, 71, 43, 73, 74, 48, 49, 77,
91, 90, 93, 81, 53, 83, 57, 58, 97, 87,
92, 60, 94, 95, 96, 64, 98, 99, 69, 68,
82, 72, 84, 85, 86, 76, 88, 89, 79, 78
}
tile10x10.png

Definition at line 51 of file Tile.h.

◆ m_nTile10x12

int CTile::m_nTile10x12
staticprivate
Initial value:
{
21, 20, 10, 11, 25, 13, 14, 26, 16, 17,
31, 30, 0, 1, 22, 36, 4, 29, 37, 7,
12, 2, 3, 35, 32, 6, 5, 15, 9, 8,
51, 50, 40, 41, 46, 27, 48, 45, 19, 18,
52, 60, 61, 24, 23, 66, 65, 55, 56, 28,
71, 70, 33, 34, 73, 74, 77, 49, 39, 38,
72, 53, 54, 42, 43, 44, 47, 75, 87, 57,
91, 90, 80, 81, 62, 94, 84, 89, 59, 58,
101, 93, 63, 64, 105, 97, 67, 95, 69, 68,
111, 110, 100, 85, 82, 83, 117, 76, 79, 78,
112, 113, 114, 115, 116, 86, 118, 119, 96, 88,
102, 103, 104, 92, 106, 107, 108, 109, 99, 98
}
tile10x12.png

Definition at line 52 of file Tile.h.

◆ m_nTile10x8

int CTile::m_nTile10x8
staticprivate
Initial value:
= {
12, 13, 10, 15, 16, 24, 14, 19, 29, 28,
22, 3, 4, 5, 2, 7, 8, 9, 6, 38,
1, 0, 41, 42, 36, 37, 47, 46, 49, 17,
11, 23, 20, 52, 26, 56, 48, 45, 59, 18,
21, 60, 50, 35, 25, 33, 54, 39, 27, 68,
71, 30, 31, 32, 75, 34, 44, 69, 66, 78,
72, 40, 70, 55, 43, 73, 74, 79, 76, 77,
51, 63, 53, 61, 62, 67, 64, 65, 57, 58
}
tile10x8.png

Definition at line 50 of file Tile.h.

◆ m_nTile12x10

int CTile::m_nTile12x10
staticprivate
Initial value:
= {
14, 15, 25, 17, 29, 19, 31, 21, 22, 23, 35, 34,
2, 3, 24, 5, 6, 7, 41, 9, 45, 11, 47, 46,
1, 0, 36, 4, 18, 39, 53, 8, 42, 10, 59, 58,
13, 12, 63, 16, 50, 51, 28, 20, 54, 68, 71, 33,
62, 26, 27, 76, 38, 43, 40, 30, 70, 32, 83, 82,
37, 75, 72, 86, 78, 55, 52, 57, 93, 44, 80, 94,
49, 48, 60, 100, 66, 91, 88, 56, 90, 95, 107, 106,
74, 110, 61, 64, 65, 112, 67, 116, 69, 79, 119, 118,
73, 87, 108, 109, 77, 111, 92, 113, 114, 115, 81, 117,
85, 84, 96, 97, 98, 99, 89, 101, 102, 103, 104, 105
}
tile12x10.png

Definition at line 54 of file Tile.h.

◆ m_nTile6x6

int CTile::m_nTile6x6
staticprivate
Initial value:
= {
13, 12, 6, 11, 8, 9,
14, 3, 0, 22, 2, 15,
25, 21, 1, 23, 5, 4,
7, 32, 28, 10, 35, 34,
20, 33, 30, 31, 17, 16,
19, 18, 24, 29, 26, 27
}
tile6x6.png

Definition at line 43 of file Tile.h.

◆ m_nTile6x8

int CTile::m_nTile6x8
staticprivate
Initial value:
{
13, 14, 6, 11, 17, 16,
19, 3, 0, 5, 2, 15,
1, 9, 22, 4, 27, 21,
7, 32, 24, 8, 35, 10,
37, 12, 34, 23, 20, 40,
26, 18, 43, 29, 47, 46,
25, 45, 42, 28, 44, 33,
31, 30, 36, 41, 38, 39
}
tile6x8.png

Definition at line 44 of file Tile.h.

◆ m_nTile8x10

int CTile::m_nTile8x10
staticprivate
Initial value:
{
17, 18, 8, 9, 10, 15, 23, 13,
25, 24, 0, 26, 6, 3, 4, 30,
1, 32, 12, 2, 5, 11, 7, 29,
41, 40, 20, 21, 43, 19, 45, 14,
49, 16, 51, 50, 42, 47, 28, 22,
34, 56, 59, 53, 27, 35, 31, 62,
33, 64, 60, 68, 37, 36, 39, 38,
73, 72, 52, 44, 75, 78, 79, 46,
74, 48, 76, 77, 58, 54, 55, 61,
66, 67, 57, 65, 70, 71, 63, 69
}
tile8x10.png

Definition at line 48 of file Tile.h.

◆ m_nTile8x6

int CTile::m_nTile8x6
staticprivate
Initial value:
= {
10, 11, 8, 9, 14, 20, 12, 13,
18, 24, 25, 21, 2, 3, 31, 5,
1, 0, 35, 4, 37, 15, 7, 6,
41, 40, 32, 17, 43, 44, 36, 46,
42, 16, 28, 45, 19, 47, 23, 22,
34, 26, 27, 33, 38, 39, 29, 30
}
tile8x6.png

Definition at line 46 of file Tile.h.

◆ m_nTile8x8

int CTile::m_nTile8x8
staticprivate
Initial value:
= {
10, 18, 8, 13, 21, 11, 23, 22,
25, 3, 4, 26, 6, 7, 31, 5,
1, 0, 24, 2, 37, 15, 39, 38,
9, 42, 43, 12, 34, 14, 20, 46,
17, 16, 40, 45, 19, 27, 55, 29,
57, 58, 52, 28, 54, 62, 63, 30,
33, 32, 56, 36, 35, 59, 60, 61,
41, 51, 48, 49, 50, 44, 47, 53
}
tile8x8.png

Definition at line 47 of file Tile.h.