diff options
author | doy <doy@tozt.net> | 2009-01-25 19:21:45 -0500 |
---|---|---|
committer | doy <doy@tozt.net> | 2009-01-25 19:21:45 -0500 |
commit | c1806329bc1dfefb924dda60498af26a3740da92 (patch) | |
tree | e48db8321592414ebd031f3c3c5b2d368604fbfa /lib/Bot/Games/Game/24.pm | |
parent | 921b86c57141fcd56a9c07faa0581e50f29e1dfa (diff) | |
download | bot-games-c1806329bc1dfefb924dda60498af26a3740da92.tar.gz bot-games-c1806329bc1dfefb924dda60498af26a3740da92.zip |
stop using is_over to store the game end message
Diffstat (limited to 'lib/Bot/Games/Game/24.pm')
-rw-r--r-- | lib/Bot/Games/Game/24.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Bot/Games/Game/24.pm b/lib/Bot/Games/Game/24.pm index 79c36c6..ea4730b 100644 --- a/lib/Bot/Games/Game/24.pm +++ b/lib/Bot/Games/Game/24.pm @@ -35,8 +35,8 @@ augment turn => sub { my $eval = $self->evaluate($expr); if ($eval == 24) { - $self->is_over("$player wins!"); - return ''; + $self->is_over(1); + return "$player wins!"; } else { return "$expr = " . (defined($eval) ? $eval : 'undef'); @@ -45,8 +45,8 @@ augment turn => sub { command give_up => sub { my $self = shift; - $self->is_over($self->solution); - return; + $self->is_over(1); + return $self->solution; }; my @ops = ('+', '-', '*', '/'); |