From 938561a2fb18cf2dfeabb488ba2842fa7b19aef7 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Fri, 23 Jan 2015 13:40:33 -0800 Subject: [PATCH] math.pl: add cbrt and add optional "the" to 42 question --- modules/math.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/math.pl b/modules/math.pl index 80276ff6..1503d3e6 100755 --- a/modules/math.pl +++ b/modules/math.pl @@ -7,7 +7,7 @@ my ($arguments, $response, $invalid); my @valid_keywords = ( 'sin', 'cos', 'tan', 'atan', 'exp', 'int', 'hex', 'oct', 'log', 'sqrt', 'floor', 'ceil', 'asin', 'acos', 'log10', 'sinh', 'cosh', 'tanh', 'abs', - 'pi', 'deg2rad', 'rad2deg', 'atan2' + 'pi', 'deg2rad', 'rad2deg', 'atan2', 'cbrt' ); if ($#ARGV < 0) @@ -19,7 +19,7 @@ if ($#ARGV < 0) $arguments = join(' ', @ARGV); my $orig_arguments = $arguments; -$arguments =~ s/answer.*question of life(,? the universe and everything)?\s?/42/gi; +$arguments =~ s/(the )*answer.*question of life(,? the universe and everything)?\s?/42/gi; $arguments =~ s/meaning of (life|existence|everything)?/42/gi; if($arguments =~ m/([\$`\|{}"'#@=?\[\]])/ or $arguments =~ m/(~~)/) {