Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Obfusc.Lotto

by tucano (Scribe)
on May 31, 2004 at 11:45 UTC ( [id://357777]=obfuscated: print w/replies, xml ) Need Help??

Obfuscated random game of lotto.<br> My first script in perl! #!/usr/bin/perl srand; $i=0; @c=(1 .. 90); @q= ("frst", "scnd", "trz", "qrt", "qnt"); while ($i<5) {$e= int (rand ($#c-$i) ); $u=$#c-$i; print "index: $e "; ($c[$e],$c[$u])=($c[$u],$c[$e]); print"the $q[$i] n° is: $c[$u]\n";$i++;}

Replies are listed 'Best First'.
Re: Obfusc.Lotto
by Anonymous Monk on May 31, 2004 at 18:39 UTC

      He does say that it's his first script, so it is probably more obfuscated for him than it is for you or me or the majority of monks. (I admit, though, I had exactly the same reaction you did, but didn't say anything.)

      tucano, while you have arranged your code to appear as an "L" for "Lotto", obfuscated code is more than just arranging the program in a novel way. The idea is to make the code hard to read and understand, often by (ab)using little-known features in the language, though setting something up with lots of hairy regexes and the like can also qualify.

      My own two obfuscations in the Monastery "cheat" by using Lingua::Romana::Perligata -- both try feebly to hide what they're doing, but if one is fluent in the module, there wouldn't be too much work involved in figuring out what's going on (but at least a little). Making a design out of the code is rather secondary to the process (normally, though see camel code for a counterexample). Don't get discouraged! Keep on hacking.

        Actually, this is his SECOND post in obfu. The first one was ASCII tucano, which was later moved to CUFP, for lack of a better (worse) place for it.

        Therefore, I felt that tucano needed some guidance.

        HTH

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: obfuscated [id://357777]
Approved by PERLscienceman
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (None)
    As of 2024-04-25 01:13 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found