This is the doxygen documentation for gtkboard.
.#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include "game.h"
#include "../pixmaps/chess.xpm"
#include "move.h"
Go to the source code of this file.
Data Structures | |
struct | Chess_state |
Defines | |
#define | CHESS_CELL_SIZE 54 |
#define | CHESS_NUM_PIECES 12 |
#define | CHESS_BOARD_WID 8 |
#define | CHESS_BOARD_HEIT 8 |
#define | CHESS_EMPTY 0 |
#define | CHESS_WK 1 |
#define | CHESS_WQ 2 |
#define | CHESS_WR 3 |
#define | CHESS_WB 4 |
#define | CHESS_WN 5 |
#define | CHESS_WP 6 |
#define | CHESS_BK 7 |
#define | CHESS_BQ 8 |
#define | CHESS_BR 9 |
#define | CHESS_BB 10 |
#define | CHESS_BN 11 |
#define | CHESS_BP 12 |
#define | A_FILE 0 |
#define | B_FILE 1 |
#define | C_FILE 2 |
#define | D_FILE 3 |
#define | E_FILE 4 |
#define | F_FILE 5 |
#define | G_FILE 6 |
#define | H_FILE 7 |
#define | RANK_1 0 |
#define | RANK_2 1 |
#define | RANK_3 2 |
#define | RANK_4 3 |
#define | RANK_5 4 |
#define | RANK_6 5 |
#define | RANK_7 6 |
#define | RANK_8 7 |
#define | CHESS_ISWHITE(x) (x >= 1 && x <= 6) |
#define | CHESS_ISBLACK(x) (x >= 7 && x <= 12) |
#define | abs(x) ((x) < 0 ? -(x) : (x)) |
Functions | |
void | chess_init () |
int | chess_getmove (Pos *, int, int, GtkboardEventType, Player, byte **, int **) |
ResultType | chess_who_won (Pos *, Player, char **) |
byte* | chess_movegen (Pos *) |
ResultType | chess_eval (Pos *, Player, float *) |
void* | chess_newstate (Pos *, byte *) |
void | chess_reset_uistate () |
int | isfreeline (byte *pos, int oldx, int oldy, int newx, int newy) |
int | islegal (Pos *pos, int oldx, int oldy, int x, int y) |
int | oppcolor (byte *board, int oldx, int oldy, int x, int y) |
gboolean | is_in_check (Pos *pos, Player player) |
gboolean | leads_to_check (byte *board, byte *move, Player player) |
Would "player" be in check after making "move". | |
int | hasmove (Pos *pos, int player) |
int | chess_movegen_square (byte *board, byte **movp, int player, int oldx, int oldy, int x, int y) |
int | chess_movegen_line (byte *pos, byte **movp, int player, int x, int y, int incx, int incy) |
void | chess_movegen_promote (byte *board, byte **movp, int player, int oldx, int oldy, int x, int y) |
void | chess_movegen_enpassant (Pos *pos, byte **movp, int player, int x, int y) |
void | chess_movegen_castle (Pos *pos, byte **movp, int player) |
float | getweight (byte val) |
Variables | |
char | chess_colors [] |
int | chess_init_pos [] |
int | chess_max_moves = 200 |
char** | chess_pixmaps [] |
Game | Chess |
int | oldx = -1 |
int | oldy = -1 |
int | oldval = -1 |
int | prom = 0 |
int | prom_x |
int | prom_oldx |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 67 of file chess.c. Referenced by chess_getmove(), chess_movegen(), chess_movegen_square(), hasmove(), is_in_check(), and oppcolor(). |
|
Definition at line 66 of file chess.c. Referenced by chess_getmove(), chess_movegen(), chess_movegen_square(), hasmove(), is_in_check(), and oppcolor(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 723 of file chess.c. Referenced by chess_who_won(). |
|
Definition at line 620 of file chess.c. Referenced by chess_movegen(). |
|
Definition at line 589 of file chess.c. Referenced by chess_movegen(). |
|
Definition at line 547 of file chess.c. Referenced by chess_movegen(). |
|
Definition at line 563 of file chess.c. Referenced by chess_movegen(). |
|
Definition at line 523 of file chess.c. Referenced by chess_movegen(), and chess_movegen_line(). |
|
|
|
|
|
|
|
Definition at line 866 of file chess.c. Referenced by chess_eval(). |
|
|
|
Definition at line 299 of file chess.c. Referenced by chess_movegen_castle(), chess_who_won(), and leads_to_check(). |
|
Definition at line 187 of file chess.c. Referenced by islegal(). |
|
Definition at line 200 of file chess.c. Referenced by antichess_getmove(), can_capture(), chess_getmove(), hasmove(), and is_in_check(). |
|
Would "player" be in check after making "move".
Definition at line 328 of file chess.c. Referenced by chess_getmove(), chess_movegen_castle(), chess_movegen_enpassant(), chess_movegen_promote(), and chess_movegen_square(). |
|
Definition at line 290 of file chess.c. Referenced by antichess_movegen(), antichess_movegen_line(), and chess_movegen_line(). |
|
Initial value: { CHESS_CELL_SIZE, CHESS_BOARD_WID, CHESS_BOARD_HEIT, CHESS_NUM_PIECES, chess_colors, chess_init_pos, chess_pixmaps, "Chess", chess_init} |
|
Initial value: {200, 200, 130, 0, 140, 0} |
|
Initial value: { 9 , 11, 10, 8 , 7 , 10, 11, 9 , 12, 12, 12, 12, 12, 12, 12, 12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 3 , 5 , 4 , 2 , 1 , 4 , 5 , 3 , } |
|
|
|
Initial value: { chess_wk_54_xpm, chess_wq_54_xpm, chess_wr_54_xpm, chess_wb_54_xpm, chess_wn_54_xpm, chess_wp_54_xpm, chess_bk_54_xpm, chess_bq_54_xpm, chess_br_54_xpm, chess_bb_54_xpm, chess_bn_54_xpm, chess_bp_54_xpm, } |
|
|
|
|
|
|
|
|
|
|
|
|