diff options
author | doy <doy@tozt.net> | 2009-01-24 18:28:18 -0500 |
---|---|---|
committer | doy <doy@tozt.net> | 2009-01-24 18:28:18 -0500 |
commit | e8e2c672e99c435b66cc4f2ccc7b198fc4ae91ca (patch) | |
tree | a482d29f0f60ae7f857398c3699e845183d42dea /lib/Bot/Games/Game | |
parent | 42cfb4414eaa07ac9b4ec761bddb24dcf642b845 (diff) | |
download | bot-games-e8e2c672e99c435b66cc4f2ccc7b198fc4ae91ca.tar.gz bot-games-e8e2c672e99c435b66cc4f2ccc7b198fc4ae91ca.zip |
split can leave empty leading/trailing fields, get rid of them
Diffstat (limited to 'lib/Bot/Games/Game')
-rw-r--r-- | lib/Bot/Games/Game/24.pm | 2 |
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; |