This is an archived low-energy page for bots and other anonmyous visitors.
Please sign up if you are a human and want to interact.
in reply to Perl Golf Ethics
In the perl golf community it is in fact expected that golfers learn from solutions to previous golfs. Many of the standard tricks of the trade have not been invented by the people using them.
If it turns out that some specific but not generally known piece of knowledge helps enormously in a golf, it is the habit to inform the party holding the golf so they can decide if they want to add it to the
challenge notes. That way everyone may play on a more level field.
I have already told fonality about an existing golf that helps a lot, but I forgot to suggest a link to it on the rules page.
Re^2: Perl Golf Ethics
by petdance (Parson) on Jan 02, 2007 at 12:47 UTC
|
I didn't realize that there was a "perl golf community", or that being part of said community was worth cash.
It leaves a very bad taste in my mouth that this contest was effectively written for a few people who were in the know, who had seen your magic algorithm, shutting out the rest of us.
| [reply] |
|
|
| [reply] |
|
|
The competition was for golfers and golfer wannabees like me.
I'm a bad golfer. Despite of that, I have been lurking quite some time on #perlgolf on IRC, so maybe that's why I'm "in the know" ;-) ... anyways, for those new to the sport Super Search helps. Searching for "golf book" turns up:
amongst others, which all mention The Perl Golf Book. The algorithm is there, just search the pdf for "roman".
It's not Fonality's fault you didn't see it. (I used it in some entries, got them rejected and thought it was because of thospel's algorithm, and didn't try any further).
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
| [reply] |
|
|
thanks for promoting the book! a small comment, #perlgolf on irc network named IRCNet (not on slashnet, freenode, dalnet, efnet etc).
| |
|
|
I agree that this was very unfortunate, but let's not try to read too much into it.
From an email exchange I know that the organizers didn't know about that particular very relevant historical golf,
so it certainly wasn't intentional. I'm quite sure they would not have chosen this challenge if they had known.
The link to the relevant code was in shmems post in this very thread. You being part of the perlmonks community made that information available to you too.
As the other solutions in that historical golf show, not hitting on the magic method doesn't loose a good golfer
more than (order of magnitude) 5 strokes. This might indeed be enough to pass a few people on the scoreboard, but it's in fact less than the average distance between players.
| [reply] |
|
|
| [reply] |
|
|
|
|
| |
|
|
|
Ton's brilliant magic formula won the original roman tournament
by only three strokes.
It is also worth noting from the
fonality golf post mortem
that TedYoung (presumably a first time golfer) produced a score of 116.50 before
finding Ton's magic formula ... and that a score of 169.51 was enough to win a prize.
Also, Jasper, who is part of the Perl golf community, "forgot" about
Ton's magic formula, yet was still able to finish in ninth place with a score of 125.
So not knowing this formula did not "shut out" people from winning a prize.
Moreover, searching for perl golf (via google and/or SuperSearch) would have
uncovered the original perl golf roman numerals game easily enough (as Ted
Young did).
Perhaps the rules should have been clarified to state, as Ton says, that golfers
are expected to research and learn from prior art and that it is not cheating
to do so.
In summary, I do not blame Fonality for this and, despite the prior roman art,
the wide range of scores and creative approaches showed that there was
a lot of golf played in this competition outside the magic formula.
| [reply] |
|
|
| [reply] |
|
|
|
|
|
|
|
|
#!perl -pl
map{$_.=(!y/IVXLC/XLCDM/,I,II,III,IV,V,VI,VII,VIII,IX)[$&]while s/\d//
+;$$_=$n++}@R=0..3999;
y/mp/-+/;s/\w+/${$&}/g;$_=$R[eval]
comes in at around 130. You could get down to around 120, again without knowing
Ton's magic formula, by whittling the arabic-to-roman converter:
#!perl -pl
map{y/IVXLC/XLCDM//s//$&-9?$&-4?I x$&:IV:IX/e&s/I{5}/V/while/\d/;$$_=$
+n++}@R=0..3999;
y/m/-/;s/\w+/+${$&}/g;$_=$R[eval]
To go lower, you'll need to sneak in y/iul-}/-$+ / somewhere to transform $_ directly into symrefs (e.g. $II +$ III) that can be directly eval'ed. Doing that allows you to eliminate the s/\w+/${$&}/g above.
Still further savings are available by replacing the @R array above with a second set of symbolic references, this time mapping negative numbers back to roman numerals.
While I don't fully understand your shortest 186 solution:
#!perl -pla
%n=I1V5X10L50C100D500M1000=~/(.)(\d+)/g;sub
d{$#_-=$z*2*(@_&&$z<$_)-($z=$_)for@n{/./g};@_}$t+=($.=/p/-/n/||$.)*d
for@F;map{$s.=$_ x($t/d),$t%=d}M,CM,D,CD,C,XC,L,XL,X,IX,V,IV,I;$_=$s
it seems like sour grapes to claim that:
this contest was effectively written for a few people who were in the know, who had seen your magic algorithm, shutting out the rest of us.
As shown above, without knowing Ton's magic algorithm, you could have easily
trimmed 60 strokes off your solution by unearthing the fundamental
insights into the problem.
Update: oops, changed 4e3 to 3999 (4e3 fails test case "MD plus I") plus minor code improvements. Added extra symbolic reference insight.
| [reply] [d/l] [select] |
|
|
Your assessment of my concerns as "sour grapes" and "rubbish" is noted.
| [reply] |
|
|
|
|