Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Golf: Movie style code cracker.

by repellent (Priest)
on Sep 14, 2008 at 02:16 UTC ( #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 (Pope) 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
Node Status?
node history
Node Type: note [id://711213]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2020-11-25 20:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?