Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Practicing Obfuscation CODE

by cchampion (Curate)
on Jun 08, 2004 at 17:04 UTC ( #362436=note: print w/replies, xml ) Need Help??

in reply to Practicing Obfuscation CODE


perl -pe 's/eval/print/' | perl | perltidy

And here is the real code:

srand; my @c = ( 1 .. 90 ); my $i = 0; while ( $i < 5 ) { my $e = int( rand( $#c - $i ) ); my $u = $#c - $i; ( $c[$e], $c[$u] ) = ( $c[$u], $c[$e] ); print " $c[$u]\n"; $i++; }

All of the above could be easily replaced by


(That's something for the OP to think about.) :-P

Replies are listed 'Best First'.
Re^2: Practicing Obfuscation CODE
by Crackers2 (Parson) on Jun 14, 2004 at 06:52 UTC
    Your code is not equivalent to his though. You're missing the logic that makes sure all picked numbers are unique. Try changing the 90 to 10, it shouldn't take more than a few tries to get dupes with your code. Something like the below would work (though not very obfuscated):

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://362436]
[Corion]: marto: Heh - we've got the rain here, now. But it's only intermittently, not permanent. But funny that you should complain about rain ;)
[Discipulus]: rain? i dont remember it..
[marto]: and good news all round, Flash will die come 2020!
[Corion]: So who will be the saviour of the universe, then?!
[marto]: Corion++, asking the right questions
[marto]: the rain is back

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2017-07-26 10:55 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (390 votes). Check out past polls.