Skip to content


Subversion checkout URL

You can clone with
Download ZIP
tree: 1b37637108
Fetching contributors…

Cannot retrieve contributors at this time

64 lines (40 sloc) 1.707 kB
h1. Contents
This repository contains the following files:
* libpg2podg.sql
* libpgchess.sql - library for chess (requires libpg2podg)
h1. Quickstart
Start playing for the impatient.
h2. Computer v Computer quickstart
You have to be inside a psql session connected to a 9.0 database, and
running on a terminal which is UTF-8 capable. Then you just have to
\i start_pgchess.sql
\i play_pgchess_CvC.sql
and watch the game as it goes on.
The loop is multi-session, so just type CTRL-C to interrupt the
current move. You can restart from that move by including
play_pgchess_CvC.sql again.
h2. Computer v Human
As before, but you have to type instead:
\i start_pgchess.sql
\i play_pgchess_CvH.sql
and then when asked you have to type your move formatted as a string
of length, according to regexp
where the five characters are: the two coordinates of the starting
square, the class of the piece you are moving, and the two coordinates
of the ending square.
h2. Human v Computer
Like Computer v Human, with obvious modifications.
h1. libpg2podg
This is a library for 2-player open deterministic games ("2podg").
With "open" we mean that each player knows 100% of the game status,
while with "deterministic" we mean that the game rules do not involve
any random element, e.g., if the players are deterministic too then
the whole game is determined.
h1. libpgchess
This is a library to play a chess game on top of libpg2podg.
Please note that, although the game itself is deterministic, the AI
player is not deterministic: there is a small random component in the
score so that the player makes a "random" choice among equally
convenient moves.
Jump to Line
Something went wrong with that request. Please try again.