-
Notifications
You must be signed in to change notification settings - Fork 0
/
TupleCollection.h
152 lines (133 loc) · 2.73 KB
/
TupleCollection.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#ifndef __TUPLECOLLECTION_H__
#define __TUPLECOLLECTION_H__
#include "FourTuple.h"
#include "SixTuple.h"
////////////////////////
// line-tuple outside
// O O O O
// O O O O
// O O O O
// X X X X
class LineTupleOutside : public FourTuple
{
public:
LineTupleOutside(double weight=1):FourTuple(weight) { }
protected:
board_t get_index(const board_t& game_board) const
{
return game_board & 0xffff;
}
};
////////////////////////
// line-tuple inside
// O O O O
// O O O O
// X X X X
// O O O O
class LineTupleInside : public FourTuple
{
public:
LineTupleInside(double weight=1):FourTuple(weight) { }
protected:
board_t get_index(const board_t& game_board) const
{
return (game_board & 0xffff0000) >> 16;
}
};
////////////////////////
// square-tuple outside
// O O O O
// O O O O
// O X X X
// O X X X
class SquareTupleOutside : public SixTuple
{
public:
SquareTupleOutside(double weight=1):SixTuple(weight) { }
protected:
board_t get_index(const board_t& game_board) const
{
return (game_board & 0xfff0000) >> 4 | (game_board & 0xfff);
}
};
////////////////////////
// square-tuple inside
// O O O O
// O X X X
// O X X X
// O O O O
class SquareTupleInside : public SixTuple
{
public:
SquareTupleInside(double weight=1):SixTuple(weight) { }
protected:
board_t get_index(const board_t& game_board) const
{
return (game_board & 0xfff00000000) >> 20 | (game_board & 0xfff0000) >> 16;
}
};
////////////////////////
// small axe-tuple outside
// O O O O
// O O O O
// O O X X
// X X X X
class SmallAxeTupleOutside : public SixTuple
{
public:
SmallAxeTupleOutside(double weight=1):SixTuple(weight) { }
protected:
board_t get_index(const board_t& game_board) const
{
return game_board & 0xffffff;
}
};
////////////////////////
// small axe-tuple inside
// O O O O
// O O X X
// X X X X
// O O O O
class SmallAxeTupleInside : public SixTuple
{
public:
SmallAxeTupleInside(double weight=1):SixTuple(weight) { }
protected:
board_t get_index(const board_t& game_board) const
{
return (game_board & 0xffffff0000) >> 16;
}
};
////////////////////////
// small saw-tuple outside
// O O O O
// O O O O
// X X X X
// O O X X
class SmallSawTupleOutside : public SixTuple
{
public:
SmallSawTupleOutside(double weight=1):SixTuple(weight) { }
protected:
board_t get_index(const board_t& game_board) const
{
return (game_board & 0xff) | (game_board & 0xffff0000) >> 8;
}
};
////////////////////////
// small saw-tuple inside
// O O O O
// X X X X
// O O X X
// O O O O
class SmallSawTupleInside : public SixTuple
{
public:
SmallSawTupleInside(double weight=1):SixTuple(weight) { }
protected:
board_t get_index(const board_t& game_board) const
{
return (game_board & 0xff0000) >> 16 | (game_board & 0xffff00000000) >> 24;
}
};
#endif