Saved Bookmarks
| 1. |
Solve : Default \ Standard Variables? |
|
Answer» Quote from: BC_Programmer on February 17, 2009, 06:38:06 PM ok then. lord...all that code for a random # generator, glad i use VB!Quote from: macdad- on February 17, 2009, 06:50:20 PM Quote from: BC_Programmer on February 17, 2009, 06:38:06 PMok then. Random number generator? Silly, it generates the text "The Perl Journal" Obfuscation works in any language. Here are some ways: 1. KEEP your code as mathematical as possible. NEVER leave a simple expression alone, ie (4+4), but rather turn it into (((1*3)+1) + ((100*((1*2)+2)) /(10*10))). Doing this will make your code unreadable real soon. an example of more or less un-purposely obfuscated code: Code: [Select]use strict; $| = 1; for (@ARGV) { s/(.?)(.*)(.\W*)$/$2/; print $1; my ( $l, @w ) = ( $3, reverse split // ); print splice @w, rand $#w - 1, 1 while $#w + 1; print "$l "; } print "\n"; takes it's arguments and generates a drunken text from it, for example: Hello! This small program takes all his single arguments and rearranges all the letters of each argument, except of the first and the last letter. This way, all sentences sound like drunken. Example: "think it is funny that people still understand this sentence" becomes: "I tnihk it is fnnuy taht pploee slitl usnretadnd tihs scnetnee" As another example: Code: [Select]use Time::HiRes 'usleep'; # to get usleep ++$|; # same as $| = 1, i.e. enabling autoflush $s='rekcah lreP rehtona tsuJ'; # "Just another Perl hacker", REVERSED @v=(65..90,97..122,32); # ASCII values for A-Z, a-z and a whitespace do{ do{ # setting $_ to a random letter from @v, printing it print $_ = sprintf '%c',$v[[emailprotected]]; # SLEEPING for a while usleep 2000; # printing \b, a backspace print"\b" #..while $_ is not the last letter of $s } while $_ ne substr $s,-1; # shortening $s by one, i.e. moving on to the next letter chop $s; # printing $_, i.e. the correct letter for that space #..while there's still something to print in $s } while $s which, when purposely obfuscated, becomes: Code: [Select]use Time::HiRes 'usleep';++$|;$s='rekcah lreP rehtona tsuJ';@v= (65..90,97..122,32);do{do{print$_=sprintf'%c',$v[[emailprotected]];usleep 2000;print"\b"}while$_ ne substr$s,-1;chop$s;print}while$s oh, nice one BC.... i just thought we were still on Rand # generators.. |
|