Skip to content

pg_reversi

Reversi game implemented as a PostgreSQL extension.

pg_reversi · Reversi game implemented as a PostgreSQL extension.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
100618pg_reversipg_reversi1.0FEATUnknownC
Relationships
Requiresplpgsql

Usage

Sources:

pg_reversi implements a single Reversi game in database-global tables. Creating the extension drops and recreates turn, the misspelled board table boad, history, and num_seq; helper functions then mutate that shared state.

CREATE EXTENSION pg_reversi;
SELECT black(3, 2);
SELECT white(2, 2);
SELECT get_turn_boad_status();
TABLE boad;

black(x,y) and white(x,y) place stones, directional helpers determine flips, pass functions advance turns, and history records moves. The implementation is an educational PL/pgSQL program, not a reusable game model: there is no game identifier, player identity, row-level isolation, authorization layer, or concurrency protocol.

Installation is destructive to same-named objects in the target schema, and every session competes over one board. The reviewed code is abandoned and contains hand-written directional logic with unfinished comments. Use only in a disposable schema, revoke writes from untrusted roles, and do not install it in an application database with objects named turn, boad, history, or num_seq.

Table reader