#!perl

use 5.010;
use strict;
use warnings;

use Game::RoyalUr::Terminal;

our $VERSION = '0.02';

exit Game::RoyalUr::Terminal->run(@ARGV);

__END__

=head1 NAME

royalur - the Royal Game of Ur, in a terminal

=head1 SYNOPSIS

    royalur
    royalur --rules masters --level 2
    royalur --mode hotseat --route
    royalur --mode watch --pace 0.3
    royalur --seed 5f1c9a --first light --record game.txt

=head1 DESCRIPTION

Plays the Royal Game of Ur against the program, between two people, or the
program against itself. See L<Game::RoyalUr::Terminal> for how it is played
and L<Game::RoyalUr> for the game.

=head1 OPTIONS

=over 4

=item B<--mode> I<how>

C<bot>, you against the program, which is the default; C<hotseat>, two people
at one keyboard; C<watch>, the program against itself.

=item B<--rules> I<name>

C<finkel>, the default, or C<masters>. See L<Game::RoyalUr::Variant>.

=item B<--level> I<n>

How well the program plays, from 1. The top of the ladder by default. See
L<Game::RoyalUr::Bot>.

=item B<--side> I<which>

C<light>, the default, or C<dark>: your side against the program.

=item B<--first> I<who>

C<light> or C<dark> to say who moves first, or C<roll>, the default, to have
both sides throw the dice for it.

=item B<--seed> I<hex>

Hexadecimal, two characters a byte. Every throw of the dice follows from the
seed, so the same seed and the same moves are the same game.

=item B<--pace> I<seconds>

How long a turn lost to the roll, and each move the program makes, stays on
the screen. 1 by default in a terminal.

=item B<--route>

Show, under the board, the order in which the side to move visits the
squares.

=item B<--record> I<file>

Write the game to a file when you leave, in the form
L<Game::RoyalUr::Notation> describes.

=item B<--replay> I<file>

Carry on from a game written by B<--record>.

=item B<--ascii>

Draw with plain letters and lines. B<--no-unicode> is the same.

=item B<--unicode>

Draw with line and shape characters. That is the default in a terminal; this
asks for it anywhere else.

=item B<--no-colour>

No colour. Pieces, rosettes and marks are shapes as well as colours, so
nothing is lost. B<--no-color> is the same, and so is setting C<NO_COLOR> in
the environment.

=item B<--no-pick>

Type moves instead of choosing them with the arrow keys.

=item B<--version>, B<--help>

Say so and stop.

=back

=head1 EXIT STATUS

0 when the game was left in the ordinary way, 2 when the options were wrong
or a file could not be read.

=head1 AUTHOR

LNATION <email@lnation.org>

=head1 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)

=cut
