summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-01-24 18:28:18 -0500
committerdoy <doy@tozt.net>2009-01-24 18:28:18 -0500
commite8e2c672e99c435b66cc4f2ccc7b198fc4ae91ca (patch)
treea482d29f0f60ae7f857398c3699e845183d42dea
parent42cfb4414eaa07ac9b4ec761bddb24dcf642b845 (diff)
downloadbot-games-e8e2c672e99c435b66cc4f2ccc7b198fc4ae91ca.tar.gz
bot-games-e8e2c672e99c435b66cc4f2ccc7b198fc4ae91ca.zip
split can leave empty leading/trailing fields, get rid of them
-rw-r--r--lib/Bot/Games/Game/24.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Bot/Games/Game/24.pm b/lib/Bot/Games/Game/24.pm
index 63221f3..a991126 100644
--- a/lib/Bot/Games/Game/24.pm
+++ b/lib/Bot/Games/Game/24.pm
@@ -27,7 +27,7 @@ augment turn => sub {
my $self = shift;
my ($player, $expr) = @_;
- my $numbers = join ',', sort split(/[-\+\*\/\(\)]+/, $expr);
+ my $numbers = join ',', sort grep { $_ } split(/[-\+\*\/\(\)]+/, $expr);
my $solution = join ',', sort split(' ', $self->state);
return "invalid numbers" unless $numbers eq $solution;