From 0c774a8d1d5c004e836ab2c4ae94bb884a325ffc Mon Sep 17 00:00:00 2001 From: doy Date: Thu, 18 Dec 2008 03:27:14 -0500 Subject: add ghost, superghost, xghost, and spook games, based on the ghostlike superclass --- lib/Bot/Games/Game/Superghost.pm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lib/Bot/Games/Game/Superghost.pm (limited to 'lib/Bot/Games/Game/Superghost.pm') diff --git a/lib/Bot/Games/Game/Superghost.pm b/lib/Bot/Games/Game/Superghost.pm new file mode 100644 index 0000000..13502ed --- /dev/null +++ b/lib/Bot/Games/Game/Superghost.pm @@ -0,0 +1,17 @@ +#!/usr/bin/perl +package Bot::Games::Game::Superghost; +use Moose; +extends 'Bot::Games::Game::Ghostlike'; + +has '+help' => ( + default => "superghost help", +); + +sub valid_move { + my $self = shift; + my ($move) = @_; + return uc(substr($move, 0, -1)) eq $self->state + || uc(substr($move, 1)) eq $self->state; +} + +1; -- cgit v1.2.3-54-g00ecf