This is the doxygen documentation for gtkboard.

.
Main Page   Data Structures   File List   Data Fields   Globals  

samegame.c File Reference

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

Go to the source code of this file.

Data Structures

struct  Samegame_state

Defines

#define SAMEGAME_NUM_ANIM   8
#define SAMEGAME_CELL_SIZE   40
#define SAMEGAME_NUM_PIECES   (3*SAMEGAME_NUM_ANIM)
#define SAMEGAME_BOARD_WID   15
#define SAMEGAME_BOARD_HEIT   10
#define SAMEGAME_EMPTY   0
#define SAMEGAME_RP   1
#define SAMEGAME_BP   2
#define SAMEGAME_GP   3

Functions

void samegame_init ()
void recursive_delete (byte *board, int x, int y, int val)
void pull_down (byte *board)
byte* synth_move (byte *newboard, byte *board)
int samegame_animate (Pos *pos, byte **movp)
int samegame_getmove (Pos *, int, int, GtkboardEventType, Player, byte **, int **)
char** samegame_get_pixmap (int, int)
void* samegame_newstate (Pos *, byte *)
ResultType samegame_who_won (Pos *, Player, char **)
void samegame_search (Pos *pos, byte **movp)
void samegame_getxy (byte *board, int *x, int *y)
void samegame_set_init_pos (Pos *pos)
int samegame_over (byte *board)
void recursive_animgen (byte *board, int x, int y, int val, int newval, byte **mp)
int getmove_real (Pos *pos, int x, int y, byte **movp)

Variables

char samegame_colors [6] = {50, 50, 50, 50, 50, 50}
Game Samegame
SCORE_FIELD samegame_score_fields [] = {SCORE_FIELD_RANK, SCORE_FIELD_USER, SCORE_FIELD_SCORE, SCORE_FIELD_TIME, SCORE_FIELD_DATE, SCORE_FIELD_NONE}
char* samegame_score_field_names [] = {"Rank", "User", "Score", "Time", "Date", NULL}
int anim_curx = -1
int anim_cury = -1
Samegame_state state = {0}
byte animgen_buf [SAMEGAME_BOARD_WID *SAMEGAME_BOARD_HEIT]


Define Documentation

#define SAMEGAME_BOARD_HEIT   10
 

Definition at line 34 of file samegame.c.

#define SAMEGAME_BOARD_WID   15
 

Definition at line 33 of file samegame.c.

#define SAMEGAME_BP   2
 

Definition at line 38 of file samegame.c.

#define SAMEGAME_CELL_SIZE   40
 

Definition at line 30 of file samegame.c.

#define SAMEGAME_EMPTY   0
 

Definition at line 36 of file samegame.c.

#define SAMEGAME_GP   3
 

Definition at line 39 of file samegame.c.

#define SAMEGAME_NUM_ANIM   8
 

Definition at line 28 of file samegame.c.

#define SAMEGAME_NUM_PIECES   (3*SAMEGAME_NUM_ANIM)
 

Definition at line 31 of file samegame.c.

#define SAMEGAME_RP   1
 

Definition at line 37 of file samegame.c.


Function Documentation

int getmove_real ( Pos * pos,
int x,
int y,
byte ** movp ) [static]
 

Definition at line 238 of file samegame.c.

Referenced by samegame_getmove(), and samegame_search().

void pull_down ( byte * board ) [static]
 

Definition at line 301 of file samegame.c.

Referenced by getmove_real().

void recursive_animgen ( byte * board,
int x,
int y,
int val,
int newval,
byte ** mp ) [static]
 

Definition at line 175 of file samegame.c.

Referenced by samegame_animate().

void recursive_delete ( byte * board,
int x,
int y,
int val ) [static]
 

Definition at line 288 of file samegame.c.

Referenced by getmove_real().

int samegame_animate ( Pos * pos,
byte ** movp ) [static]
 

Definition at line 198 of file samegame.c.

char** samegame_get_pixmap ( int idx,
int color ) [static]
 

Definition at line 357 of file samegame.c.

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

Definition at line 270 of file samegame.c.

void samegame_getxy ( byte * board,
int * x,
int * y ) [static]
 

Definition at line 394 of file samegame.c.

Referenced by samegame_search().

void samegame_init ( )
 

Definition at line 80 of file samegame.c.

void* samegame_newstate ( Pos * pos,
byte * move ) [static]
 

Definition at line 154 of file samegame.c.

int samegame_over ( byte * board )
 

Definition at line 121 of file samegame.c.

Referenced by samegame_who_won().

void samegame_search ( Pos * pos,
byte ** movp ) [static]
 

Definition at line 385 of file samegame.c.

void samegame_set_init_pos ( Pos * pos )
 

Definition at line 73 of file samegame.c.

ResultType samegame_who_won ( Pos * pos,
Player to_play,
char ** commp ) [static]
 

Definition at line 140 of file samegame.c.

byte* synth_move ( byte * newboard,
byte * board ) [static]
 

Definition at line 341 of file samegame.c.

Referenced by getmove_real().


Variable Documentation

Game Samegame
 

Initial value:

 { SAMEGAME_CELL_SIZE, SAMEGAME_BOARD_WID, SAMEGAME_BOARD_HEIT, 
        SAMEGAME_NUM_PIECES, 
        samegame_colors, NULL,  NULL, 
        "Samegame", 
        samegame_init}

Definition at line 45 of file samegame.c.

int anim_curx = -1 [static]
 

Definition at line 71 of file samegame.c.

int anim_cury = -1 [static]
 

Definition at line 71 of file samegame.c.

byte animgen_buf[SAMEGAME_BOARD_WID * SAMEGAME_BOARD_HEIT] [static]
 

Definition at line 173 of file samegame.c.

char samegame_colors[6] = {50, 50, 50, 50, 50, 50}
 

Definition at line 41 of file samegame.c.

char* samegame_score_field_names[] = {"Rank", "User", "Score", "Time", "Date", NULL}
 

Definition at line 57 of file samegame.c.

SCORE_FIELD samegame_score_fields[] = {SCORE_FIELD_RANK, SCORE_FIELD_USER, SCORE_FIELD_SCORE, SCORE_FIELD_TIME, SCORE_FIELD_DATE, SCORE_FIELD_NONE}
 

Definition at line 56 of file samegame.c.

Samegame_state state = {0} [static]
 

Definition at line 152 of file samegame.c.