NAME
Game::Backgammon::Result - who won, by how much, and why it stopped
SYNOPSIS
my $r = $game->result;
$r->winner; # 'white'
$r->margin; # 'single', 'gammon' or 'backgammon'
$r->reason; # 'borne_off', 'resign', 'timeout', 'abandoned'
DESCRIPTION
margin_for($board, $winner) reads the margin off a finished position, so it can be tested from a built board rather than only at the end of a game.
The margin is recorded and multiplies nothing. points is offered for a caller keeping a match score; the engine never uses it, because a site rating games on Elo takes a win as a win.
METHODS
winner, margin, reason
loser
is_gammon, is_backgammon
points
1, 2 or 3, for a caller keeping a match score. The engine never calls it.
margin_for($board, $winner)
The margin a finished position implies, so it can be tested from a built board.