This is the doxygen documentation for gtkboard.

.
Main Page   Data Structures   File List   Data Fields   Globals  

fifteen.c File Reference

#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <stdlib.h>
#include <math.h>
#include <gdk/gdkkeysyms.h>
#include "game.h"
#include "aaball.h"

Go to the source code of this file.

Defines

#define FIFTEEN_CELL_SIZE   60
#define FIFTEEN_NUM_PIECES   16
#define FIFTEEN_BOARD_WID   4
#define FIFTEEN_BOARD_HEIT   4

Functions

void fifteen_init ()
void fifteen_set_init_pos (Pos *pos)
char** fifteen_get_pixmap (int idx, int color)
guchar* fifteen_get_rgbmap (int idx, int color)
int fifteen_getmove (Pos *pos, int x, int y, GtkboardEventType type, Player, byte **, int **)
int fifteen_getmove_kb (Pos *cur_pos, int key, Player glob_to_play, byte **move, int **)
void fifteen_free ()
ResultType fifteen_who_won (Pos *, Player, char **)
int fifteen_done (byte *board)
int fifteen_really_done (byte *board)
void fifteen_get_cur (byte *pos, int *x, int *y)
char** fifteen_pixmap_square_gen (char *col)

Variables

char fifteen_colors [6] = {220, 220, 220, 220, 220, 220}
int* fifteen_init_pos = NULL
Game Fifteen


Define Documentation

#define FIFTEEN_BOARD_HEIT   4
 

Definition at line 34 of file fifteen.c.

#define FIFTEEN_BOARD_WID   4
 

Definition at line 33 of file fifteen.c.

#define FIFTEEN_CELL_SIZE   60
 

Definition at line 30 of file fifteen.c.

#define FIFTEEN_NUM_PIECES   16
 

Definition at line 31 of file fifteen.c.


Function Documentation

int fifteen_done ( byte * board )
 

Definition at line 55 of file fifteen.c.

Referenced by fifteen_getmove().

void fifteen_free ( )
 

void fifteen_get_cur ( byte * pos,
int * x,
int * y )
 

Definition at line 94 of file fifteen.c.

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

Definition at line 222 of file fifteen.c.

guchar* fifteen_get_rgbmap ( int idx,
int color ) [static]
 

Definition at line 229 of file fifteen.c.

int fifteen_getmove ( Pos * pos,
int x,
int y,
GtkboardEventType type,
Player to_play,
byte ** movp,
int ** rmovep )
 

Definition at line 177 of file fifteen.c.

int fifteen_getmove_kb ( Pos * pos,
int key,
Player glob_to_play,
byte ** movp,
int ** rmovp ) [static]
 

Definition at line 116 of file fifteen.c.

void fifteen_init ( )
 

Definition at line 72 of file fifteen.c.

char** fifteen_pixmap_square_gen ( char * col )
 

Definition at line 209 of file fifteen.c.

Referenced by fifteen_get_pixmap().

int fifteen_really_done ( byte * board )
 

Definition at line 64 of file fifteen.c.

Referenced by fifteen_who_won().

void fifteen_set_init_pos ( Pos * pos ) [static]
 

Definition at line 149 of file fifteen.c.

ResultType fifteen_who_won ( Pos * pos,
Player to_play,
char ** commp )
 

Definition at line 104 of file fifteen.c.


Variable Documentation

Game Fifteen
 

Initial value:

 { FIFTEEN_CELL_SIZE, FIFTEEN_BOARD_WID, FIFTEEN_BOARD_HEIT, 
        FIFTEEN_NUM_PIECES, fifteen_colors,  NULL, NULL, "Fifteen Puzzle", fifteen_init}

Definition at line 42 of file fifteen.c.

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

Definition at line 36 of file fifteen.c.

int* fifteen_init_pos = NULL
 

Definition at line 38 of file fifteen.c.