in reply to Re: Filling An Array
in thread Filling An Array

Incorrect. Includes B00, for example. (Besides, my map is still golfier. :-))

The PerlMonk tr/// Advocate

Replies are listed 'Best First'.
Re: Re: Re: Filling An Array
by jdporter (Paladin) on Apr 21, 2004 at 21:33 UTC
    Ack!
    @a = grep $_++, grep { (/.(..)/)[0] < 12 } 'A00'..'H11';
      You may be onto something for an obfu entry. For a little clearer use of grep, how about:
      @a = grep /[A-H](0[1-9]|1[0-2])/, 'A01'..'H12';
      ?

      The PerlMonk tr/// Advocate
        @a = grep /[A-H](0[1-9]|1[0-2])/, 'A01'..'H12';

        Why [A-H]?

        Gain 5 strokes:

        @a = grep /(0[1-9]|1[0-2])/, 'A01'..'H12';

        dave