This is the doxygen documentation for gtkboard.

.
Main Page   Data Structures   File List   Data Fields   Globals  

stopgate.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "game.h"
#include "aaball.h"

Go to the source code of this file.

Defines

#define STOPGATE_CELL_SIZE   40
#define STOPGATE_NUM_PIECES   4
#define STOPGATE_BOARD_WID   9
#define STOPGATE_BOARD_HEIT   9
#define STOPGATE_NORTH   1
#define STOPGATE_SOUTH   2
#define STOPGATE_EAST   3
#define STOPGATE_WEST   4
#define STOPGATE_EMPTY   0
#define abs(x)   ((x) < 0 ? -(x) : (x))
#define EVAL_ISEMPTY(x, y)   ((ISINBOARD((x), (y))) && (board[(y) * board_wid + (x)] == STOPGATE_EMPTY))
#define EVAL_OPENSQUARE(x, y)   (EVAL_ISEMPTY ((x), (y)) && (EVAL_ISEMPTY ((x)-1,(y)) || EVAL_ISEMPTY ((x)+1, (y))) && (EVAL_ISEMPTY ((x),(y)-1) || EVAL_ISEMPTY ((x), (y)+1)))

Enumerations

enum  { REGION_WHITE = STOPGATE_NUM_PIECES + 1, REGION_BLACK, REGION_OPEN_X = 1 << 4, REGION_OPEN_Y = 1 << 5 }

Functions

int stopgate_getmove (Pos *, int, int, GtkboardEventType, Player, byte **, int **)
void stopgate_init ()
ResultType stopgate_who_won (Pos *, Player, char **)
ResultType stopgate_eval (Pos *, Player, float *eval)
byte* stopgate_movegen (Pos *)
void find_regions (byte *board)

Variables

char stopgate_colors [6] = {180, 200, 180, 200, 140, 140}
char* blue_gate_north_40_xpm []
char* blue_gate_south_40_xpm []
char* blue_gate_east_40_xpm []
char* blue_gate_west_40_xpm []
char** stopgate_pixmaps []
Game Stopgate
int stopgate_curx = - 1
int stopgate_cury = -1
int incx [] = { -1, -1, -1, 0, 0, 1, 1, 1}
int incy [] = { -1, 0, 1, -1, 1, -1, 0, 1}
int regions [STOPGATE_BOARD_WID *STOPGATE_BOARD_HEIT]


Define Documentation

#define EVAL_ISEMPTY( x, y )   ((ISINBOARD((x), (y))) && (board[(y) * board_wid + (x)] == STOPGATE_EMPTY))
 

Definition at line 298 of file stopgate.c.

Referenced by find_regions(), and stopgate_eval().

#define EVAL_OPENSQUARE( x, y )   (EVAL_ISEMPTY ((x), (y)) && (EVAL_ISEMPTY ((x)-1,(y)) || EVAL_ISEMPTY ((x)+1, (y))) && (EVAL_ISEMPTY ((x),(y)-1) || EVAL_ISEMPTY ((x), (y)+1)))
 

Definition at line 300 of file stopgate.c.

Referenced by find_regions(), and stopgate_movegen().

#define STOPGATE_BOARD_HEIT   9
 

Definition at line 31 of file stopgate.c.

#define STOPGATE_BOARD_WID   9
 

Definition at line 30 of file stopgate.c.

#define STOPGATE_CELL_SIZE   40
 

Definition at line 27 of file stopgate.c.

#define STOPGATE_EAST   3
 

Definition at line 235 of file stopgate.c.

#define STOPGATE_EMPTY   0
 

Definition at line 237 of file stopgate.c.

#define STOPGATE_NORTH   1
 

Definition at line 233 of file stopgate.c.

#define STOPGATE_NUM_PIECES   4
 

Definition at line 28 of file stopgate.c.

#define STOPGATE_SOUTH   2
 

Definition at line 234 of file stopgate.c.

#define STOPGATE_WEST   4
 

Definition at line 236 of file stopgate.c.

#define abs( x )   ((x) < 0 ? -(x) : (x))
 

Definition at line 239 of file stopgate.c.


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
REGION_WHITE  
REGION_BLACK  
REGION_OPEN_X  
REGION_OPEN_Y  

Definition at line 302 of file stopgate.c.


Function Documentation

void find_regions ( byte * board ) [static]
 

Definition at line 318 of file stopgate.c.

Referenced by stopgate_eval().

ResultType stopgate_eval ( Pos * pos,
Player player,
float * eval )
 

Definition at line 395 of file stopgate.c.

Referenced by stopgate_who_won().

int stopgate_getmove ( Pos * pos,
int x,
int y,
GtkboardEventType type,
Player to_play,
byte ** movp,
int ** rmovp )
 

Definition at line 497 of file stopgate.c.

void stopgate_init ( )
 

Definition at line 254 of file stopgate.c.

byte* stopgate_movegen ( Pos * pos )
 

Definition at line 365 of file stopgate.c.

ResultType stopgate_who_won ( Pos * pos,
Player player,
char ** commp )
 

Definition at line 272 of file stopgate.c.


Variable Documentation

Game Stopgate
 

Initial value:

 { STOPGATE_CELL_SIZE, STOPGATE_BOARD_WID, STOPGATE_BOARD_HEIT, 
        STOPGATE_NUM_PIECES, 
        stopgate_colors, NULL, stopgate_pixmaps, "Stopgate", stopgate_init}

Definition at line 247 of file stopgate.c.

char* blue_gate_east_40_xpm[] [static]
 

Definition at line 129 of file stopgate.c.

char* blue_gate_north_40_xpm[] [static]
 

Definition at line 35 of file stopgate.c.

char* blue_gate_south_40_xpm[] [static]
 

Definition at line 82 of file stopgate.c.

char* blue_gate_west_40_xpm[] [static]
 

Definition at line 176 of file stopgate.c.

int incx[] = { -1, -1, -1, 0, 0, 1, 1, 1} [static]
 

Definition at line 269 of file stopgate.c.

int incy[] = { -1, 0, 1, -1, 1, -1, 0, 1} [static]
 

Definition at line 270 of file stopgate.c.

int regions[STOPGATE_BOARD_WID * STOPGATE_BOARD_HEIT] [static]
 

Definition at line 311 of file stopgate.c.

char stopgate_colors[6] = {180, 200, 180, 200, 140, 140}
 

Definition at line 33 of file stopgate.c.

int stopgate_curx = - 1 [static]
 

Definition at line 251 of file stopgate.c.

int stopgate_cury = -1 [static]
 

Definition at line 251 of file stopgate.c.

char** stopgate_pixmaps[]
 

Initial value:

 
{
        blue_gate_north_40_xpm,
        blue_gate_south_40_xpm,
        blue_gate_east_40_xpm,
        blue_gate_west_40_xpm,
}

Definition at line 224 of file stopgate.c.