|
My Project
|
#include "bit.h"#include "board.h"#include "const.h"#include "game.h"#include "search.h"#include "util.h"#include <ctype.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>Enumerations | |
| enum | { PARSE_OK = 0 , PARSE_END_OF_FILE = 1 , PARSE_INVALID_TAG = 2 , PARSE_INVALID_VALUE = 3 } |
Functions | |
| int | move_from_wthor (int x) |
| Coordinates conversion from wthor to edax. More... | |
| static int | move_to_wthor (int x) |
| Coordinates conversion from edax to wthor. More... | |
| static int | move_from_oko (int x) |
| Coordinates conversion from oko. More... | |
| void | game_init (Game *game) |
| Create an empty game. More... | |
| void | game_copy (Game *dest, const Game *src) |
| Game copy. More... | |
| bool | game_equals (const Game *game_1, const Game *game_2) |
| Test if two games are equal. More... | |
| bool | wthor_equals (const WthorGame *game_1, const WthorGame *game_2) |
| Test if two Wthor games are equal. More... | |
| bool | game_update_board (Board *board, int x) |
| update a board. More... | |
| static bool | game_update_player (Board *board, int x) |
| update a player. More... | |
| bool | game_get_board (const Game *game, const int ply, Board *board) |
| Get the board after 'ply' move. More... | |
| bool | game_check (Game *game) |
| Check a game. More... | |
| int | game_score (const Game *game) |
| Compute the final score of the game, for the initial player. More... | |
| void | text_to_game (const char *line, Game *game) |
| Convert a text (ascii) game to a Game. More... | |
| void | game_to_text (const Game *game, char *line) |
| Convert game to a text (ascii). More... | |
| void | oko_to_game (const OkoGame *oko, Game *game) |
| convert an allinf.oko game to a Game. More... | |
| void | wthor_to_game (const WthorGame *thor, Game *game) |
| convert a Wthor game to a Game. More... | |
| void | game_to_wthor (const Game *game, WthorGame *thor) |
| convert a Game to a Whor game. More... | |
| void | game_append_line (Game *game, const Line *line, const int from) |
| Build a game from an initial position and a move sequence. More... | |
| void | line_to_game (const Board *initial_board, const Line *line, Game *game) |
| Build a game from an initial position and a move sequence. More... | |
| void | game_read (Game *game, FILE *f) |
| Read a game from a binary file. More... | |
| void | game_write (const Game *game, FILE *f) |
| Write a game to a binary file. More... | |
| void | game_import_text (Game *game, FILE *f) |
| Read a game from a text file. More... | |
| void | game_export_text (const Game *game, FILE *f) |
| Write a game to a text file. More... | |
| void | game_import_wthor (Game *game, FILE *f) |
| Read a game from a Wthor file. More... | |
| void | game_export_wthor (const Game *game, FILE *f) |
| Write a game to a Wthor file. More... | |
| void | game_import_oko (Game *game, FILE *f) |
| Read a game from the "allinf.oko" file. More... | |
| static int | game_parse_ggf (FILE *f, char *tag, char *value) |
| Parse a ggf game. More... | |
| void | game_import_ggf (Game *game, FILE *f) |
| Read a game from the Generic Game Format (ggf) file. More... | |
| static const char * | parse_tag (const char *string, char *tag, char *value) |
| Parse a Tag/value ggf pair from a string. More... | |
| char * | parse_ggf (Game *game, const char *string) |
| Parse a ggf game from a string. More... | |
| void | game_export_ggf (const Game *game, FILE *f) |
| Write a game to the Generic Game Format (ggf) file. More... | |
| static int | game_parse_sgf (FILE *f, char *tag, char *value) |
| Parse a Smart Game Format (sgf) game. More... | |
| void | game_import_sgf (Game *game, FILE *f) |
| Read a game from a sgf file. More... | |
| void | game_save_sgf (const Game *game, FILE *f, const bool multiline) |
| Write a game to the Generic Game Format (ggf) file. More... | |
| void | game_export_sgf (const Game *game, FILE *f) |
| void | game_import_pgn (Game *game, FILE *f) |
| Read a game from a pgn file. More... | |
| void | game_export_pgn (const Game *game, FILE *f) |
| Write a game to a pgn file. More... | |
| void | game_export_eps (const Game *game, FILE *f) |
| Write a game to an eps file. More... | |
| void | game_export_svg (const Game *game, FILE *f) |
| void | game_rand (Game *game, int n_ply, Random *r) |
| Fill a game with some random moves. More... | |
| int | game_analyze (Game *game, Search *search, const int n_empties, const bool apply_correction) |
| Analyze an endgame. More... | |
| int | game_complete (Game *game, Search *search) |
| Terminate an unfinished game. More... | |
| anonymous enum |
| bool game_check | ( | Game * | game | ) |
| void game_export_eps | ( | const Game * | game, |
| FILE * | f | ||
| ) |
Write a game to an eps file.
| game | The input game. |
| f | The file stream. |
| void game_export_ggf | ( | const Game * | game, |
| FILE * | f | ||
| ) |
Write a game to the Generic Game Format (ggf) file.
| game | The output game. |
| f | The file stream. |
| void game_export_pgn | ( | const Game * | game, |
| FILE * | f | ||
| ) |
Write a game to a pgn file.
| game | The input game. |
| f | The file stream. |
| void game_export_sgf | ( | const Game * | game, |
| FILE * | f | ||
| ) |
| void game_export_svg | ( | const Game * | game, |
| FILE * | f | ||
| ) |
| void game_export_text | ( | const Game * | game, |
| FILE * | f | ||
| ) |
Write a game to a text file.
| game | The input game. |
| f | The file stream. |
| void game_export_wthor | ( | const Game * | game, |
| FILE * | f | ||
| ) |
Write a game to a Wthor file.
| game | The input game. |
| f | The file stream. |
Get the board after 'ply' move.
| game | Game. |
| ply | number of move. |
| board | output board. |
| void game_import_ggf | ( | Game * | game, |
| FILE * | f | ||
| ) |
Read a game from the Generic Game Format (ggf) file.
| game | The output game. |
| f | The file stream. |
| void game_import_oko | ( | Game * | game, |
| FILE * | f | ||
| ) |
Read a game from the "allinf.oko" file.
| game | The output game. |
| f | The file stream. |
| void game_import_pgn | ( | Game * | game, |
| FILE * | f | ||
| ) |
Read a game from a pgn file.
| game | The output game. |
| f | The file stream. |
| void game_import_sgf | ( | Game * | game, |
| FILE * | f | ||
| ) |
Read a game from a sgf file.
| game | The output game. |
| f | The file stream. |
| void game_import_text | ( | Game * | game, |
| FILE * | f | ||
| ) |
Read a game from a text file.
| game | The output game. |
| f | The file stream. |
| void game_import_wthor | ( | Game * | game, |
| FILE * | f | ||
| ) |
Read a game from a Wthor file.
| game | The output game. |
| f | The file stream. |
|
static |
Parse a ggf game.
From the current input stream, fill a tag/value pair.
| f | The file stream. |
| tag | The tag field. |
| value | The value field. |
|
static |
Parse a Smart Game Format (sgf) game.
From the current input stream, fill a tag/value pair.
| f | The file stream. |
| tag | The tag field. |
| value | The value field. |
Fill a game with some random moves.
| game | The output game. |
| n_ply | The number of random move to generate. |
| r | The random generator. |
| void game_read | ( | Game * | game, |
| FILE * | f | ||
| ) |
Read a game from a binary file.
| game | The output game. |
| f | The file stream. |
| void game_save_sgf | ( | const Game * | game, |
| FILE * | f, | ||
| const bool | multiline | ||
| ) |
Write a game to the Generic Game Format (ggf) file.
| game | The output game. |
| multiline | A flag to create a long text or a single line. |
| f | The file stream. |
| int game_score | ( | const Game * | game | ) |
Compute the final score of the game, for the initial player.
| game | An input game. |
| void game_to_text | ( | const Game * | game, |
| char * | line | ||
| ) |
Convert game to a text (ascii).
| game | The intput game. |
| line | A move sequence in ascii. |
convert a Game to a Whor game.
The wthor format is famous as all main event games are recorded into this format.
| game | An input game. |
| thor | The wthor output game. |
| bool game_update_board | ( | Board * | board, |
| int | x | ||
| ) |
update a board.
|
static |
update a player.
| void game_write | ( | const Game * | game, |
| FILE * | f | ||
| ) |
Write a game to a binary file.
| game | The input game. |
| f | The file stream. |
Build a game from an initial position and a move sequence.
| initial_board | Initial board. |
| line | Move sequence. |
| game | The output game. |
|
static |
Coordinates conversion from oko.
allinf.oko is an old base of games between kitty & early logistello.
| x | oko coordinate. |
| int move_from_wthor | ( | int | x | ) |
Coordinates conversion from wthor to edax.
| x | wthor coordinate. |
|
static |
Coordinates conversion from edax to wthor.
| x | edax coordinate. |
convert an allinf.oko game to a Game.
this was a serie of games played by early M. Buro's logistello against I. Durdanovic's programs.
| oko | A single input game. |
| game | The output game. |
| char * parse_ggf | ( | Game * | game, |
| const char * | string | ||
| ) |
Parse a ggf game from a string.
| game | The output game. |
| string | An input string. |
|
static |
Parse a Tag/value ggf pair from a string.
| string | An input string. |
| tag | The tag field. |
| value | The value field. |
| void text_to_game | ( | const char * | line, |
| Game * | game | ||
| ) |
Convert a text (ascii) game to a Game.
| line | A move sequence in ascii. |
| game | The output game. |