Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Golf: Movie style code cracker.

by repellent (Priest)
on Sep 14, 2008 at 02:16 UTC ( [id://711213]=note: print w/replies, xml ) Need Help??


in reply to Golf: Movie style code cracker.

Here's my entry at 105 characters:
-l15e'split//,int rand 10**pop;print$a,map{(0..$_-1,$_+1..9)[rand 9]}@ +_ while++$i%4e4||@_&&($a.=shift@_)'

A check for correctness would be to print out each sequence on its own line and look for a triangle effect:
axxxx axxxx axxxx 1bxxx 1bxxx 1bxxx 12cxx 12cxx 12cxx 123dx 123dx 123dx 1234e 1234e 1234e 12345 12345 where a != 1, b != 2, c != 3, d != 4, e != 5 x = can be any digit

Replies are listed 'Best First'.
Re^2: Golf: Movie style code cracker.
by BrowserUk (Patriarch) on Sep 14, 2008 at 02:55 UTC

    A problem is that this always produces the same code: 4294967295?

    Which would be good for movie continuity I suppose, but the nerds would pick up on the number and complain bitterly :)


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Works for me. The inconsistency is most probably caused by non-portable code:
      (~0 & $a) != int($a)

      Fine! I've updated my entry by one extra character :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-04-18 19:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found