En réponse à Piers Cawley [EMAIL PROTECTED]:
Michael G Schwern [EMAIL PROTECTED] writes:
On Fri, Dec 07, 2001 at 10:36:50AM +1100, [EMAIL PROTECTED]
wrote:
--- Piers Cawley - 21
#!/usr/bin/perl -lp
$#='%010g'}{$_=$.
Shouldn't that be 20?
Nope. The space
BooK [EMAIL PROTECTED] writes:
En réponse à Piers Cawley [EMAIL PROTECTED]:
Michael G Schwern [EMAIL PROTECTED] writes:
On Fri, Dec 07, 2001 at 10:36:50AM +1100, [EMAIL PROTECTED]
wrote:
--- Piers Cawley - 21
#!/usr/bin/perl -lp
$#='%010g'}{$_=$.
Shouldn't
--- Keith C Ivey - 22
#! /usr/bin/perl -lp
}{$_=7e10+$.,s$.$$
Looks like I was the only one who didn't use printf on this
hole (other than Piers, but using $# is similar), and I was
only one stroke short of the winners.
I'm surprised no one submitted anything with 0
Piers and Karsten both found shorter multi-line solutions:
Piers:
Grr... that one line rule is *so* silly:
#!/usr/bin/perl -p0
$_=$1while/
(.+)^/ms
Karsten:
#!/usr/bin/perl -p0
$_=$1while/
(.*
)./s
Both of these are really 25 chars (counting the \n's within the program as
one char
En réponse à Keith C. Ivey [EMAIL PROTECTED]:
--- Keith C Ivey - 22
#! /usr/bin/perl -lp
}{$_=7e10+$.,s$.$$
Looks like I was the only one who didn't use printf on this
hole (other than Piers, but using $# is similar), and I was
only one stroke short of the
On Fri, 7 Dec 2001, BooK wrote:
En réponse à Keith C. Ivey [EMAIL PROTECTED]:
I'm surprised no one submitted anything with 0 x10, but I
guess those always end up too long.
Well, I tried a lot of thing with x10, like $-x10, because I wanted really
hard to use the magic features of ++
On Fri, 7 Dec 2001 10:58:03 +1100 , [EMAIL PROTECTED] (Andrew Savige)
wrote:
*** Hole 4 (mid.pl) ***
--- Piers Cawley - 25
#!/usr/bin/perl -p0
$_=$1while/.(^.+)^/ms
--- Rick Delaney - 25
#!/usr/bin/perl -p0
$_=$1while/.^(.+)^/sm
--- Karsten
Philip Newton schreef op 07 december 2001:
On Fri, 7 Dec 2001 10:58:03 +1100 , [EMAIL PROTECTED] (Andrew Savige)
wrote:
*** Hole 4 (mid.pl) ***
--- Piers Cawley - 25
#!/usr/bin/perl -p0
$_=$1while/.(^.+)^/ms
--- Rick Delaney - 25
Eugene van der Pijll wrote:
One of my more interesting tries on this hole was
int.5+($.-=2)/2||print for
Eugene
The one I did that I liked was
sub{shift,pop while@_2;print@_}-()
--
Rick Klement
Eugene van der Pijll [EMAIL PROTECTED] writes:
Philip Newton schreef op 07 december 2001:
On Fri, 7 Dec 2001 10:58:03 +1100 , [EMAIL PROTECTED] (Andrew Savige)
wrote:
*** Hole 4 (mid.pl) ***
--- Piers Cawley - 25
#!/usr/bin/perl -p0
$_=$1while/.(^.+)^/ms
---
On Dec 7, Rick Klement said:
sub{shift,pop while@_2;print@_}-()
@_=;shift,pop while@_2;print@_
--
Jeff japhy Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
** Look for Regular Expressions in Perl
Jeff 'japhy' Pinyan wrote:
On Dec 7, Rick Klement said:
sub{shift,pop while@_2;print@_}-()
@_=;shift,pop while@_2;print@_
shift() and pop() only default to @_ in a sub{} ...
(that's what I liked about it)
--
Rick Klement
On Dec 7, Rick Klement said:
Jeff 'japhy' Pinyan wrote:
On Dec 7, Rick Klement said:
sub{shift,pop while@_2;print@_}-()
@_=;shift,pop while@_2;print@_
shift() and pop() only default to @_ in a sub{} ...
(that's what I liked about it)
Oh, that's right. That's why I didn't use that
In article [EMAIL PROTECTED],
Eugene van der Pijll [EMAIL PROTECTED] writes:
int.5+($.-=2)/2||print for
You can use |0 for a short truncate.
Also interesting is the behaviour of --$.-$a++ and maybe --$.^$a++
for use in a grep or map, but i found nothing short enough based on
14 matches
Mail list logo