This is the doxygen documentation for gtkboard.

.
Main Page   Data Structures   File List   Data Fields   Globals  

memory.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 "../pixmaps/memory.xpm"

Go to the source code of this file.

Data Structures

struct  Memory_state

Defines

#define MEMORY_CELL_SIZE   48
#define MEMORY_NUM_PIECES   72
#define MEMORY_BOARD_WID   9
#define MEMORY_BOARD_HEIT   8
#define MEMORY_EMPTY   0
#define MEMORY_ISOPEN(x)   ((x)>MEMORY_NUM_PIECES/2)
#define MEMORY_FLIP(x)

Functions

void memory_init ()
int memory_getmove (Pos *, int, int, GtkboardEventType, Player, byte **, int **)
int memory_animate (Pos *pos, byte **movp)
void memory_set_init_pos (Pos *pos)
void* memory_newstate (Pos *, byte *)
ResultType memory_who_won (Pos *, Player, char **)
void memory_free ()

Variables

char** memory_pixmaps []
char memory_colors [9] = {220, 220, 180, 220, 220, 180, 0, 0, 0}
int* memory_init_pos = NULL
Game Memory
Memory_state state = {0, 0}
int waiting = 0


Define Documentation

#define MEMORY_BOARD_HEIT   8
 

Definition at line 33 of file memory.c.

#define MEMORY_BOARD_WID   9
 

Definition at line 32 of file memory.c.

#define MEMORY_CELL_SIZE   48
 

Definition at line 29 of file memory.c.

#define MEMORY_EMPTY   0
 

Definition at line 36 of file memory.c.

#define MEMORY_FLIP( x )
 

Value:

                ((x)>MEMORY_NUM_PIECES/2?\
                (x)-MEMORY_NUM_PIECES/2:(x)+MEMORY_NUM_PIECES/2)

Definition at line 38 of file memory.c.

Referenced by memory_animate().

#define MEMORY_ISOPEN( x )   ((x)>MEMORY_NUM_PIECES/2)
 

Definition at line 37 of file memory.c.

Referenced by memory_animate(), and memory_getmove().

#define MEMORY_NUM_PIECES   72
 

Definition at line 30 of file memory.c.


Function Documentation

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

Definition at line 220 of file memory.c.

void memory_free ( )
 

Definition at line 177 of file memory.c.

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

Definition at line 271 of file memory.c.

void memory_init ( )
 

Definition at line 148 of file memory.c.

void* memory_newstate ( Pos * pos,
byte * move )
 

Definition at line 182 of file memory.c.

void memory_set_init_pos ( Pos * pos ) [static]
 

Definition at line 256 of file memory.c.

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

Definition at line 208 of file memory.c.


Variable Documentation

Game Memory
 

Initial value:

 { MEMORY_CELL_SIZE, MEMORY_BOARD_WID, MEMORY_BOARD_HEIT, 
        MEMORY_NUM_PIECES, memory_colors,  NULL, memory_pixmaps, 
        "Memory", memory_init}

Definition at line 128 of file memory.c.

char memory_colors[9] = {220, 220, 180, 220, 220, 180, 0, 0, 0}
 

Definition at line 122 of file memory.c.

int* memory_init_pos = NULL
 

Definition at line 124 of file memory.c.

char** memory_pixmaps[]
 

Definition at line 41 of file memory.c.

Memory_state state = {0, 0} [static]
 

Definition at line 139 of file memory.c.

int waiting = 0 [static]
 

Definition at line 175 of file memory.c.