Games::Catan is a suite of Perl libraries that simulate the popular board game Settlers of Catan. A game can be constructed and played by very primitive AI players by doing:
use Games::Catan;
my $catan = Games::Catan->new( num_players => 4 );
$catan->play();
The game board is constructed by utilizing a undirected graph data structure, which consists of vertices (intersections) and edges (paths) between them. The Graph Perl module is used internally. This graph can be visualized as follows:
Only a standard 3-4 player game board is currently supported. This consists of 54 total intersections, with 72 total edges between them, yielding 19 total tiles. The tiles are indexed as follows:
Tiles themselves are not an additional data structure, but simply a collection of intersections and edges.
Settlers of Catan is © Catan GmbH 2015 (http://www.catan.com)