diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-11-02 18:48:55 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-11-02 18:48:55 -0600 |
commit | 79b1852f03e9c00baa50ae322ed611291ac0dc53 (patch) | |
tree | 69c64629d311a5d21685de1ef7f93db95862ab50 | |
parent | c148b68369373a4cedfc74472bd1357753e6c719 (diff) | |
download | bot-games-79b1852f03e9c00baa50ae322ed611291ac0dc53.tar.gz bot-games-79b1852f03e9c00baa50ae322ed611291ac0dc53.zip |
ignore whitespace in 24 solutions
-rw-r--r-- | lib/Bot/Games/Game/24.pm | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Bot/Games/Game/24.pm b/lib/Bot/Games/Game/24.pm index fcfe24b..e461a96 100644 --- a/lib/Bot/Games/Game/24.pm +++ b/lib/Bot/Games/Game/24.pm @@ -32,6 +32,7 @@ sub turn { my ($player, $expr) = @_; $self->add_player($player) unless $self->has_player($player); + $expr =~ s/\s//g; my $numbers = join ',', sort grep { $_ } split(/[-\+\*\/\(\)]+/, $expr); my $solution = join ',', sort split(' ', $self->state); return "invalid numbers" unless $numbers eq $solution; |