diff options
Diffstat (limited to 'lib/Bot/Games/Game/Spook.pm')
-rw-r--r-- | lib/Bot/Games/Game/Spook.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Bot/Games/Game/Spook.pm b/lib/Bot/Games/Game/Spook.pm index 2ec4e2e..5780953 100644 --- a/lib/Bot/Games/Game/Spook.pm +++ b/lib/Bot/Games/Game/Spook.pm @@ -8,20 +8,20 @@ has '+help' => ( default => "spook help", ); -command valid_move => { +command valid_move => sub { my $self = shift; my ($move) = @_; return is_subpermutation($self->state, uc($move)) && length($self->state) + 1 == length($move); -} +}; -command valid_word_from_state => { +command valid_word_from_state => sub { my $self = shift; my ($word) = @_; $word = uc join '', sort split(//, $word); my $state = join '', sort split(//, $self->state); return $word eq $state; -} +}; __PACKAGE__->meta->make_immutable; no Bot::Games::OO; |