blob: 3cc593e57f6b2d3aca24672fcaac1a082b123680 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
package Bot::Games::Game::Superghost;
use Bot::Games::OO;
extends 'Bot::Games::Game::Ghost';
has '+help' => (
default => "superghost help",
);
command valid_move => sub {
my $self = shift;
my ($move) = @_;
return uc(substr($move, 0, -1)) eq $self->state
|| uc(substr($move, 1)) eq $self->state;
}, formatter => 'Bool';
command valid_word_from_state => sub {
my $self = shift;
my ($word) = @_;
my $state = $self->state;
return uc($word) =~ /\Q$state\E/;
}, formatter => 'Bool';
__PACKAGE__->meta->make_immutable;
no Bot::Games::OO;
1;
|