From: timriker Date: Mon, 28 Feb 2005 23:50:24 +0000 (+0000) Subject: don't die on words like 'seen' X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=2d7ab9ca824683ae196db58aa4a9357dca3405f5;p=infobot.git don't die on words like 'seen' git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@1194 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/blootbot/src/Modules/scramble.pl b/blootbot/src/Modules/scramble.pl index de652bb..fbe91c5 100644 --- a/blootbot/src/Modules/scramble.pl +++ b/blootbot/src/Modules/scramble.pl @@ -41,13 +41,12 @@ sub scramble { # non-random shuffle, but good enough ($new_middle = $middle) =~ s/(.)(.)/$2$1/g; - last; } # shuffle the middle letters $new_middle = join "", List::Util::shuffle(split //, $middle); } - while ($middle eq $new_middle); + while (($cnt < 10) && ($middle eq $new_middle)); # add the word to the list... $scrambled .= "$first$new_middle$last ";