libkombilo  0.7
Public Member Functions | Static Public Member Functions | Data Fields
Pattern Class Reference

#include <pattern.h>

Public Member Functions

 Pattern (int le, int ri, int to, int bo, int BOARDSIZE, int sX, int sY, const char *iPos, const std::vector< MoveNC > &CONTLIST, const char *CONTLABELS=0) throw (PatternError)
 Pattern (int le, int ri, int to, int bo, int BOARDSIZE, int sX, int sY, const char *iPos) throw (PatternError)
 Pattern (int type, int BOARDSIZE, int sX, int sY, const char *iPos, const std::vector< MoveNC > &CONTLIST, const char *CONTLABELS=0)
 Pattern (int type, int BOARDSIZE, int sX, int sY, const char *iPos, const char *CONTLABELS=0)
 Pattern (const Pattern &p)
 Pattern (SnapshotVector &snv)
Patternoperator= (const Pattern &p)
Patterncopy (const Pattern &p)
char getInitial (int i, int j)
char getFinal (int i, int j)
char BW2XO (char c)
int operator== (const Pattern &p)
std::string printPattern ()
void to_snv (SnapshotVector &snv)

Static Public Member Functions

static int flipsX (int i, int x, int y, int XX, int YY)
static int flipsY (int i, int x, int y, int XX, int YY)
static int PatternInvFlip (int i)
static int compose_flips (int i, int j)

Data Fields

int left
int right
int bottom
int top
int boardsize
int sizeX
int sizeY
int flip
int colorSwitch
char * initialPos
char * finalPos
char * contLabels
std::vector< MoveNCcontList

Detailed Description

A pattern, say

 XXOo
 ..Xx
 ..O*
 

is given by

Here we use the following notation for search patterns:

We use an analogous coordinate system as for the board, so a point with coordinates (i,j) is stored at position (i + j*sizeX) in the string.

The area of the board where we want to search for the given pattern (or, in other words, the set of permissible translations) is described by the parameters left, right, top, bottom where the rectangle with corners (left,top) and (right,bottom) is the set of possible positions for the upper left point of the pattern.

For instance, if all entries are 0, then the upper left corner is the only place where we would look for the pattern.

Instead of specifying left, right, top, bottom, in most cases one can just give the "pattern type", see the constants FULLBOARD_PATTERN, CENTER_PATTERN, etc.

Possibly a list of continuations


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables