From da36dca6178721b1c91b5e680d01e2595c2b1801 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 31 Oct 2009 15:27:49 -0500 Subject: prevent ridiculous numbers in 24 --- lib/Bot/Games/Game/24.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/Bot/Games') diff --git a/lib/Bot/Games/Game/24.pm b/lib/Bot/Games/Game/24.pm index b56db41..a353900 100644 --- a/lib/Bot/Games/Game/24.pm +++ b/lib/Bot/Games/Game/24.pm @@ -83,6 +83,7 @@ sub generate_24 { $n1 *= $val; $n2 = $n1 / $val; } + redo if $n1 >= 1000 || $n2 >= 1000; splice @nums, $index, 1, ('(', $n1, $op, $n2, ')'); } pop @nums; -- cgit v1.2.3-54-g00ecf