I always found the code to do this WITH a loop quite funny in fact:
my $work = \$hash;
$work = \$$work-{$_} for @a;
$$work = 1;
An infinite sequence of ^ matches only itself
map{15[EMAIL PROTECTED],$x+1or print1 @x
while!$x{$x=vec·ÇðèÊê´í
Ãñvµ©,$x*2|$_@x1,4}++*$x;undef*x}0..2**15
hmm, the vector doesn't seem to be right - it doesn't work. It should be
map{15[EMAIL PROTECTED],$x+1or print1 @x
while!$x{$x=vec{|¬(®KÞXg[,$x*2|$_@x1,4}++*$x;undef*x}0..2**15
In article [EMAIL PROTECTED],
Allen, Greg [EMAIL PROTECTED] writes:
The output from the -l0[pn] solutions includes C-@ characters (pipe through
cat -v to see...):
admins:^@ root, administrator
[EMAIL PROTECTED]:^@ me
^@
ugh!
A sub-optimal fix:
-p0 s/(.*):(.*)/$_{$2:}.=
See also:
echo | perl -lpe 'print q'
which outputs:
}continue{print or die qq(-p destination: $!\n)
Golfers also use the fact that in a -p/-n program the next character
is a ;, for example
#!perl -alp0
s!.+!$;[EMAIL PROTECTED],$_}=%$z]=$z=$_.$[EMAIL PROTECTED],@F!eg;$_=pop@
as solution to
In article [EMAIL PROTECTED],
Bernie Cosell [EMAIL PROTECTED] writes:
On 1 Jul 2003 at 10:30, Ronald J Kimball wrote:
On Tue, Jul 01, 2003 at 05:15:09PM +0300, Vladi Belperchinov-Shabanski wrote:
my $id = 1 if $_ == 3;
[...]
This was an accidental feature that is now kept
In article [EMAIL PROTECTED],
Matthias Bauer [EMAIL PROTECTED] writes:
Hi everybody,
why is it that the following piece of code prints
three _different_ strings (in Perl 5.8)?
--8
sub bla() {
for my $i ( reverse 0 .. 5 ) {
$i = $i + 1;
print
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Ton Hospel) writes:
Notice by the way you can actually see what's happening like this:
perl -MO=Deparse -wle 'sub fun { print $_++ for reverse 1..3} BEGIN { fun}; fun'
3
2
1
BEGIN { $^W = 1; }
BEGIN { $/ = \n; $\ = \n; }
sub fun
In article [EMAIL PROTECTED],
Abigail [EMAIL PROTECTED] writes:
And this shows the behaviour is a bug. Running
$ perl -wle 'sub fun { print $_++ for reverse 1..3} BEGIN { fun}; fun'
gives:
3
2
1
4
3
2
But the code generated by Deparse doesn't
In article [EMAIL PROTECTED],
artist google [EMAIL PROTECTED] writes:
Hi,
I have this puzzle.
Given N numbers, N4, you have to sort the numbers.
The only operation permitted is you can rotate any
sequencial 4 numbers in reverse order. or you can
roate the entire list sequencially.
The monthly big perl golf tournament was delayed this month, but is
running now. You can measure your insanity levbel by playing
http://perlgolf.sourceforge.net/TPR/0/6/
In article [EMAIL PROTECTED],
Bart Lateur [EMAIL PROTECTED] writes:
On Thu, 18 Apr 2002 12:42:17 -0500, c. church wrote:
$hash{foo}{bar}{baz} is extrmely descriptive. I
like it. I can look in once place and see exactly what I need.
Yeah... but what I don't like, is that if I have
In article Pine.LNX.3.96.1020416171808.1438C-10@gentoo,
Stephen Turner [EMAIL PROTECTED] writes:
Am I the only person who gets more scared of Perl 6 the more he hears about
it?
Nope. What I've heard about it 'till now I don't particularly like.
It's very well possible that I'll
In article [EMAIL PROTECTED],
Dave Hoover [EMAIL PROTECTED] writes:
Stephen Turner wrote:
I think you're being too clever, Dave. Even plain text passwords would
prevent the I wonder what happens if I click on someone else's
name type
of misattribution, which is probably the most
In article Pine.LNX.3.96.1020311140016.25823A-10@gentoo,
Stephen Turner [EMAIL PROTECTED] writes:
On Fri, 8 Mar 2002, Stephen Turner wrote:
$x*1.11%10(~Jukka-50, Rick-51, Ton-52)
I've just discovered that this construction doesn't work inside an eval! The
reason
In article [EMAIL PROTECTED],
Rick Klement [EMAIL PROTECTED] writes:
Turn off the computer and go do something else that does not require
much thinking. I get most ideas in the shower, in bed just before I go
to sleep, or while riding a bike to/from work. (If anyone on fwp lives
In article [EMAIL PROTECTED],
Eugene van der Pijll [EMAIL PROTECTED] writes:
Turn off the computer and go do something else that does not require
much thinking. I get most ideas in the shower, in bed just before I go
to sleep, or while riding a bike to/from work. (If anyone on fwp
In article Pine.LNX.3.96.1020309163039.19505B-10@gentoo,
Stephen Turner [EMAIL PROTECTED] writes:
On Fri, 8 Mar 2002, Ton Hospel wrote:
PS: the entries in the scoreboard are not ordered by tie score.
It's the entry with do$0 that won (better tie-score)
Can someone say
In article [EMAIL PROTECTED],
Jason Purdy [EMAIL PROTECTED] writes:
Someone's gonna explain these, right? Man, I love learning this kinda stuff.
Last hole, I learned about pop vs. shift (saving two strokes) and after
seeing this e-mail and playing around with Perl, I see that -l
In article [EMAIL PROTECTED],
Eugene van der Pijll [EMAIL PROTECTED] writes:
En op 08 maart 2002 sprak Marcelo E. Magallon:
At some point I kept thinking about this in terms
of abcd - abbccd - xyz, where x=f(ab) and so on.
Me too. Did anyone else notice this:
~$ perl
Mm, I'm not sure all last results were processed, but the post-mortem
is on the site, so here we go.
MTV was very close I see. With a simple transformation he's at 47:
-l $_=pop;s;.;print,s,,$*1.11%10if/\G../,eg;eg
In article a6913g$k06$[EMAIL PROTECTED],
[EMAIL PROTECTED] (Ton Hospel) writes:
Mm, I'm not sure all last results were processed, but the post-mortem
is on the site, so here we go.
MTV was very close I see. With a simple transformation he's at 47:
-l $_=pop;s;.;print,s,,$*1.11
In article [EMAIL PROTECTED],
Chris Dolan [EMAIL PROTECTED] writes:
Isn't listing the number of [^\w\s] a little too big a hint? For
example, it might have given away the technique for TPR(0,0) since the
winners had so many \w characters. Maybe the leaderboard should just
In article a63vo3$_9e$[EMAIL PROTECTED],
[EMAIL PROTECTED] (Ton Hospel) writes:
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] writes:
It looks to me as thoughthe tiebreaker scores are in the wrong order.
To quote the rules:
This month's tiebreaker will favor the script
In article [EMAIL PROTECTED],
Griffith, Shaun [EMAIL PROTECTED] writes:
Apologies if this is old hat...
It seems that a lot of the responses missed the point.
---snip---
Changing the indent style is looking at the horizontal alignment of the
braces. The real issue is the
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] writes:
Andrew Savige schreef op 22 februari 2002:
#!/usr/bin/perl -l
[pop=~/.(?{$a=$a*36+(ord(lc$)-9)%39})/g];print$a
why do you need the [] ?
OK, I understand it now. The [] provides the list context
to force iteration of the
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] writes:
I have been involved in all 4 tournaments in the current series
(Santa, Ton, Get Even, TPR). So has Ton Hospel, and I would be
interested in hearing his opinion, as he produced both a
33-stroker and a 47-stroker in this game
In article [EMAIL PROTECTED],
John W. Krahn [EMAIL PROTECTED] writes:
Ton Hospel wrote:
mm, assuming a filter of lower case ascii input, nothing allowed to stderr,
my first attempt is 44 I think.
I've got one at 28 (if I'm counting correctly)
Impressive. that's about the size i
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] writes:
[EMAIL PROTECTED] wrote:
well, you can e.g. try to find a variant of:
-p /[aeiouy]?(?{$_ x=1~$.split$})/
that doesn't coredump. That could be a winner.
Ton, I *knew* you were still trying (as am I).
Maybe Ton and me are the
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] writes:
[EMAIL PROTECTED] wrote:
PS, did you know you can solve entry 5 in the Santa game with
-p }{$_=$.+1e9.$/^\ca
(hard control-A)
How about this?
printf%010d\n,$.,eugene: 21 strokes
-p }{$_=$.+1e9.$/^\ca
In article [EMAIL PROTECTED],
Jonathan E. Paton [EMAIL PROTECTED] writes:
On Fri, 1 Feb 2002 12:37:40 +0100, Jérôme Quelin wrote:
I mean, what the heck could a beginner do to improve
Eugene's solution?
What the heck can *anybody* do to improve Eugene's
solution?
I bet Eugene
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] writes:
Ronald J Kimball wrote:
$ is readonly; how about $ss;
Oh, All right!
-p !($|--
ya
ye
yi
yo
yu
yy
yc)ycd$ss$ss$s
ss$ss$s
ss$ss$s
ss$ss$s
ss$ss$s
ss$ss$s
ss$ss$s
ss$ss$s
ss$ss$s
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] writes:
Ton, if you can find the time, I would really appreciate a little
write-up on your unorthodoxy too. How come you knew about it,
why did you choose it instead of $. in your solution, and so on.
The thinking, heh ? Ok.
When i
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] writes:
Jean-Pierre Vidal wrote:
What is the definition of a beginner?
I think anybody is a beginner the first time (s)he plays golf.
Is this correct?
Well, I suppose it is up to the tournament host.
It will be interesting to see
And here is my entry with an improved golf score of 16. :)
#!/usr/bin/perl -lp
$.-1or$_.=v0
#!/usr/bin/perl -p0
s/$/\0/m
(use a hard \0)
Well, it's over, and the final results are in.
About 6 beginners tried, but only one succeeded in surviving hole 1, and
that person is therefore the clear winner: Dave Hoover
human.pl:276 strokes
shuffle.pl: 36 strokes
select.pl:37 strokes
total:
An updated page with a number of fixed facts and entries can be found
at http://a108.bauhuette.haw-hamburg.de/golf/challenge.html
In the tradition of the last 24 hours, here are the current best strokes
per hole:
hole 1: 64 spiff (a solution of length 59 is known)
hole 2: 35 Eugene van der Pijll, Spiff, Andrew Savige,
Marcus Holland-Moritz, Rick Klement
hole 3: 32 Spiff, Andrew Savige
In article a0opad$cul$[EMAIL PROTECTED],
[EMAIL PROTECTED] (Ton Hospel) writes:
In the tradition of the last 24 hours, here are the current best strokes
per hole:
hole 1: 64 spiff (a solution of length 59 is known)
hole 2: 35 Eugene van der Pijll, Spiff, Andrew Savige
New entries and new players keep tickling in, and even today someone
came up with a very new approach to human.pl, so i decided to extend
the deadline again. I don't want to keep doing that though, so I'll
close up things at newyear (2002/01/01 00:00:00 UT).
Current standing:
Spiff
Since there is still movement in the scores, I extended the deadline
to *at least* 2001/12/26 00:00:00 UT
Holes two and three show some interesting golfing. They seem to
have stabilised since yesterday though.
The first hole still seems to be the bane of most players, and no
beginner has yet
A reasonable amount of attempts has trickled into my mailbox (even
one by Santa), but most fail on hole 1 (remember, these numbers can
be *BIG). Only 4 people so far have a completed solution:
Suo 139
Eugene van der Pijll144
Llasse 145
Autrijus
A conversation about the santa-challenge on ircnet #perl led to our
own little copy of the tournament. Go to
http://a108.bauhuette.haw-hamburg.de/golf/challenge.html if you want to play.
In article 9vtfic$aqn$[EMAIL PROTECTED],
[EMAIL PROTECTED] (Ton Hospel) writes:
A conversation about the santa-challenge on ircnet #perl led to our
own little copy of the tournament. Go to
http://a108.bauhuette.haw-hamburg.de/golf/challenge.html if you want to play.
And I did
In article [EMAIL PROTECTED],
Yanick [EMAIL PROTECTED] writes:
On Thu, Dec 20, 2001 at 07:52:44PM +, Ton Hospel wrote:
A conversation about the santa-challenge on ircnet #perl led to our
own little copy of the tournament. Go to
http://a108.bauhuette.haw-hamburg.de/golf
In article [EMAIL PROTECTED],
Rick Delaney [EMAIL PROTECTED] writes:
Keith C. Ivey [EMAIL PROTECTED] writes:
I'm surprised no one submitted anything with 0 x10, but I
guess those always end up too long.
I tried a bit but the best I came up with was
#!/usr/bin/perl -pl
($c|=0
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
47 matches
Mail list logo