NAME
Game::Reversi::Move - one placement or one play, and what it turned
VERSION
Version 0.01
SYNOPSIS
my $move = Game::Reversi::Move->place($square, 'b');
my $move = Game::Reversi::Move->play($square, 'b', @flips);
$move->phase; # 'place' or 'play'
$move->square; # 0 .. 63
$move->colour; # 'b' or 'w'
$move->flips; # the squares that turned, in ray order
$move->name; # 'd4'
DESCRIPTION
Reversi has two kinds of move and they are not interchangeable. The first four plies are placements: a disc goes on one of the four centre squares and nothing turns. Everything after that is a play: a disc goes on any square that outflanks something, and at least one disc turns.
Keeping them apart as phase is deliberate. Collapsing them into one kind would make an opening placement indistinguishable from a play that happened to turn nothing, which is illegal after the opening, and the game log would lose the ability to explain itself.
The turned discs are called flips
Never line. The site that consumes this engine refuses any view carrying a key named line, among others, because that gate exists to stop a game leaking the bot's reading of the position. The name is a constraint from outside this distribution and it is not free to change.
METHODS
place
A placement: square and colour, turning nothing.
play
A play: square, colour and the squares it turns, which must not be empty.
phase, square, colour, flips
The attributes.
name
The algebraic name of the square, d4 and so on.
turned
How many discs the move turned.
stringify
The same as "name".
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.