summaryrefslogtreecommitdiffstats
path: root/lib/Bot/Games/Game/Spook.pm
blob: bba3f412a3bf338c3f938522e1cfdbb107009e56 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl
package Bot::Games::Game::Spook;
use Moose;
use Games::Word qw/is_subpermutation/;
extends 'Bot::Games::Game::Ghostlike';

has '+help' => (
    default => "spook help",
);

sub valid_move {
    my $self = shift;
    my ($move) = @_;
    return is_subpermutation($self->state, uc($move))
        && length($self->state) + 1 == length($move);
}

1;