| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
using namespace std; |
|---|
| 25 |
|
|---|
| 26 |
#include "Python.h" |
|---|
| 27 |
#include <vector> |
|---|
| 28 |
|
|---|
| 29 |
typedef char* charp; |
|---|
| 30 |
|
|---|
| 31 |
class Symmetries { |
|---|
| 32 |
public: |
|---|
| 33 |
int* dataX; |
|---|
| 34 |
int* dataY; |
|---|
| 35 |
int* dataCS; |
|---|
| 36 |
int sizeX; |
|---|
| 37 |
int sizeY; |
|---|
| 38 |
Symmetries(int sX=0, int sY=0); |
|---|
| 39 |
~Symmetries(); |
|---|
| 40 |
Symmetries(const Symmetries& s); |
|---|
| 41 |
Symmetries& operator=(const Symmetries& s); |
|---|
| 42 |
void set(int i, int j, int k, int l, int cs); |
|---|
| 43 |
int getX(int i, int j); |
|---|
| 44 |
int getY(int i, int j); |
|---|
| 45 |
int getCS(int i, int j); |
|---|
| 46 |
int has_key(int i, int j); |
|---|
| 47 |
int special; |
|---|
| 48 |
}; |
|---|
| 49 |
|
|---|
| 50 |
class Pattern { |
|---|
| 51 |
public: |
|---|
| 52 |
int left; |
|---|
| 53 |
int right; |
|---|
| 54 |
int bottom; |
|---|
| 55 |
int top; |
|---|
| 56 |
int sizeX; |
|---|
| 57 |
int sizeY; |
|---|
| 58 |
|
|---|
| 59 |
int flip, colorSwitch; |
|---|
| 60 |
char moveOne, moveTwo; |
|---|
| 61 |
charp* bits; |
|---|
| 62 |
int* bitlengths; |
|---|
| 63 |
char* initialPos; |
|---|
| 64 |
char* finalPos; |
|---|
| 65 |
char* contList; |
|---|
| 66 |
int lenContList; |
|---|
| 67 |
|
|---|
| 68 |
Pattern(); |
|---|
| 69 |
Pattern(int le, int ri, int to, int bo, int sX, int sY, |
|---|
| 70 |
char* iPos, char* cList, int lenCList, char mOne); |
|---|
| 71 |
Pattern(const Pattern& p); |
|---|
| 72 |
~Pattern(); |
|---|
| 73 |
Pattern& copy(const Pattern& p); |
|---|
| 74 |
|
|---|
| 75 |
char getInitial(int i, int j); |
|---|
| 76 |
char getFinal(int i, int j); |
|---|
| 77 |
int getBits(int b, int i); |
|---|
| 78 |
|
|---|
| 79 |
char BW2XO(char c); |
|---|
| 80 |
int operator==(const Pattern& p); |
|---|
| 81 |
void printPattern(); |
|---|
| 82 |
|
|---|
| 83 |
static int flipsX(int i, int x, int y, int XX, int YY); |
|---|
| 84 |
static int flipsY(int i, int x, int y, int XX, int YY); |
|---|
| 85 |
static int PatternInvFlip(int i); |
|---|
| 86 |
|
|---|
| 87 |
}; |
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 |
class PatternList { |
|---|
| 91 |
public: |
|---|
| 92 |
int boardsize; |
|---|
| 93 |
Pattern pattern; |
|---|
| 94 |
int fixedColor, nextMove; |
|---|
| 95 |
vector<Pattern> data; |
|---|
| 96 |
Symmetries symmetries; |
|---|
| 97 |
|
|---|
| 98 |
PatternList(Pattern& p, int fColor, int nMove, int bsize); |
|---|
| 99 |
PatternList(const PatternList& pl); |
|---|
| 100 |
PatternList& operator=(const PatternList& pl); |
|---|
| 101 |
|
|---|
| 102 |
char invertColor(char co); |
|---|
| 103 |
vector<Pattern> patternList(); |
|---|
| 104 |
Pattern& get(int i); |
|---|
| 105 |
int size(); |
|---|
| 106 |
PyObject* updateContinuations(int index, int x, int y, char co, int Xint0, int Xint1, |
|---|
| 107 |
int Yint0, int Yint1, |
|---|
| 108 |
int foundWhere, int counter, |
|---|
| 109 |
PyObject* continuations, char* contLabels, int contLabelsIndex, |
|---|
| 110 |
char winner); |
|---|
| 111 |
}; |
|---|
| 112 |
|
|---|