NAME

Game::Sternhalma::Layout - which points of the star each seat count uses

SYNOPSIS

use Game::Sternhalma::Layout qw(points home_of why_not);

my @points = points(4);                   # 0, 1, 3, 4
my $home   = home_of(4, 1);               # 4
my $why    = why_not(4, 15);              # neighbouring points would share a hole

DESCRIPTION

The six points of the star are numbered 0 to 5 clockwise from the top. Two seats start at the top and the bottom; three at every other point, racing into the three empty ones; four at two opposite pairs side by side, leaving the other two empty; six everywhere. A seat's home is the point opposite its start. Seats take turns in seat order, which is clockwise.

Ten pieces a seat, or fifteen for two or three seats: a fifteen-piece start takes in the five holes of the hexagon in front of the point, and two neighbouring points would share one of them. Five cannot play.

FUNCTIONS

seat_counts

2, 3, 4 and 6.

points

points($seats)

The point each seat starts at, in seat order.

home_of

home_of($seats, $seat)

The point a seat is racing to.

pieces_ok

pieces_ok($seats, $pieces)

True when a game of that many seats can have that many pieces each.

why_not

why_not($seats, $pieces)

Why there can be no such game, or undef when there can.

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)