The History of Acme::Bleach and Acme::EyeDrops

2012-05-02 Thread Andrew Savige
The story behind Acme::Bleach and its many cousins:  http://www.perlmonks.org/?node_id=967004 Feedback and anecdotes welcome. Thanks, /-\

Re: Secret operators: the documentation

2012-04-03 Thread Andrew Savige
I wonder if --$| and $|--, very popular in golf, and described by japhy as "the magical flip flop variable" at:  http://www.nntp.perl.org/group/perl.fwp/2002/01/msg1367.html qualifies as a secret operator? /-\

Re: The sperm secret operator: is it new?

2012-03-14 Thread Andrew Savige
> [ ~~ vs. scalar ] The ~~ secret operator is old hat, good ol' inchworm:  http://www.catonmat.net/blog/secret-perl-operators/#inchworm BooK's innovation is to add <> and <>+0 to the end of it. BTW, in addition to inchworm-on-a-stick ~- to subtract one, I often use the converse -~ to add one (t

Re: Rate my JAPH

2011-11-24 Thread Andrew Savige
This node:  http://perlmonks.org/?node_id=412464 claims that the first JAPH was simply (note the punctuation):  print "Just another Perl hacker," This ancient JAPH was penned in 1988 by a Portland Oregon hacker, currently sobering up after his wild 50th birthday party. /-\ - Original M

Re: Naming the @{[]} operator

2006-07-07 Thread Andrew Savige
--- Alan Young wrote: > I missed any discussion on this, and searching for this series of > characters is fruitless. Here's an attempt at a definitive reference list for Perl's secret operators. I blame cog and BooK. Original fwp thread on secret operators: http://www.mail-archive.com/fwp@perl.

Re: Converting dell tags to svc codes - itty-bitty golf, anyone?

2006-02-22 Thread Andrew Savige
--- Andy_Bach wrote: > Question came up elsewhere and via: > http://www.creativyst.com/Doc/Articles/HT/Dell/DellNumb.htm > > we found Dell uses base 36 for its Service tags. You need the decimal for > the automated phone access so somebody came up w/: > map {$s+=(/\d/?$_:(ord()-55))*(36**$i++)}

Re: "Secret" operators

2005-02-01 Thread Andrew Savige
Philippe 'BooK' Bruhat wrote: > So we have : > > symbolnicknameRole > -- > <=> spaceship documented operator > > 0+venus numification > }{eskimo greeting END{

Re: "Secret" operators

2005-02-01 Thread Andrew Savige
Not that it is seen very often, but you might try dreaming up a name for: ]->[ I first saw this operator employed in a graceful way to return the lesser of $x and $y: [ $x => $y ]->[ $y <= $x ] /-\ Find local movie times and trailers on Yahoo! Movies. http://au.movies.yahoo.com

Re: "Secret" operators

2005-02-01 Thread Andrew Savige
José Castro wrote: > Apart from the "secret eskimo greeting" and the "goatse operator", > can anyone tell me about other "secret" operators? Let's not forget the Ton Hospel "high-precedence decrement" operator ~- invented during a golf tournament (anyone remember which one?). IIRC, Ton's ~- inven

Re: Phalanx top 100 CPAN modules golf

2003-08-24 Thread Andrew Savige
Rick Klement wrote: > And replacing one map with a sort, taking advantage of the fact that > in 5.8, sort is stable, saves 10 strokes: #!perl -lp / /;$a{pack A10,$'}.=" $`"}for(sort{$b-$a}map$a{$_}=~y/ //. " $_:$a{$_}",sort keys a){ Very nice. Hmm, if: "map sort [SORT BLOCK]map" is the Sch

Re: Phalanx top 100 CPAN modules golf

2003-08-24 Thread Andrew Savige
> #!perl -lp > / /;$A{$'}.=$".$`}for(map{s}.}9-$&}e;$_}sort > map{9-$A{$_}=~y. ...sprintf" %-10s:$A{$_}",$_}keys%A){ Interesting sub-problem is shortest way to space-fill the CPAN ID: sprintf"%-10s",$_ pack A10,$_ uc($_^$"x10) The last works because CPAN IDs match /^[A-Z]{4,9}$/. Replacing

Phalanx top 100 CPAN modules golf

2003-08-22 Thread Andrew Savige
The Phalanx project top 100 CPAN modules has just been published: http://qa.perl.org/phalanx/distros.html To get a report sorted by most prolific author, I wrote this little program (using a good ol' GR-Transform): #!perl -lp / /;$A{$'}.=$".$`}for(map{s}.}9-$&}e;$_}sort map{9-$A{$_}=~y. ...sprin

merlyn smeared by Python Johnnies' description of Schwartzian transform

2003-07-16 Thread Andrew Savige
Perhaps I am posting this to wrong list, but that has become the norm lately. :-) I noticed on this page: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52234 titled "a guaranteed-stable sort with the decorate-sort-undecorate idiom (aka Schwartzian transform)" ---

Re: 99 bottles of beer on the wall

2003-06-01 Thread Andrew Savige
Ton Hospel wrote: > With a little more effort by mtve and me this becomes: > > sub > [EMAIL PROTECTED](abs||n.o,bottle."s"x!!++$_,of,beer),on,the,wall]}print > "@{+b},[EMAIL PROTECTED],\nTake one down, pass it around,[EMAIL PROTECTED]" > for-pop||-99..-1 Of the 515 languages represented at http://

Re: 99 bottles of beer on the wall

2003-05-27 Thread Andrew Savige
Ton Hospel wrote: > With a little more effort by mtve and me this becomes: > > sub > [EMAIL PROTECTED](abs||n.o,bottle."s"x!!++$_,of,beer),on,the,wall]}print > "@{+b},[EMAIL PROTECTED],\nTake one down, pass it around,[EMAIL PROTECTED]" > for-pop||-99..-1 > > (which also has the "no" for 0 bottles.

Re: Fun with RegExps

2003-02-19 Thread Andrew Savige
In case anyone is interested, I timed four of the solutions with one sample of valid test data, as shown below. use strict; use Benchmark; my $x = 'aBc123xyz'; sub make { local $_=$x; return /^[-\w]{6,14}$/ && /[0-9]/ && /[a-z]/ && /[A-Z]/; } sub sec { local $_=$x; return /^(?=.*[a-z])(?=.*[A-Z])(

Re: Fun with RegExps

2003-02-18 Thread Andrew Savige
Abigail sprak: > I'm not going to claim this is the shortest solution, but this > is very straightforward (and untested): > > /^(?=.{6})# At least 6 characters long. > (?=.*[a-z]) # Contains a lowercase letter. > (?=.*[A-Z]) # Contains an uppercase letter. > (

Re: Fun with RegExps

2003-02-17 Thread Andrew Savige
Stefan `Sec` Zehl sprak: > If you insist on it beeing a single regexp, I would do it with > several lookahead assertions ;-) > > print "ok" if /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[\w-]{6,14}$/ After eating sushi with chopsticks, then cleaning my teeth with toothpicks, I thought of this for some reaso

Re: Converting a textfile-like string to an array and back

2003-02-11 Thread Andrew Savige
Ian Phillipps sprak: > I just typed in 'Eugene' to check. > > eugene is the fastest and most pleasant > eugene is about the size of a dog > eugene is devastated > > But, most relevantly, > > eugene is right In my experience, Eugene (and Ton) are always right. I just noticed that Yitzchak's emai

Re: Converting a textfile-like string to an array and back

2003-02-10 Thread Andrew Savige
(-ugene sprak: > Andrew Savige schreef: > > Aristotle golfed: > > > $_=$x;@lines=(/^.*/mg)x+length; > > > > Against my better judgment, I will have a go at golfing this: > > > > $_=$x;@l=(/^.*/mg)x/./s > > This clobbers $_. Not nice for th

Re: Converting a textfile-like string to an array and back

2003-02-09 Thread Andrew Savige
Aristotle golfed: > $_=$x;@lines=(/^.*/mg)x+length; Against my better judgment, I will have a go at golfing this: $_=$x;@l=(/^.*/mg)x/./s /-\ http://greetings.yahoo.com.au - Yahoo! Greetings - Send some online love this Valentine's Day.

Re: Converting a textfile-like string to an array and back

2003-02-09 Thread Andrew Savige
Aristotle: > > @lines = ($x=~/^.*/mg) x !!length($x); > > $_=$x;@lines=(/^.*/mg)x+length; *whistle* *whistle* *red card* *disqualified* multiplying by length (x+length) will not give the desired result here; it must be boolean (0 or 1 only). /-\ http://greetings.yahoo.com.au - Yahoo! Gre

Re: Converting a textfile-like string to an array and back

2003-02-09 Thread Andrew Savige
John Douglas Porter: > @lines = length($x) ? $x=~/^(.*)$/mg : (); @lines = ($x=~/^.*/mg) x !!length($x); @lines = ($x=~/^.*/mg) x ($x ne ""); This line of play looks promising for golf. /-\ http://greetings.yahoo.com.au - Yahoo! Greetings - Send some online love this Valentine's Day.

Re: Converting a textfile-like string to an array and back

2003-02-09 Thread Andrew Savige
John Douglas Porter wrote: > @lines = length($x) ? $x=~/^(.*)$/mg : (); ^ ^^ unnecessary This is a little faster: @lines = length($x) ? $x=~/^.*/mg : (); /-\ http://greetings.yahoo.com.au - Yahoo! Greetings - Send some online love th

Re: Converting a textfile-like string to an array and back

2003-02-09 Thread Andrew Savige
Yitzchak Scott-Thoennes wrote: > Sigh. I'd call that a bug if someone hadn't gone to the trouble to > test for it and document it. (Indeed, I see a bug report out there: > #6653, was 20010327.008.) So do something like: > > my @lines; > chomp(my $tmp=$x); > @lines = split /\n/,$tmp,-1 or @lines=

Re: Converting a textfile-like string to an array and back

2003-02-08 Thread Andrew Savige
To convert the other way is simpler and I'm struggling to find alternatives to my original join solution. The only edge case I can think of is empty array @lines. You may assume that no item of @lines contains "\n". Benchmark program follows. use strict; use Benchmark; my @lines = ( "", "This

Re: Converting a textfile-like string to an array and back

2003-02-08 Thread Andrew Savige
To clarify, you may assume that lines in string are separated by "\n" but any solution must pass the following edge cases: 1) empty string: @lines should contain zero elements 2) string of "\n" : @lines should contain one empty element 3) trailing empty lines should be retained 4) you may not a

Re: Converting a textfile-like string to an array and back

2003-02-08 Thread Andrew Savige
Yitzchak Scott-Thoennes wrote: > chomp(my $tmp=$x); my @lines=split /\n/,$tmp,-1 This one fails for the case $x = "\n"; @lines should contain one empty element, but the code above contains none. /-\ http://greetings.yahoo.com.au - Yahoo! Greetings - Send some online love this Valentine's D

RE: Converting a textfile-like string to an array and back

2003-02-08 Thread Andrew Savige
Winter Christian wrote: > # String to array: > @lines=$x=~/[^\n]/g; This one splits into array of chars not array of lines. /-\ http://greetings.yahoo.com.au - Yahoo! Greetings - Send some online love this Valentine's Day.

Re: Converting a textfile-like string to an array and back

2003-02-08 Thread Andrew Savige
`/anick wrote: > I'll prolly say something stupid here, but: > > my @lines = split "\n", $x; This one prolly erroneously removes empty trailing lines. /-\ http://greetings.yahoo.com.au - Yahoo! Greetings - Send some online love this Valentine's Day.

Re: Converting a textfile-like string to an array and back

2003-02-08 Thread Andrew Savige
Aristotle wrote: > my @lines = split m[\Q$/], $x, -1; This one produces one too many elements in the array. /-\ http://greetings.yahoo.com.au - Yahoo! Greetings - Send some online love this Valentine's Day.

Converting a textfile-like string to an array and back

2003-02-07 Thread Andrew Savige
I am interested to learn the fastest and shortest way to convert a textfile-like string to an array and back again (chopping newlines). Test program follows. Improvements (golf or speed) welcome. /-\ use strict; my $x = <<'FLAMING_OSTRICHES'; This is first test line This is 2nd And 3rd FLAMING

Alternative approaches to parsing a configuration file

2002-11-27 Thread Andrew Savige
Text::Balanced is now a standard Perl 5.8.0 module, which seems a good thing to me (though I have not used it before). Anyway, it seems a handy tool for a chore I have parsing a configuration file. I suppose I might use a bigger Parse::RecDescent hammer for this job, or do it in some other way. Wh

Re: want to hide perl scripts

2002-10-31 Thread Andrew Savige
En op 31 oktober 2002 sprak vakeel ahmad: > I would like to hide my perl scripts at client server, > is there any way to hide perl scripts. I don't think [EMAIL PROTECTED] or [EMAIL PROTECTED] are the right places to ask this question. /-\ http://careers.yahoo.com.au - Yahoo! Careers - 1,000's

Re: Naked Arm Wresting: Schwern v Damian

2002-10-30 Thread Andrew Savige
Just a bit more hero-worshippin' in the form of a revitalized T-shirt design produced by a specialized wrestler noggin enlarger algorithm. Freude, /-\ -- #!/usr/bin/perl ('')=~( '('.'?'.'{'. ('['^'+').('['^

Re: Naked arm wrestling: Schwern v Damian

2002-10-27 Thread Andrew Savige
En op 27 oktober 2002 sprak David H Adler: > I think I've got better still photos of it, if you want them. :-) Oh, that would be great. Please let me know the URL or send them to me personally, whichever is easier for you. I will have to first go out and buy a pair of ultra-strong sun-glasses

Naked arm wrestling: Schwern v Damian

2002-10-26 Thread Andrew Savige
I was so impressed by the YAPC::Europe naked arm wrestling: http://astray.com/tmp/yapcbits3.mov I decided to EyeDrops it. Save all text between below as naked.pl (say), then run with: perl naked.pl Enjoy, /-\ --

Re: correctly rebuilding a whitespace-split string

2002-10-14 Thread Andrew . Savige
En op 15 oktober 2002 sprak sthoenna: >On Tue, 15 Oct 2002 13:17:09 +1000, [EMAIL PROTECTED] wrote: >>my ($want,@bollocks) = /(.*?)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s*$/g; > g? Oops, I'm Mr Magoo. Again. (For those interested in golf history, google for "mrmagoo.pl golf"). /-\

Re: correctly rebuilding a whitespace-split string

2002-10-14 Thread Andrew . Savige
En op 15 oktober 2002 sprak the alien: > /\S+/g;//;//;//;// # $` now contains required string No. $` contains a gratuitous trailing space. /-\

Re: correctly rebuilding a whitespace-split string

2002-10-14 Thread Andrew . Savige
En op 15 oktober 2002 sprak sthoenna: > (@bollocks[3,2,1,0], $want) = map scalar reverse, split ' ', reverse($in), 5 my ($want,@bollocks) = /(.*?)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s*$/g; /-\

Re: correctly rebuilding a whitespace-split string

2002-10-14 Thread Andrew . Savige
En op 15 oktober 2002 sprak Aaron Mackey: > @d = splice(split, -4); # I always know that the last 4 fields This won't compile (first argument to splice must be an array). > # this next line is the one to focus on: > $str = join("", (split(/(\s+)/, $_, scalar(@d) + 1))[0..2*$#d]); > method 2: > (

Re: Sort is lazy?!? (as in Haskell)

2002-07-19 Thread Andrew . Savige
En op 19 juli 2002 sprak Mtv (hot favourite for next TPR golf tournament): > it would be very useful in golf to force array context with sort: > $i_need_add_something_to_number_of_letters+sort/\w/g > > but unfortunately you need to write one stroke longer: > $i_need_add_something_to_number

Re: My first JAPH

2002-07-11 Thread Andrew . Savige
En op 12 juli 2002 sprak Csaba Ráduly: > $_=reverse qw"' r e k c a h x l r e P x r e h t o n a x t s u J ' t n i r > p";y y xyzz y;eval; > > Suggestions for stylistic improvements ? s;;reverse qw s' r e k c a h x l r e P x r e h t o n a x t g u J ' t n i r p s;ex;y y gxyzs y;eval; /-\ndrew

Re: Thirty Two Camels

2002-05-25 Thread Andrew . Savige
You didn't think I would stop at 128 did you? To the seven main options: perl camel.pl ""normal camel perl camel.pl q quine (program prints itself) perl camel.pl m mirror (camel looking in the mirror) perl camel.pl i inverted camel perl camel.pl u upside-d

Re: Thirty Two Camels

2002-05-23 Thread Andrew . Savige
Some brilliant golfing from Mtv Europe and Ronald J Kimball has allowed me to increase the number of camels from 32 to 128. There are now seven options: perl camel.pl normal camel perl camel.pl q quine (program prints itself) perl camel.pl m mirror (camel looking in the mirro

Thirty Two Camels

2002-05-15 Thread Andrew . Savige
A friend of mine showed me: http://www.thinkgeek.com/stuff/docs/perl-camel-source.shtml a camel-shaped program that prints four camels when run, and asked could I do better using CPAN Acme::EyeDrops module. Well, I don't know about better, but I could not restrain myself from trying something si

Re: Looking in the mirror with Larry, Damian, Merlyn, Eugene and Buffy

2002-03-27 Thread Andrew . Savige
En op 20 maart 2002 sprak Csaba Ráduly: > If the outputs of the above are identical, does this count > as a quine ? Let's call it an 'accidental' quine. My main purpose was simply to display Buffy's face. :) I am not a quine expert, but I suspect most people would view reading your own source as

Re: Why bother with separate lists?

2002-03-26 Thread Andrew . Savige
En op 25 maart 2002 sprak Mark 'Doc' Rogaski: > The archives won't start until someone actually posts something. Yep, the archives are up now. En op 25 maart 2002 sprak Stephen Turner: : : I agree that there should be a separate golf list. But I also agree that : (although it was kind of Mark t

Re: Why bother with separate lists?

2002-03-24 Thread Andrew . Savige
En op 20 maart 2002 sprak Ronald J Kimball: > I say create a new Perl Golf list, especially for the involved > discussion of golf tournaments. Erm, excuse my ignorance, by I have no idea how all these Perl mailing lists work. I know Mark 'Doc' Rogaski has kindly set up [EMAIL PROTECTED]: http://

Eugene writes a book on Perl Golf

2002-03-24 Thread Andrew . Savige
Searching amazon on "Perl Golf" reveals that Eugene has already written a book on Perl Golf under the pseudonym of "Eugenia Perl": "Understanding Golf Games, a guide for all skill levels" by Eugenia Perl http://www.golfersinternational.com/bookstore/096672450XAMUS148102.shtml -- /-\ndrew Look f

Re: Looking in the mirror with Larry, Damian, Merlyn, Eugene and Buff y

2002-03-23 Thread Andrew . Savige
En op 28 februari 2002 sprak /-\ndrew: > k.pl (82 characters): > open 0;chop,$==length,$=<$-or$-=$=for@a=<0>; > print map{$"x($--length).reverse.$/}@a I just whittled k.pl to 79: open$[;chop,($==y===c)>$-&&($-=$=)for@:=<0>; print$"x-(y---c-$-).reverse.$/for@: Apart from reducing the stroke count

Re: regex for html tags

2002-03-19 Thread Andrew . Savige
En op 20 maart 2002 sprak Abigail: > The majority of the people programming Perl don't even know > anything about Japhs, golf or obfuscated Perl. Don't consider > the inbred circle of people on the various mailinglist, clpm, > #perl, and perlmonks as the average Perl programmer. They aren't, > the

Re: Why bother with separate lists?

2002-03-19 Thread Andrew . Savige
En op 20 maart 2002 sprak Ronald J Kimball: > No other topic swamps all other traffic on this mailing list. > It is quite reasonable that if a specific sub-topic appeals > to only some of the subscribers but accounts for most of the > traffic on a list, that sub-topic should be spun off into > its

Re: regex for html tags

2002-03-19 Thread Andrew . Savige
In message <[EMAIL PROTECTED]>, Randal L. Schwartz writes: : [...] Obfuscated Perl and Golf are both uninteresting to me. And JAPHs. ;-) Randal, I am curious, after all these years, are you still interested in JAPHs? /-\ndrew

Re: regex for html tags

2002-03-18 Thread Andrew . Savige
En op 19 maart 2002 sprak Greg Bacon: > I coined the phrase "Perl golf" ... I am curious as to how you came to think of it. Were you playing a lot of real golf at the time? En op 19 maart 2002 sprak Greg Bacon: > IMHO, the volume of golf traffic on fwp warrants the > creation of [EMAIL PROTECTED

Golf Statistics: Career Money Leaders

2002-03-18 Thread Andrew . Savige
$ 704,000.00 7. Piers Cawley$ 622,720.00 8. Andrew Savige $ 448,000.00 9. Mtv Europe $ 441,040.00 10. Marcus Holland-Moritz $ 432,000.00 11. Keith Calvert Ivey

Re: PGAS Web Service

2002-03-14 Thread Andrew . Savige
En op 14 maart 2002 sprak Bart Lateur: > Don't say you've never heard of "cookies". cookie. US, a small sweet biscuit. biscuit. Brit, a small unleavened cake. I apologize for my ignorance, but when I installed Windows, I asked for "English (Oxford)" and not "English (US)", and so Internet Explo

Re: PGAS Web Service

2002-03-14 Thread Andrew . Savige
En op 14 maart 2002 sprak Stephen Turner: > Oooh, what fun. We can see all of Andrew's... eccentricities as once. > > chop eggs, eat lollipop, (?{'.('`'|'%').('['^'-').('`'|'!')&mredo I missed an obvious improvement of preceding 'chop' with 'karate': #!/usr/bin/perl -l sub lolli{$_=pop;/

Re: PGAS Web Service

2002-03-13 Thread Andrew . Savige
En op 14 maart 2002 sprak `/anick: > A first tentative to see what kind of stuff can be done > with that can be found at > http://babyl.dyndns.org/golf/golfers.epl Cool. En op 14 maart 2002 sprak `/anick: > My next step is to try to create mock-baseball cards > with scores and

Re: PGAS Web Service

2002-03-13 Thread Andrew . Savige
En op 13 maart 2002 sprak Dave Hoover: > This discussion definitely has started me to thinking about > passwords in PGAS. They will probably be implemented > at some point in the not-too-distant future. I think a similar scheme to that used for journal authors at use.perl.org is appropriate. I

Re: PGAS Web Service

2002-03-12 Thread Andrew . Savige
En op 13 maart 2002 sprak `/anick: > And on a semi-related topic, so far the web interface uses > a golfer's email addie as way to confirm his/her identity. But > since a lot of us are on fwp and see each other addie, isn't > that a risk? I mean, if Andrew hadn't been dozens of strokes > ahe

Re: Perl Golf as a sport

2002-03-10 Thread Andrew . Savige
En op 10 maart 2002 sprak Dave Hoover: > Reminiscent of my football days, I often find myself jumping > around like a buffoon after discovering a better algorithm. Already, Perl golf is showing potential as a TV spectator sport. Imitating the all-conquering Aussie cricket team, I myself indulge

Re: Perl Golf as a sport

2002-03-10 Thread Andrew . Savige
En op 10 maart 2002 sprak Eugene van der Pijll: > Actually, I did look for other solutions; I just could not find them. > I did not try the s///eg within s///eg way, as I was sure that > couldn't work. Earlier, I had tried things like m#___(?{___/./___})___#, > which produced an error message abou

Perl Golf as a sport

2002-03-09 Thread Andrew . Savige
It is clear from recent games that Perl Golf is a sport, not so different from chess, or real golf for that matter. There is strategy there, and tactics too -- with tactics predominant, in my opinion. I would like to illustrate this sporting aspect of the game with some examples from recent play,

Re: TPR1 post-mortem

2002-03-09 Thread Andrew . Savige
En op 08 maart 2002 sprak Eugene van der Pijll: > Of course, some people can do a golf thread all by themselves > in one post: http://groups.google.com/groups?selm=1991Apr29.072206.5621%40jpl-devvax.jpl. nasa.gov En op 04 maart 2002 sprak /-\ndrew: > Oh, the shock and terror of seeing Eugene and

Re: TPR1 post-mortem

2002-03-09 Thread Andrew . Savige
Stephen Turner schreef op 09 maart 2002: > Thanks for all the replies about the history of Perl golf. > One more question: when is the earliest example of a proper > organised competition, rather than just a challenge on a mailing > list or whatever? Are there any before the recent five? The ill-

Re: TPR1 post-mortem

2002-03-07 Thread Andrew . Savige
Dave Hoover schreef op 08 maart 2002: > But the honor must go to Ton for his herculean 47.53, beating > BoB and 132 other golfers. Congrats Ton! Honorable mention also > goes to Lars Mathiesen for winning the Beginner's category. I would also like to congratulate Ton and Lars, and pay tribute to

Re: tiebreaker scores

2002-03-05 Thread Andrew . Savige
Ton schreef op 06 maart 2002: > The current use of fractionals is just fine: the bigger > the number, the worse your score. 54.25 Stephen Turner Is this a misprint? Are you really saying that Stephen solved this problem with only 25% of his characters being \w\s ?? That is genius! That is the

Re: BoB

2002-03-05 Thread Andrew . Savige
Stephen Turner schreef op 06 maart 2002: > Well, I see BoB's leapt ahead to 51 now. And Stephen Turner to 54, I see! When I saw you one ahead of Eugene I thought it must be a misprint. Actually, Stephen is my dark horse tip to win the tournament. Why? "This is Turner's 3rd Golf Tournament, and h

Re: BoB

2002-03-04 Thread Andrew . Savige
Rick Klement schreef op 05 maart 2002: > I hate to break it to you, Andrew, but others consider *you* > to be one of the sharks... /-\ndrew schreef op 05 maart 2002: > When I went to submit it, I noticed Ton Hospel is on 52. > Well done, Ton! Well done, shark Rick too! I see you got to 52. Since

RE: BoB

2002-03-04 Thread Andrew . Savige
/-\ndrew schreef op 04 maart 2002: > After seeing the leaderboard this morning, I started hearing > the Jaws theme playing in my head. It won't go away, has been > playing all morning. Oh, the shock and terror of seeing Eugene > and Karsten swimming in the water right behind me! > > /-\ndrew Ric

Re: BoB

2002-03-04 Thread Andrew . Savige
Stephen Turner schreef op 04 maart 2002: > Well, I see BoB's got 52. I'm still stuck on 60. Still, even if > I am 8 behind BoB, at least I'm only 4 behind Eugene. :-) Eugene van der Pijll schreef op 04 maart 2002: > 5, unless you have taken one off as well. But I do not see how > it can be any sh

Re: TPR(0,1) scores

2002-03-03 Thread Andrew . Savige
[EMAIL PROTECTED] wrote: > Unfortunately, I have been reduced to hanging on to Keith and > Stephen like a leech. :-( Keith C. Ivey schreef op 4 Marchi 2002: > Looks like the leech has detached itself. You've shot up to > second place, 5 strokes ahead of me. I don't seem to be > getting the ep

Re: TPR(0,1) scores

2002-03-03 Thread Andrew . Savige
On Sat, 2 Mar 2002, Yanick wrote: > > Ah, the things one is ready to do to keep his mind away from > a big fat score of 65 that doesn't seem to want to shrink of a > single stroke... > Stephen Turner schreef op 3 marchi 2002: > If only there were a POSIX::secretnumber(). I checked tha

Looking in the mirror with Larry, Damian, Merlyn, Eugene and Buffy

2002-02-28 Thread Andrew . Savige
The latest version of Acme::EyeDrops: http://search.cpan.org/search?dist=Acme-EyeDrops contains five face shapes, namely: larry, damian, merlyn, eugene, buffy2. A friend of mine asked: Is it possible to produce a 'pure' (i.e. no leading eval) EyeDrop'ed program that displays one of these faces

Re: TPR0 Final Results

2002-02-21 Thread Andrew . Savige
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 whole string. For example: $x = 'abc';

Re: TPR0 Final Results

2002-02-21 Thread Andrew . Savige
Eugene van der Pijll schreef op 22 februari 2002: > #!/usr/bin/perl -l > [pop=~/.(?{$a=$a*36-55+$&=~y#0-9##*7+ord$&})/g];print$a > (58) I don't recall seeing a single entry in any of the 4 golf games that successfully used this technique. In the Get Even post mortem, Ton suggested to try to find

Re: TPR0 Final Results

2002-02-20 Thread Andrew . Savige
Ton Hospel schreef op 21 februari 2002: >> $\=(30+ord lc)%39+36*$\.$/for pop=~/./g;print >> >> Hey, that's 45! Stephen, are you happy now? >> Ton, you are the best golf post-mortem analyst in the world. :) >> > You did all the hard work, I just moved some chars around. Eugene van der Pijll schr

Re: TPR0 Final Results

2002-02-19 Thread Andrew . Savige
Ton Hospel schreef op 20 februari 2002: > $\=(30+ord lc)%39+36*$\.$/for pop=~/./g;print Andrew Savige schreef op 20 februari 2002: > Hey, that's 45! Stephen, are you happy now? > Ton, you are the best golf post-mortem analyst in the world. :) This one is longer, but for some re

Re: TPR0 Final Results

2002-02-19 Thread Andrew . Savige
Ton Hospel schreef op 20 februari 2002: > $\=(30+ord lc)%39+36*$\.$/for pop=~/./g;print Hey, that's 45! Stephen, are you happy now? Ton, you are the best golf post-mortem analyst in the world. :) /-\ndrew

Re: TPR0 Final Results

2002-02-19 Thread Andrew . Savige
Two more: $a=$a*36+(30+ord lc)%39for pop=~/./g;print$a,$/ ton:47 $\=$\*36+(30+ord lc)%39 .$/for pop=~/./g;print ton's ghost:46 $x=$x*36+(-9+ord)%39for split//,lc pop;print$x.$/ albert:49 $\=$\*36+(-9+ord lc)%39 .$/for pop=~/./g;print albert's ghost:46 Now the space after the 39

Re: TPR0 Final Results

2002-02-19 Thread Andrew . Savige
Three more 46-ers: map$.=36*$.-55+/\d/*7+ord,pop=~/./g;print$..$/spiff:46 map$\=(36*$\-55+/\d/*7+ord).$/,pop=~/./g;printGhost of Eugene's reverse map$\=36*$\-55+/\d/*7+ord().$/,pop=~/./g;printGhost of

Re: TPR0 Final Results

2002-02-19 Thread Andrew . Savige
Stephen Turner schreef op 20 februari 2002: > I'm still interested in seeing a real solution less than 46. > But maybe there isn't one. Since we have had a positive sighting of Eugene whittling at the RC4 solution, I doubt that it is possible. ;-) I had visions of reliving Eugene's celebrated re

Re: RC4 < 182 bytes

2002-02-17 Thread Andrew . Savige
Eugene van der Pijll schreef op 17 februari 2002: > 151: > > sub f{@s[$x,$y]=@s[($y+=$s[$x])%=@s,$x]; > $s[$x++]+$s[$y]}@k=pop=~/../g;$y+=hex$k[ > $x%@k],f for@s=0..255;$x=1;$y=0;$x%=@s,p > rint$_^chr$s[f()%@s]for<>=~/./g I haven't got a clue about RC4, but inspecting Eugene's masterpiece, can yo

RE: Explanation of my 189-stroke "Perl-is-C;C-is-Perl" entry

2002-02-17 Thread Andrew . Savige
Philip Newton wrote: > Well, existing compilers tend to be slow to implement new > standards such as C99 > > So for my purposes, "standard C" is "ANSI C" i.e. "K&R 2nd ed.". YMMV. Interestingly, in this particular case, many vendors are very *quick* to implement, often implementing before it

Explanation of my 189-stroke "Perl-is-C;C-is-Perl" entry

2002-02-16 Thread Andrew . Savige
Though singled out for submitting a whopping 9 entries, I could not help but notice that specialist obfuscator BooK submitted more. Luckily for me, however, he did not find the strtol hack, for he would surely have tried for a T-shirt by producing a "C is Perl" entry, just as he did in the 4th Ob

RE: TPR0 Final Results

2002-02-16 Thread Andrew . Savige
Stephen Turner wrote: > In that case, I think there should be a separate leaderboard for > people who didn't use strtol. Just so that I could be only one > stroke off the lead, you understand. :-) 2002/02/11 19:52:29 - 46 - Karsten aka Spifff map$.=36*$.-55+/\d/*7+ord,pop=~/./g;print$..$/ 2002/0

RE: Explanation of my 7918-stroke Perl Bowling entry

2002-02-16 Thread Andrew . Savige
Stephen Turner wrote: > Thanks for the explanation, Andrew. I'm interested to know how > you made the picture of Eugene during your golf competition. > I found the original photo, but how do you turn that into a line > drawing to work your magic on? Do you have to do it by hand? For that photo, I

Explanation of my 7918-stroke Perl Bowling entry

2002-02-16 Thread Andrew . Savige
Thankyou to Dave and Jerome for running the game and for their invitation to explain some of my weird entries. The fwp old-hands may have yawned at my 7918-stroke entry, but I hope it caused at least a few fwp newbies to remark "What the hell is that?" or "How the hell does that work?". Let me s

RE: TPR0 Final Results

2002-02-16 Thread Andrew . Savige
On Sat, 16 Feb 2002 11:10:17 +0100, F. Xavier Noria wrote: >: What an anti-climax. Utterly boring. > >Maybe being a mathematician I am a bit formalist, but the challenge was >to use as few strokes as possible, if you didn't use strtol you lost. If >you didn't want to use strtol as an option you a

Re: TPR0 Final Results

2002-02-16 Thread Andrew . Savige
Andrew Savige wrote: > #!/usr/bin/perl -l > use POSIX;print strtol pop,36 > > I think this should work, but it prints a spurious trailing zero. Ronald J Kimball wrote: > RTFM. > >strtol String to (long) integer translation. Returns the >parsed

Re: TPR0 Final Results

2002-02-15 Thread Andrew . Savige
Rick Klement wrote: > A modest suggestion for perl golf: no modules allowed. If it's any consolation, Rick, I think most serious golfers (well, me, at least;-) recognize those golfers who shot 46 and 47 without using any modules or external commands. I tried hard, but could not break 50. :-( I wo

Re: TPR0 Final Results

2002-02-15 Thread Andrew . Savige
Stephen Turner wrote: > Can someone explain to me why > > -l use POSIX;print strtol pop,36 > > doesn't work? Where does the extra 0 come from? To quote myself to Dave and Jerome: BTW, because I felt you were already inundated with queries about it, I did not bother you with what seems to be a Pe

RE: The Perl Review #0 Golf tournament

2002-02-13 Thread Andrew . Savige
John W. Krahn wrote: > They won't accept it. :-( > Want me to post it here? I think they should accept it, not as an official entry, but to make `/anick and /-\ndrew go oooh and aaah in the post mortem. You may have noticed I was very late into this game because I was playing the last ga

RE: The Perl Review #0 Golf tournament

2002-02-13 Thread Andrew . Savige
John W. Krahn wrote: > Well, in _this_ case, the one-liner version is 33 characters and the > file version is 34 charcters. `/anick wrote: > Oh... Really? I'm looking forward tomorrow and discovering > that thing, then. :) If that 33 count includes the leading "perl -e'", I'll go Ooooh

Re: TPR0 Leaderboard (12/02/2002 10:35)

2002-02-12 Thread Andrew . Savige
Jonathan E Paton wrote: > Does your solution pass all the tests though Andrew? and > do we have to wait to the finish to see how you streched > the problem into all characters? Dave Hoover wrote: > Yes and Yes. > It's worth the wait. The Perl Review Golf column exhorted you to "use Perl in some

RE: TPR0 Leaderboard (12/02/2002 10:35)

2002-02-12 Thread Andrew . Savige
Ala Qumsieh wrote: > 7918 Andrew Savige > I see that Andrew has perfected Perl Bowling :-) At least I forced them to move all the names over by one space. :) (You might need to put some eye drops in your eyes to see it clearly). /-\ndrew

Re: Still whittling, Honza this time

2002-02-10 Thread Andrew . Savige
-n s/[aeiouy]?/"1&~$.&y!$&!!c?\$&:next"/gee;print 49 honza(w) The one below is 2 strokes worse, but I found it interesting to solve the problem with two substitutions. I wonder if there is a way to do it with just one. -p s/[aeiouy]?/"1&~$.&y!$&!!c?\$&:S"/gee;s/.*S.*//s 51 bob This on

Re: Beginner's definition ?

2002-02-09 Thread Andrew . Savige
Jean-Pierre Vidal wrote: > The "Beginners'Leaderboard" helped me to go on stage unashamed, > and this is its part (do you think so, Andrew ?). Andrew Savige wrote: > It worked wonderfully in this game because Peter Makholm, > Jason Parker and Stephen Turner staged an

Still whittling, Honza this time

2002-02-09 Thread Andrew . Savige
Honza was the only golfer to find the clever trick of avoiding eval by using the s///ee construct. -nl s/|[aeiouy]/"y!$&!!c%2|$.%2&&next;'$&'"/gee;print 53 honza I could not restrain myself from whittling this to 49 (see below). We now have 5 quite different ways to break the 50 barrier! -p $

  1   2   3   >