summaryrefslogtreecommitdiffstats
path: root/lib/Bot/Games/Game/Superghost.pm
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-04-25 12:29:47 -0500
committerdoy <doy@tozt.net>2009-04-25 12:29:47 -0500
commitfd70eb77e3d8ef6f907eccdf0d9735a4280eef75 (patch)
tree35c5e21ae90b9566b5f592b54fc2c4cab40d4c9c /lib/Bot/Games/Game/Superghost.pm
parent82ce96adf83a63ee8b38cb6d711097ce379ee320 (diff)
downloadbot-games-fd70eb77e3d8ef6f907eccdf0d9735a4280eef75.tar.gz
bot-games-fd70eb77e3d8ef6f907eccdf0d9735a4280eef75.zip
fix up a bunch of challenging issues in the ghost games
Diffstat (limited to 'lib/Bot/Games/Game/Superghost.pm')
-rw-r--r--lib/Bot/Games/Game/Superghost.pm7
1 files changed, 7 insertions, 0 deletions
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;