From fd70eb77e3d8ef6f907eccdf0d9735a4280eef75 Mon Sep 17 00:00:00 2001 From: doy Date: Sat, 25 Apr 2009 12:29:47 -0500 Subject: fix up a bunch of challenging issues in the ghost games --- lib/Bot/Games/Game/Superghost.pm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/Bot/Games/Game/Superghost.pm') diff --git a/lib/Bot/Games/Game/Superghost.pm b/lib/Bot/Games/Game/Superghost.pm index 0784698..d25bdf4 100644 --- a/lib/Bot/Games/Game/Superghost.pm +++ b/lib/Bot/Games/Game/Superghost.pm @@ -14,6 +14,13 @@ command valid_move => sub { || uc(substr($move, 1)) eq $self->state; }; +command valid_word_from_state => sub { + my $self = shift; + my ($word) = @_; + my $state = $self->state; + return uc($word) =~ /\Q$state\E/; +}; + __PACKAGE__->meta->make_immutable; no Bot::Games::OO; -- cgit v1.2.3-54-g00ecf