This is the doxygen documentation for gtkboard.

.
Main Page   Data Structures   File List   Data Fields   Globals  

quarto.c File Reference

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

Go to the source code of this file.

Defines

#define QUARTO_CELL_SIZE   60
#define QUARTO_NUM_PIECES   17
#define QUARTO_BOARD_WID   9
#define QUARTO_BOARD_HEIT   4
#define QUARTO_EMPTY   0
#define QUARTO_SEPARATOR   17
#define QUARTO_SHAPE_MASK   (1 << 0)
#define QUARTO_SIZE_MASK   (1 << 1)
#define QUARTO_HOLE_MASK   (1 << 2)
#define QUARTO_COLOR_MASK   (1 << 3)
#define QUARTO_ALL_PIECES_MASK   (QUARTO_SHAPE_MASK | QUARTO_SIZE_MASK | QUARTO_HOLE_MASK | QUARTO_COLOR_MASK)

Functions

void quarto_init ()
int quarto_getmove (Pos *, int, int, GtkboardEventType, Player, byte **, int **)
ResultType quarto_who_won (Pos *, Player, char **)
byte* quarto_movegen (Pos *)
ResultType quarto_eval (Pos *, Player, float *eval)
void quarto_reset_uistate (Pos *pos)
unsigned char* quarto_get_rgbmap (int idx, int color)
void quarto_get_render (Pos *pos, byte *move, int **rmovp)
gboolean eval_column (byte *board, int x, int y, int incx, int incy)

Variables

char quarto_colors [9] = {200, 200, 200, 200, 200, 200, 0, 0, 0}
char quarto_highlight_colors [9] = {0, 0xff, 0, 0, 0, 0, 0, 0, 0}
int quarto_init_pos [QUARTO_BOARD_HEIT *QUARTO_BOARD_WID]
Game Quarto
int cur_piece = -1
int curx = -1
int cury = -1


Define Documentation

#define QUARTO_ALL_PIECES_MASK   (QUARTO_SHAPE_MASK | QUARTO_SIZE_MASK | QUARTO_HOLE_MASK | QUARTO_COLOR_MASK)
 

Definition at line 40 of file quarto.c.

#define QUARTO_BOARD_HEIT   4
 

Definition at line 31 of file quarto.c.

#define QUARTO_BOARD_WID   9
 

Definition at line 30 of file quarto.c.

#define QUARTO_CELL_SIZE   60
 

Definition at line 27 of file quarto.c.

#define QUARTO_COLOR_MASK   (1 << 3)
 

Definition at line 39 of file quarto.c.

#define QUARTO_EMPTY   0
 

Definition at line 33 of file quarto.c.

#define QUARTO_HOLE_MASK   (1 << 2)
 

Definition at line 38 of file quarto.c.

#define QUARTO_NUM_PIECES   17
 

Definition at line 28 of file quarto.c.

#define QUARTO_SEPARATOR   17
 

Definition at line 34 of file quarto.c.

#define QUARTO_SHAPE_MASK   (1 << 0)
 

Definition at line 36 of file quarto.c.

#define QUARTO_SIZE_MASK   (1 << 1)
 

Definition at line 37 of file quarto.c.


Function Documentation

gboolean eval_column ( byte * board,
int x,
int y,
int incx,
int incy ) [static]
 

Definition at line 105 of file quarto.c.

Referenced by quarto_eval().

ResultType quarto_eval ( Pos * pos,
Player player,
float * eval ) [static]
 

Definition at line 126 of file quarto.c.

Referenced by quarto_who_won().

void quarto_get_render ( Pos * pos,
byte * move,
int ** rmovp )
 

Definition at line 206 of file quarto.c.

unsigned char* quarto_get_rgbmap ( int idx,
int color ) [static]
 

Definition at line 287 of file quarto.c.

int quarto_getmove ( Pos * pos,
int x,
int y,
GtkboardEventType type,
Player to_play,
byte ** movp,
int ** rmovep ) [static]
 

Definition at line 154 of file quarto.c.

void quarto_init ( void )
 

Definition at line 72 of file quarto.c.

byte* quarto_movegen ( Pos * pos ) [static]
 

Definition at line 239 of file quarto.c.

void quarto_reset_uistate ( Pos * pos ) [static]
 

Definition at line 234 of file quarto.c.

ResultType quarto_who_won ( Pos * pos,
Player player,
char ** commp ) [static]
 

Definition at line 95 of file quarto.c.


Variable Documentation

Game Quarto
 

Initial value:

 { QUARTO_CELL_SIZE, QUARTO_BOARD_WID, QUARTO_BOARD_HEIT, 
        QUARTO_NUM_PIECES,
        quarto_colors, quarto_init_pos, NULL, "Quarto", quarto_init}

Definition at line 58 of file quarto.c.

int cur_piece = -1 [static]
 

Definition at line 151 of file quarto.c.

int curx = -1 [static]
 

Definition at line 151 of file quarto.c.

int cury = -1 [static]
 

Definition at line 151 of file quarto.c.

char quarto_colors[9] = {200, 200, 200, 200, 200, 200, 0, 0, 0}
 

Definition at line 42 of file quarto.c.

char quarto_highlight_colors[9] = {0, 0xff, 0, 0, 0, 0, 0, 0, 0}
 

Definition at line 44 of file quarto.c.

int quarto_init_pos[QUARTO_BOARD_HEIT * QUARTO_BOARD_WID]
 

Initial value:

 
{
        0, 0, 0, 0, 17, 1,   2,  3,  4,
        0, 0, 0, 0, 17, 5,   6,  7,  8,
        0, 0, 0, 0, 17, 9,  10, 11, 12,
        0, 0, 0, 0, 17, 13, 14, 15, 16,
}

Definition at line 46 of file quarto.c.