From 749fda0ff38edbb3a16c40bc01e9a900e1a10975 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Wed, 13 Aug 2014 16:55:04 +0000 Subject: [PATCH] Add HHGTTG easter egg to math.pl --- PBot/VERSION.pm | 4 ++-- modules/math.pl | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index 0be5e40c..30b63caf 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,8 +13,8 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 776, - BUILD_DATE => "2014-08-11", + BUILD_REVISION => 777, + BUILD_DATE => "2014-08-13", }; 1; diff --git a/modules/math.pl b/modules/math.pl index 2d3e666f..dfb3ad47 100755 --- a/modules/math.pl +++ b/modules/math.pl @@ -17,6 +17,10 @@ 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/meaning of (life|existence|everything)?/42/gi; if($arguments =~ m/([\$`\|{}"'#@=])/) { $invalid = $1; @@ -45,4 +49,4 @@ if($@) { exit 1; } -print "$arguments = $response\n"; +print "$orig_arguments = $response\n";