diff options
author | doy <doy@tozt.net> | 2008-12-18 03:27:14 -0500 |
---|---|---|
committer | doy <doy@tozt.net> | 2008-12-18 03:27:14 -0500 |
commit | 0c774a8d1d5c004e836ab2c4ae94bb884a325ffc (patch) | |
tree | df620a440d45a142a5d0206b76e6da51402a08b6 /lib/Bot/Games/Game/Spook.pm | |
parent | 51bb4508f38b376bb7d219da68c64f92a01ce492 (diff) | |
download | bot-games-0c774a8d1d5c004e836ab2c4ae94bb884a325ffc.tar.gz bot-games-0c774a8d1d5c004e836ab2c4ae94bb884a325ffc.zip |
add ghost, superghost, xghost, and spook games, based on the ghostlike superclass
Diffstat (limited to 'lib/Bot/Games/Game/Spook.pm')
-rw-r--r-- | lib/Bot/Games/Game/Spook.pm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Bot/Games/Game/Spook.pm b/lib/Bot/Games/Game/Spook.pm new file mode 100644 index 0000000..83b3890 --- /dev/null +++ b/lib/Bot/Games/Game/Spook.pm @@ -0,0 +1,18 @@ +#!/usr/bin/perl +package Bot::Games::Game::Spook; +use Moose; +use Games::Word qw/is_subpermutation/; +extends 'Bot::Games::Game::Ghostlike'; + +has '+help' => ( + default => "spook help", +); + +sub valid_move { + my $self = shift; + my ($move) = @_; + return is_subpermutation($self->state, $move) + && length($self->state) + 1 == length($move); +} + +1; |