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
|
class Board
{
private:
Piece list[64];
int x1, y1;
int status, redpiece, greenpiece, winner;
int inRange(int x, int y);
int pieceAtLoc(int x, int y);
int validPlacement(int x, int y);
void flip(int x, int y);
void display();
void move();
public:
Board();
void execute();
};
Board::Board()
{
list[0].setposition(4,4,0);
list[1].setposition(5,4,1);
list[2].setposition(4,5,0);
list[3].setposition(5,5,1);
}
void Board::display()
{
for(int i=0; i<64; i++)
{
if((i==8)||(i==16)||(i==24)||(i==32)||(i==40)||(i==48)||(i==56)||(i==64))
{
cout<<endl;
cout<<list[i];
}
else
{
cout<<list[i];
}
}
}
void Board::execute()
{
display();
}
int main()
{
Board b;
b.execute();
}
|