| Did you know ... | Search Documentation: |
| Packs (add-ons) for SWI-Prolog |
| Title: | PGN and chess game databases. |
|---|---|
| Rating: | Not rated. Create the first rating! |
| Latest version: | 1.2 |
| SHA1 sum: | c87ffda3e2d924cc3cdc4afe8cd1b735f5a032d2 |
| Author: | Nicos Angelopoulos http://stoics.org.uk/~nicos |
| Maintainer: | Nicos Angelopoulos http://stoics.org.uk/~nicos |
| Packager: | Nicos Angelopoulos http://stoics.org.uk/~nicos |
| Home page: | http://stoics.org.uk/~nicos/sware/chess_db |
| Download URL: | http://stoics.org.uk/~nicos/sware/packs/chess_db/chess_db-*.tgz |
No reviews. Create the first review!.
| Version | SHA1 | #Downloads | URL |
|---|---|---|---|
| 1.2 | c87ffda3e2d924cc3cdc4afe8cd1b735f5a032d2 | 1 | https://stoics.org.uk/~nicos/sware/packs/chess_db/chess_db-1.2.tgz |
| 1.0 | 8dfed54a5611323cede4b5dd9b522a73348106c0 | 52 | http://stoics.org.uk/~nicos/sware/packs/chess_db/chess_db-1.0.tgz |
| https://stoics.org.uk/~nicos/sware/packs/chess_db/chess_db-1.0.tgz | |||
| 0.3 | 35b4755ecc6d361904d6bed11126a8f564989a17 | 28 | http://stoics.org.uk/~nicos/sware/packs/chess_db/chess_db-0.3.tgz |
| 0.2 | 3bd8052512d41a45f6072f19a4907b88d823328c | 3 | http://stoics.org.uk/~nicos/sware/packs/chess_db/chess_db-0.2.tgz |
| 0.1 | 1829d2627d8305958d238f66c278e9eb9e184318 | 1 | http://stoics.org.uk/~nicos/sware/packs/chess_db/chess_db-0.1.tgz |
This library produces chess games databases from PGN files and provides some predicates for manipulating these databases.
Once connected to a number of chess_db databases, all kinds of information about the games can be interrogated. See chess_db_opening/2 for an example.
Ideally we want to hook this pack to a web-page interface for playing the games as we select them.
?- pack_install(chess_db).
The pack includes code to:
There are two example databases in data/ and an example program, examples/short.pl.
These are all stoics packs available from SWI-Prolog pack installer:
Pack lib, is the only dependency installed with chess_db. The rest will be installed on first run (code in
pack(lib)).
By default, chess database dirs contain 3 sqlite databases:
game_info(Gid,Key,Val) info about each gamegame_move(Gid,Num,Turn,Move)game_orig(Gid,Orig); where Orig is the verbatim of the section in the PGN for that gameA number of databases can be connected at the same time.
For example a number of databases can be declared in dir/1 terms within file:
~/.pl/chess_db_connect.pl see options_append/3.
?- [pack('chess_db/examples/short.pl')].
?- short. % creates a chess_db in subdirectory short/ from data/4ncl_short.pgn
% and displays the game ids for games that start with [e4,e6] (French defence)
...
?- french. % creates a new pgn file from the base for the 2 games in short/ that start with e4,e6
% Handles already exist, for chess_db directory: '/home/nicos/pl/packs/src/chess_db/examples/short'
gid(chdbs(<sqlite>(0x71b4f0),<sqlite>(0xe577f0),<sqlite>(0xe13400)):1)
gid(chdbs(<sqlite>(0x71b4f0),<sqlite>(0xe577f0),<sqlite>(0xe13400)):31)
writting_to_file(short/french.pgn)
true.
% open file french.pgn on program that can play the games
pack('chess_db/examples/short.pl')]pack(prosqlite), pack(db_facts), pack(stoics_lib), pack(options)Pack contains 57 files holding a total of 1.5M bytes.