This is the doxygen documentation for gtkboard.
.
#include "game.h"
#include "move.h"
#include "stack.h"
#include "engine.h"
#include <signal.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <unistd.h>
Go to the source code of this file.
Defines | |
#define | NUM_COMMANDS (sizeof (commands) / sizeof (commands[0])) |
Functions | |
byte* | engine_search (Pos *) |
void | reset_game_params () |
void | set_game_params () |
game specific initialization. | |
void | game_set_init_pos_def (Pos *) |
byte* | ab_dfid (Pos *, int) |
Alpha-beta search function (using depth first iterative deepening). | |
gboolean | engine_hup_cb () |
ResultType | engine_eval (Pos *pos, float *eval) |
void | engine_set_to_play (char *line) |
void | engine_take_move (char *line) |
void | engine_make_move () |
void | engine_new_game (char *gamename) |
void | engine_reset_game () |
void | engine_back_move () |
void | engine_forw_move () |
void | engine_msec_per_move (char *line) |
void | engine_who_won (char *line) |
void | engine_move_now (char *line) |
int | engine_timeout_cb () |
void | engine_cancel_move (char *line) |
void | execute_command (char *line) |
Parse the command and pass control to the corresponding function pointer. | |
gboolean | process_line () |
gboolean | channel_process_input () |
void | engine_poll () |
Functions that do the actual thinking must periodically call this function. More... | |
void | ignore () |
void | engine_main (int infd, int outfd) |
This is the main function for the engine. | |
Variables | |
int | board_wid |
int | board_heit |
int | opt_verbose |
gboolean | engine_flag |
Pos | cur_pos |
Game* | opt_game |
Game * | games [] |
int | num_games |
FILE* | engine_fin |
FILE * | engine_fout |
ResultType (* | game_eval_white )(Pos *, Player, float *) |
Eval fn for white (can be NULL, in which case game_eval will be used for both). | |
ResultType (* | game_eval_black )(Pos *, Player, float *) |
Eval fn for black (can be NULL, in which case game_eval will be used for both). | |
GIOChannel* | channel_in = NULL |
The input pipe is accessed through a GIOChannel so that we can register a callback for events. | |
gboolean | engine_stop_search = FALSE |
If an event occurs when we are thinking this will be set to TRUE so that we will know to stop thinking. | |
gboolean | cancel_move = FALSE |
Indicates whether we have to stop and return the move or stop and cancel the move. | |
int | time_per_move = 5000 |
Max time per move. alpha-beta will often return earlier than this. | |
Command | commands [] |
This structure defines the protocol. More... | |
GSList* | command_list = NULL |
Definition in file engine.c.
|
|
|
Alpha-beta search function (using depth first iterative deepening).
Definition at line 284 of file ab.c. Referenced by engine_search(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
This is the main function for the engine.
|
|
|
|
|
|
|
|
|
|
Functions that do the actual thinking must periodically call this function. It checks if new commands have arrived. Definition at line 361 of file engine.c. Referenced by ab_with_tt(), and ab_with_tt_incr(). |
|
|
|
Definition at line 400 of file engine.c. Referenced by engine_make_move(). |
|
|
|
|
|
|
|
|
|
Parse the command and pass control to the corresponding function pointer.
Definition at line 294 of file engine.c. Referenced by process_line(). |
|
|
|
|
|
Definition at line 318 of file engine.c. Referenced by channel_process_input(), and engine_poll(). |
|
Definition at line 236 of file ui.c. Referenced by engine_new_game(), main(), and ui_terminate_game(). |
|
game specific initialization.
Definition at line 354 of file ui.c. Referenced by engine_new_game(), main(), and ui_start_game(). |
|
|
|
|
|
Indicates whether we have to stop and return the move or stop and cancel the move.
|
|
The input pipe is accessed through a GIOChannel so that we can register a callback for events.
|
|
|
|
Initial value: { { "MSEC_PER_MOVE" , 1 , engine_msec_per_move}, { "SUGGEST_MOVE" , 0 , NULL}, { "TAKE_MOVE" , 1 , engine_take_move}, { "BACK_MOVE" , 1 , engine_back_move}, { "FORW_MOVE" , 1 , engine_forw_move}, { "MAKE_MOVE" , 1 , engine_make_move}, { "MOVE_NOW" , 1 , engine_move_now }, { "CANCEL_MOVE" , 1 , engine_cancel_move }, { "END_GAME" , 0 , NULL}, { "RESET_GAME" , 1 , engine_reset_game}, { "TO_PLAY" , 1 , engine_set_to_play}, { "SET_POSITION" , 0 , NULL}, { "NEW_GAME" , 1 , engine_new_game}, { "GET_EVAL" , 0 , NULL}, { "SET_HEUR" , 0 , NULL}, { "SET_STRATEGY" , 0 , NULL}, { "WHO_WON" , 1 , engine_who_won}, }
|
|
|
|
|
|
|
|
|
|
If an event occurs when we are thinking this will be set to TRUE so that we will know to stop thinking.
|
|
Eval fn for black (can be NULL, in which case game_eval will be used for both).
|
|
Eval fn for white (can be NULL, in which case game_eval will be used for both).
|
|
|
|
|
|
|
|
|
|
Max time per move. alpha-beta will often return earlier than this.
|