summaryrefslogtreecommitdiffstats
path: root/lib/Bot/Games/Game/24.pm
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-01-25 19:21:45 -0500
committerdoy <doy@tozt.net>2009-01-25 19:21:45 -0500
commitc1806329bc1dfefb924dda60498af26a3740da92 (patch)
treee48db8321592414ebd031f3c3c5b2d368604fbfa /lib/Bot/Games/Game/24.pm
parent921b86c57141fcd56a9c07faa0581e50f29e1dfa (diff)
downloadbot-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.pm8
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 = ('+', '-', '*', '/');