Re: A new golf "Automatic Editing" has started

2003-08-29 Thread Daniel Tiefnig
Michael W Thelen wrote: For example, applying a substituion "a" -> "ab" would lead to an infinite substitution if the string contained "a". Hmm, never mind me, I guess I didn't read the rules very carefully... this is precluded by the restriction that the string will never grow larger than 255 cha

Re: A new golf "Reversi" has started

2003-11-22 Thread Daniel Tiefnig
Rick Klement wrote: $^H does not have the special properties that $^C does, but $^H does have an initial value of 256. Hmm. Does anyone know how to explain the following? $ perl -le 'print$^H' 0 $ perl -le 'print$^H++' 256 One could guess now $^H is set to 256 just when a modification is attempte

Re: Shortest non-numeric Perl expression for each number

2004-03-14 Thread Daniel Tiefnig
Ton Hospel wrote: For a good average: $X[0] = $a; Well, this gives $X[0] == '', at least on 5.8 here... (And I'm pretty sure it does too on 5.6.x.. :o) $X[1] = //; $X[2] = $^F++; $X[3] = $^F++; So, why not just $X[0] = $a++; $X[1] = $a++; $X[2] = $a++; $X[3] = $a++; Duh. :o) lg, daniel

Re: entries for triangle

2004-07-30 Thread Daniel Tiefnig
Jasper wrote: I wonder if we'll set a record for the number of entries for tri.pl At least, I've added my simple 38. Looking good so far. I just love those easy holes. :o) lg, daniel, can't stop thinking of 37 now.

Re: PBP

2006-01-19 Thread Daniel Tiefnig
Yanick Champoux wrote: > [EMAIL PROTECTED] said: >> Perhaps OT but having finished the PBP not too long ago and finding >> hardly any I couldn't live w/ (the bare 'else' aligned w/ the >> previous close curly - though I see his point), Hmm, so how does one write it correctly(tm)? Of course the bes

Re: New Golf

2007-01-02 Thread Daniel Tiefnig
Jasper wrote: > Can someone send me a link? Terje's old link has expired, and there > doesn't seem to be an equivalent on his currently > extant-but-hibernating minigolf site. http://terje2.frox25.no-ip.org/~golf-info/Book.html It's linked on http://perlgolf.sourceforge.net/ and google finds it

Re: simple golf for fun

2007-01-17 Thread Daniel Tiefnig
Ton Hospel wrote: > -p0 s/\G(.*)(.* )(?=\1.\2|$)//g > > This should be about as efficient as a simple regex approach gets. > It's also the shortest yet :-) It outputs starting from the first > line that can't be extended. No output means all lines work. If you're free to output whatever you want

Re: Just chipping in...

2007-11-23 Thread Daniel Tiefnig
Tuomo Salo wrote: This one has no performance issues and is even a little bit shorter. Yay! AND it does print lines in wrong order! :o) Doesn't it? It does for me. lg, daniel

Re: 答复: A challenge to explain the str ange results (under linux)

2008-06-12 Thread Daniel Tiefnig
Zhu Shanshan wrote: As you said, when I substituted "s/\r\n$//" with "chomp", it did work. After looking up the explanation of "chomp" in perldoc, I found "chomp", which I always used to remove the newline previous, removes any trailing string that corresponds to the current value of "$/". Hej,

Re: Another one-liner?

2009-06-24 Thread Daniel Tiefnig
Phil Carmody wrote: > I needed to remove blank-line-separated chunks of code from a text > file if those chunks contained any lines which were 'too long'. [...] > If you think how little it does, it's got to be one-linerable, no? Duh, wrong e-mail address, sorry if solutions show up twice now aft

Re: Another one-liner?

2009-06-24 Thread Daniel Tiefnig
Eirik Berg Hanssen wrote: >> I'm probably overlooking something silly, but >> >> perl -O0 -pe's/.{65535,}//' > > Newlines. Besides that I'm getting "Can't do {n,m} with n > m in regex" for values greater than 2^15 - 1 here. br, daniel

Re: Another one-liner?

2009-06-24 Thread Daniel Tiefnig
Phil Carmody wrote: > I needed to remove blank-line-separated chunks of code from a text > file if those chunks contained any lines which were 'too long'. [...] > If you think how little it does, it's got to be one-linerable, no? Here's one that does split on lines with whitespace too, but is muc

Re: Another one-liner?

2009-06-24 Thread Daniel Tiefnig
Phil Carmody wrote: > I needed to remove blank-line-separated chunks of code from a text > file if those chunks contained any lines which were 'too long'. [...] > If you think how little it does, it's got to be one-linerable, no? Should do the trick: perl -00 -ne'/.{65535}/||print' lg, daniel