Classes | Macros | Typedefs | Functions
base.h File Reference
#include "game.h"
#include <stdbool.h>

Go to the source code of this file.

Classes

struct  WthorHeader
 Header for wthor files. More...
 
struct  WthorBase
 
struct  Base
 

Macros

#define foreach_wthorgame(wgame, wbase)   for ((wgame) = (wbase)->game ; (wgame) < (wbase)->game + (wbase)->header->n_games; ++(wgame))
 

Typedefs

typedef struct WthorHeader WthorHeader
 Header for wthor files. More...
 
typedef struct WthorBase WthorBase
 
typedef struct Base Base
 

Functions

void wthor_init (WthorBase *)
 Initialize a Wthor base. More...
 
bool wthor_load (WthorBase *, const char *)
 Load a wthor base. More...
 
bool wthor_save (WthorBase *, const char *)
 Save a wthor base. More...
 
void wthor_test (const char *, struct Search *)
 Test Search with a wthor base. More...
 
void wthor_eval (const char *, struct Search *, unsigned long long histogram[129][65])
 Test Eval with a wthor base. More...
 
void wthor_edaxify (const char *)
 Change players to "Edax (delorme)" and tourney to "Etudes" in a wthor base. More...
 
void base_init (Base *)
 Initialize a game database. More...
 
void base_free (Base *)
 Free resources of a game database. More...
 
bool base_load (Base *, const char *)
 Load a game database. More...
 
void base_save (const Base *, const char *)
 Save a game database. More...
 
void base_append (Base *, const Game *)
 Add a game to a game database. More...
 
void base_to_problem (Base *, const int, const char *)
 Convert a game database to a set of problems. More...
 
void base_to_FEN (Base *, const int, const char *)
 Convert a game database to a set of problems. More...
 
void base_analyze (Base *, struct Search *, const int, const bool)
 Base analysis. More...
 
void base_complete (Base *, struct Search *)
 Base analysis. More...
 
void base_unique (Base *)
 Make games unique in the game database. More...
 
void base_compare (const char *, const char *)
 Base Compare. More...
 

Detailed Description

Header file for game base management

Date
1998 - 2017
Author
Richard Delorme
Version
4.4

Macro Definition Documentation

◆ foreach_wthorgame

#define foreach_wthorgame (   wgame,
  wbase 
)    for ((wgame) = (wbase)->game ; (wgame) < (wbase)->game + (wbase)->header->n_games; ++(wgame))

Typedef Documentation

◆ Base

typedef struct Base Base

◆ WthorBase

typedef struct WthorBase WthorBase

◆ WthorHeader

typedef struct WthorHeader WthorHeader

Header for wthor files.

struct WthorHeader

Function Documentation

◆ base_analyze()

void base_analyze ( Base base,
Search search,
const int  n_empties,
const bool  apply_correction 
)

Base analysis.

Parameters
baseGame base.
searchSearch engine.
n_emptiesNumber of empties.
apply_correctionCorrect bad moves from the games.

◆ base_append()

void base_append ( Base base,
const Game game 
)

Add a game to a game database.

Parameters
baseGame base.
gameGame to add.

◆ base_compare()

void base_compare ( const char *  file_1,
const char *  file_2 
)

Base Compare.

Display the number of positions two base files have in common.

Parameters
file_1Game base file.
file_2Game base file.

◆ base_complete()

void base_complete ( Base base,
Search search 
)

Base analysis.

Parameters
baseGame base.
searchSearch engine.

◆ base_free()

void base_free ( Base base)

Free resources of a game database.

Parameters
baseGame base.

◆ base_init()

void base_init ( Base base)

Initialize a game database.

Parameters
baseGame base.

◆ base_load()

bool base_load ( Base base,
const char *  file 
)

Load a game database.

Parameters
baseGame base.
fileGame filename.

◆ base_save()

void base_save ( const Base base,
const char *  file 
)

Save a game database.

Parameters
baseGame base.
fileGame filename.

◆ base_to_FEN()

void base_to_FEN ( Base base,
const int  n_empties,
const char *  problem 
)

Convert a game database to a set of problems.

Parameters
baseGame base.
n_emptiesNumber of empties.
problemProblems filename.

◆ base_to_problem()

void base_to_problem ( Base base,
const int  n_empties,
const char *  problem 
)

Convert a game database to a set of problems.

Parameters
baseGame base.
n_emptiesNumber of empties.
problemProblems filename.

◆ base_unique()

void base_unique ( Base base)

Make games unique in the game database.

Parameters
baseGame base.

◆ wthor_edaxify()

void wthor_edaxify ( const char *  file)

Change players to "Edax (delorme)" and tourney to "Etudes" in a wthor base.

Parameters
fileWthor game file.

◆ wthor_eval()

void wthor_eval ( const char *  file,
Search search,
unsigned long long  histogram[129][65] 
)

Test Eval with a wthor base.

Given a wthor file, compare the result of a search to the theoretical scores.

Parameters
fileGame File.
searchSearch.
histogramoutput array.

◆ wthor_init()

void wthor_init ( WthorBase base)

Initialize a Wthor base.

Parameters
baseWthor's base.

◆ wthor_load()

bool wthor_load ( WthorBase base,
const char *  file 
)

Load a wthor base.

Parameters
baseWthor game base.
fileGame file.

◆ wthor_save()

bool wthor_save ( WthorBase base,
const char *  file 
)

Save a wthor base.

Parameters
baseWthor game base.
fileGame file name.

◆ wthor_test()

void wthor_test ( const char *  file,
Search search 
)

Test Search with a wthor base.

Parameters
fileGame File.
searchSearch.