add pos_del function

This commit is contained in:
2023-07-07 15:53:57 +02:00
parent 7952a34c88
commit 120a459206
2 changed files with 13 additions and 0 deletions

View File

@@ -163,6 +163,18 @@ pos_t *pos_clear(pos_t *pos)
return pos;
}
/**
* pos_del() - delete a position.
* @pos: &position.
*/
void pos_del(pos_t *pos)
{
pieces_del(pos, WHITE);
pieces_del(pos, BLACK);
moves_del(pos);
pool_add(pos_pool, pos);
}
pos_t *pos_startpos(pos_t *pos)
{
static char *startfen="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";