![]() |
|
Don't ask to ask, just ask | |
PerlMonks |
Re^3: Cryptogram Generatorby duggles (Acolyte) |
on Dec 11, 2007 at 00:20 UTC ( #656283=note: print w/replies, xml ) | Need Help?? |
I've been working on a cryptogram solver and discovered this post and found the code useful - I snagged the code for the fisher_yates_shuffle to grab one of my solved cryptograms to recreate one to work on solving and I found that in some instances one or two of the letters in $substit remained the same as it was originally. The line that checks for $i == $j does a next BUT $i keeps on counting down and effectively leaves the unchanged letter alone. I fixed it by incrementing $i before doing the next. I realize in some cases the shuffle results are okay if this happens, but in a cryptogram, it won't fly... ;-) Just thought I'd throw this info back out there just in case you or anyone else may have a need for the fix. Here's the modified sub:
thanks for the original post! I'm learning a little here and there about using perl to solve cryptos... it's gonna take a while, but it's fun!!!
Life is short, but it's wide -- Chuck Pyle
In Section
Code Catacombs
|
|