summaryrefslogtreecommitdiffstats
path: root/lib/Bot/Games/Game
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2008-12-20 04:05:13 -0500
committerdoy <doy@tozt.net>2008-12-20 04:05:13 -0500
commit554790a0a6310306ff32cf2ee042aeb5fe58f06f (patch)
tree5f303d59b8ccf877fd2485113e6f0ef6604bd235 /lib/Bot/Games/Game
parent3c7576683cd34eff6f5c87a90f0cba93b72ac15f (diff)
downloadbot-games-554790a0a6310306ff32cf2ee042aeb5fe58f06f.tar.gz
bot-games-554790a0a6310306ff32cf2ee042aeb5fe58f06f.zip
override valid_word_from_state for spook
Diffstat (limited to 'lib/Bot/Games/Game')
-rw-r--r--lib/Bot/Games/Game/Spook.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Bot/Games/Game/Spook.pm b/lib/Bot/Games/Game/Spook.pm
index 1f2c5b7..626bada 100644
--- a/lib/Bot/Games/Game/Spook.pm
+++ b/lib/Bot/Games/Game/Spook.pm
@@ -15,6 +15,14 @@ sub valid_move {
&& length($self->state) + 1 == length($move);
}
+sub valid_word_from_state {
+ 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 Moose;