http://qs321.pair.com?node_id=711368

in reply to Re: Golf: Movie style code cracker.
in thread Golf: Movie style code cracker.

Update: I was too quick in awarding you the prize :( The code is not chosen fairly!

For a code length of 3, the chosen code will rarely contain a digit < 7. For a code length of 4, it will rarely contain a digit < 6; and so on.

It's not until you get to a code length 10, that all the digits are possible, even then (on the basis of quick tests), the higher digits will dominate choices. I don't think this is true for any other submission, though I cannot say I have checked them all scrupiously.

I declare your second attempt the winner beating my attempt by 6, and being eligable for the bonus of 10 for running for a tension building amount of time.

Originally, the 'bonus' was conceived as a 'penalty' (hence the +10 in a competition that is smallest wins), intended to penalise horribly slow solutions. But as everybody took it as a requirement to slow things down, and that actually turned out to be the harder (more stroke costly) thing to achieve, I let the misunderstanding stand.

Hence, I think your second attempt has a logical score of 61, though maybe you should take a penalty for never terminating for a code length 1? Others will have to decide that. In any case, well done++

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.
• Comment on Re^2: Golf: Movie style code cracker. (Updated)

Replies are listed 'Best First'.
Re^3: Golf: Movie style code cracker. (Updated)
by betterworld (Curate) on Sep 15, 2008 at 03:15 UTC
For a code length of 3, the chosen code will rarely contain a digit < 7. For a code length of 4, it will rarely contain a digit < 6; and so on.

I think that the third attempt also fixes the problems that you describe.

I seem to have payed too little attention to the output, especially for small codes, because the ensuing command prompt always hides the output (because \r sets the cursor to the beginning of the line). Placing an "; echo" after the command in a unix shell helps with this issue.

Re^3: Golf: Movie style code cracker. (Updated)
by ambrus (Abbot) on Sep 15, 2008 at 06:21 UTC

Just assume the door has a keypad with only six or eight buttons. I think that could be done in a movie.

I thought I had that covered by:

indicating the number of (numeric) digits

But I see that is at least not fully specified, if not ambiguous. It is hard to specify golf completely unabliguously.

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.