Created
October 4, 2013 22:10
-
-
Save halkeye/6833663 to your computer and use it in GitHub Desktop.
Ugly code for generating random word and random character for a unittest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub rw { my $word = "$_[0]"; $word =~ s/(.)/rc($1)/ge; $word;} | |
sub rc { return ((rand(1)*2+1)%2) ? lc($_[0]): uc($_[0]); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment