1
0
mirror of https://github.com/tiyn/yeschess.git synced 2026-02-22 10:34:47 +01:00

documentation: updated the readme documentation

The readme was partly outdated.
I decided not to put in depth documentation into
the readme.
Additionally i added missing docstrings into posMoveDB
This commit is contained in:
TiynGER
2021-05-15 02:33:21 +02:00
parent 362d293fb1
commit 80772462da
3 changed files with 26 additions and 16 deletions

View File

@@ -15,6 +15,7 @@ let dbName = ""
let tableName = "posmoves"
proc initDB*(): void =
## Initialize the database with a table if it doesnt currently exist.
let db = open(dbConn, dbUser, dbPasswd, dbName)
db.exec(sql"""CREATE TABLE IF NOT EXISTS ? (
fen VARCHAR(100) NOT NULL,
@@ -30,6 +31,9 @@ proc initDB*(): void =
proc storeMove*(fen: string, move: string, white: bool, black: bool, draw: bool,
rating: int): void =
## Store a possible `move` done by a player with `rating` (0 for unknown)
## in a position described by `fen`.
## The result of the game is described by `white`, `black` and `draw`.
let db = open(dbConn, dbUser, dbPasswd, dbName)
var query = """
INSERT INTO ? (fen, move, white, black, draw, rating)