[kw-pm] Last night's meeting

Justin Wheeler kw-pm at datademons.com
Fri Jun 19 08:25:55 PDT 2009


That doesn't fit the description of the GOLF -- it's supposed to re-randomise
the current random saved entry again and give it a chance based on the # of
entries.  This GOLF reads the entire file and then just grabs one of them.

Justin

On Fri, 19 Jun 2009, John Macdonald wrote:

> On Fri, Jun 19, 2009 at 10:55:25AM -0400, Daniel R. Allen wrote:
>> ...We had considered the ?:1 operator, on the board, but didn't see where
>> it got us. Clearly we didn't stare at it long enough.
>>
>> But turning rand()<1/++$n into rand++$n<1 into rand$.<1 is sheer genius
>> on both of your parts. Nicely done, John and Raymond.
>>
>> 29 strokes == winner?
>
> In my previous message, I talked about "cheating" by providing
> executable code that is not part of the char count in various
> ways (-M switch, and the filename).
>
> But that trick I played on the -n switch made me realize that
> using -n is similarly a cheat because it provides code that is
> not counted.
>
> So what is the best non-cheating char count?
>
> $ perl -e '@a=<>;print at a[rand(@a)]' <alpha.html
>
> That's better than the "cheating" we've been doing using -n!
>
> And then, it can be golfed down a bit more to:
>
> $ perl -e 'print at a[rand(@a=<>)]' <alpha.html
>
>
> So, that's down to 18 chars, with no supporting cheats of any kind.
> _______________________________________________
> kw-pm mailing list
> kw-pm at pm.org
> http://mail.pm.org/mailman/listinfo/kw-pm
>


More information about the kw-pm mailing list