NAME

Game::Senet::Move - one piece, one roll: where it goes and what it meets

VERSION

Version 0.02

SYNOPSIS

my @moves = $board->moves(3, 'kendall');
for my $move (@moves) {
    printf "%s from %d to %s%s\n", $move->side, $move->from, $move->to,
        $move->swap ? ', swapping' : '';
}

DESCRIPTION

A move the rules allow, as the engine describes it. It is a value: it is made by "moves" in Game::Senet::Engine and read, and nothing changes it.

A move does not make itself. It says which piece goes where, and whether an enemy piece stands there to be swapped.

METHODS

side

light or dark: whose piece moves.

roll

The roll, 1 to 5, the move was made for.

from

The house the piece stands on.

to

The house it goes to, or the word off when it bears off.

swap

1 when an enemy piece stands on to. It goes to from: the two pieces exchange houses.

back

1 for a backward move, which the rules allow only when no forward move exists.

off

1 when the piece bears off.

walk

1 when the piece landed by the walk down from house 15: the house it reached is 15, or the first empty house below it.

trace

A compact form for tests and for comparing one generator with another: the house moved from, > forward or < backward, the house moved to, and x for a swap. 22<20x is a backward move from 22 that swaps with the enemy on 20.

AUTHOR

LNATION <email@lnation.org>

LICENSE AND COPYRIGHT

This software is Copyright (c) 2026 by LNATION <email@lnation.org>.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)