RE: Puzzle: Warnings Golf

2004-09-14 Thread Gerber, Christopher J
I haven't been following the whole thread. How about something like this: X:\>perl -e "$a.a" X:\>perl -we "$a.a" Unquoted string "a" may clash with future reserved word at -e line 1. Useless use of concatenation (.) or string in void context at -e line 1. Name "main::a" used only once: possible

Re: Puzzle: Warnings Golf

2004-09-13 Thread Ala Qumsieh
--- Animator <[EMAIL PROTECTED]> wrote: > $ perl -we '$#%a' > > 4 bytes, 8 warnings = 2 warnings / bytes Too easy to be true :) > Alistair McGlinchy wrote: > > Puzzle: Write a one-liner longer than (say) 3 > bytes that can improve on 0.77 distinct warnings per > byte of code. The program should

Re: Puzzle: Warnings Golf

2004-09-13 Thread Animator
My first guess: $ perl -wle 'a+$#' Unquoted string "a" may clash with future reserved word at -e line 1. Use of $# is deprecated at -e line 1. Useless use of addition (+) in void context at -e line 1. Use of uninitialized value in addition (+) at -e line 1. Argument "a" isn't numeric in addition (

Re: Puzzle: Warnings Golf

2004-09-03 Thread Jed Davis
Jasvir Nagra <[EMAIL PROTECTED]> writes: > Actually that produces the same error message repeatedly. I think the > original definition takes that into account. Gah. Yes, on second reading, I see the "distinct". --Jed pgpStAQfMah3F.pgp Description: PGP signature

Re: Puzzle: Warnings Golf

2004-09-02 Thread Stefan `Sec` Zehl
On Thu, Sep 02, 2004 at 03:50 +0300, Juho Snellman wrote: > On Wed, Sep 01, 2004 at 08:34:32PM +0100, McGlinchy, Alistair wrote: > > Puzzle: Write a one-liner longer than (say) 3 bytes that can improve > > on 0.77 distinct warnings per byte of code. The program should be -c > > valid, output nothin

Re: Puzzle: Warnings Golf

2004-09-02 Thread Piers Cawley
Juho Snellman <[EMAIL PROTECTED]> writes: > On Wed, Sep 01, 2004 at 08:34:32PM +0100, McGlinchy, Alistair wrote: >> Puzzle: Write a one-liner longer than (say) 3 bytes that can improve >> on 0.77 distinct warnings per byte of code. The program should be -c >> valid, output nothing without -w and s

Re: Puzzle: Warnings Golf

2004-09-01 Thread Jasvir Nagra
Actually that produces the same error message repeatedly. I think the original definition takes that into account. A variation which generates many different error messages eventually (equally adhering to the letter if not the spirit): s p o i l e r perl -we '$a="a"; eval $a++ whil

Re: Puzzle: Warnings Golf

2004-09-01 Thread Juho Snellman
On Wed, Sep 01, 2004 at 08:34:32PM +0100, McGlinchy, Alistair wrote: > Puzzle: Write a one-liner longer than (say) 3 bytes that can improve > on 0.77 distinct warnings per byte of code. The program should be -c > valid, output nothing without -w and sound the alarm as much as > possible with -w. 4

Re: Puzzle: Warnings Golf

2004-09-01 Thread Jed Davis
"McGlinchy, Alistair" <[EMAIL PROTECTED]> writes: > Puzzle: Write a one-liner longer than (say) 3 bytes that can improve > on 0.77 distinct warnings per byte of code. The program should be -c > valid, output nothing without -w and sound the alarm as much as > possible with -w. It follows the lett

Re: Puzzle: Warnings Golf

2004-09-01 Thread Eirik Berg Hanssen
"McGlinchy, Alistair" <[EMAIL PROTECTED]> writes: [snip] > Puzzle: Write a one-liner longer than (say) 3 bytes that can improve > on 0.77 distinct warnings per byte of code. The program should be -c > valid, output nothing without -w and sound the alarm as much as > possible with -w. > > For those

Puzzle: Warnings Golf

2004-09-01 Thread McGlinchy, Alistair
Golfers, This list has been a tad quiet for a while so I thought I'd throw in a golfy puzzle. For some reason the keys on my keyboard temporarily rearranged themselves today and a quick one-liner I was writing didn't do what I expected; in fact it did nothing at all. So I added a -w flag and I