This is the doxygen documentation for gtkboard.

.
Main Page   Data Structures   File List   Data Fields   Globals  

dotsandboxes.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 DNB_CELL_SIZE   24
#define DNB_NUM_PIECES   5
#define DNB_BOARD_SIZE   10
#define DNB_BOARD_WID   (2*DNB_BOARD_SIZE+1)
#define DNB_BOARD_HEIT   (2*DNB_BOARD_SIZE+1)
#define DNB_EMPTY   0
#define DNB_DOT   1
#define DNB_HOR   2
#define DNB_VERT   3
#define DNB_RED   4
#define DNB_BLUE   5
#define abs(x)   ((x) < 0 ? -(x) : (x))

Functions

int dnb_getmove (Pos *, int, int, GtkboardEventType, Player, byte **, int **)
void dnb_search (Pos *pos, byte **movp)
void dnb_init ()
ResultType dnb_who_won (Pos *, Player, char **)
void dnb_set_init_pos (Pos *pos)
char** dnb_get_pixmap (int idx, int color)
void dnb_get_render (Pos *pos, byte *move, int **rmovp)
int num_nbr_walls (byte *board, int *render, int x, int y)

Variables

char dnb_colors [6] = {220, 220, 220, 220, 220, 220}
char* dnb_red_24_xpm []
char* dnb_blue_24_xpm []
char* dnb_vertical_24_xpm []
char* dnb_horizontal_24_xpm []
Game Dnb
int dnb_curx = - 1
int dnb_cury = -1
int dnb_incx [] = {-1, 0, 0, 1}
int dnb_incy [] = {0, -1, 1, 0}


Define Documentation

#define DNB_BLUE   5
 

Definition at line 174 of file dotsandboxes.c.

#define DNB_BOARD_HEIT   (2*DNB_BOARD_SIZE+1)
 

Definition at line 33 of file dotsandboxes.c.

#define DNB_BOARD_SIZE   10
 

Definition at line 30 of file dotsandboxes.c.

#define DNB_BOARD_WID   (2*DNB_BOARD_SIZE+1)
 

Definition at line 32 of file dotsandboxes.c.

#define DNB_CELL_SIZE   24
 

Definition at line 27 of file dotsandboxes.c.

#define DNB_DOT   1
 

Definition at line 170 of file dotsandboxes.c.

#define DNB_EMPTY   0
 

Definition at line 169 of file dotsandboxes.c.

#define DNB_HOR   2
 

Definition at line 171 of file dotsandboxes.c.

#define DNB_NUM_PIECES   5
 

Definition at line 28 of file dotsandboxes.c.

#define DNB_RED   4
 

Definition at line 173 of file dotsandboxes.c.

#define DNB_VERT   3
 

Definition at line 172 of file dotsandboxes.c.

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

Definition at line 176 of file dotsandboxes.c.


Function Documentation

char** dnb_get_pixmap ( int idx,
int color )
 

Definition at line 216 of file dotsandboxes.c.

void dnb_get_render ( Pos * pos,
byte * move,
int ** rmovp ) [static]
 

Definition at line 375 of file dotsandboxes.c.

int dnb_getmove ( Pos * pos,
int x,
int y,
GtkboardEventType type,
Player player,
byte ** movp,
int ** rmovp )
 

Definition at line 279 of file dotsandboxes.c.

void dnb_init ( )
 

Definition at line 194 of file dotsandboxes.c.

void dnb_search ( Pos * pos,
byte ** movp )
 

Definition at line 393 of file dotsandboxes.c.

void dnb_set_init_pos ( Pos * pos )
 

Definition at line 233 of file dotsandboxes.c.

ResultType dnb_who_won ( Pos *,
Player,
char ** )
 

int num_nbr_walls ( byte * board,
int * render,
int x,
int y ) [static]
 

Definition at line 262 of file dotsandboxes.c.

Referenced by dnb_getmove(), and dnb_search().


Variable Documentation

Game Dnb
 

Initial value:

 { DNB_CELL_SIZE, DNB_BOARD_WID, DNB_BOARD_HEIT, 
        DNB_NUM_PIECES, dnb_colors, NULL, NULL, "Dots and boxes", dnb_init}

Definition at line 188 of file dotsandboxes.c.

char* dnb_blue_24_xpm[] [static]
 

Initial value:

{
"24 24 1 1",
"  c #0000ee",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
}

Definition at line 67 of file dotsandboxes.c.

char dnb_colors[6] = {220, 220, 220, 220, 220, 220}
 

Definition at line 35 of file dotsandboxes.c.

int dnb_curx = - 1 [static]
 

Definition at line 191 of file dotsandboxes.c.

int dnb_cury = -1 [static]
 

Definition at line 191 of file dotsandboxes.c.

char* dnb_horizontal_24_xpm[] [static]
 

Initial value:

{
"24 24 2 1",
"  c none",
". c #101010",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"........................",
"........................",
"........................",
"........................",
"........................",
"........................",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
}

Definition at line 128 of file dotsandboxes.c.

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

Definition at line 259 of file dotsandboxes.c.

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

Definition at line 260 of file dotsandboxes.c.

char* dnb_red_24_xpm[] [static]
 

Initial value:

{
"24 24 1 1",
"  c #ee0000",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
"                        ",
}

Definition at line 37 of file dotsandboxes.c.

char* dnb_vertical_24_xpm[] [static]
 

Initial value:

{
"24 24 2 1",
"  c none",
". c #101010",
"         ......         ",
"         ......         ",
"         ......         ",
"         ......         ",
"         ......         ",
"         ......         ",
"         ......         ",
"         ......         ",
"         ......         ",
"         ......         ",
"         ......         ",
"         ......         ",
"         ......         ",
"         ......         ",
"         ......         ",
"         ......         ",
"         ......         ",
"         ......         ",
"         ......         ",
"         ......         ",
"         ......         ",
"         ......         ",
"         ......         ",
"         ......         ",
}

Definition at line 97 of file dotsandboxes.c.