Re: Collaborative golf.
[email protected] (Jasvir Nagra)
| Newsgroups | perl.golf |
|---|---|
| Message-ID | <[email protected]> |
Paul Johnson <[email protected]> writes: > Here's one that doesn't come anywhere near Perl, but it does have nicer > output and error checking - in 240 chars. > > echo `echo $* '[ddsf[lfp[too early]Pq]s@1583>@ddd19%1+sg100/1+d3*4/12-sx8*5+25/5-sz5*4/lx-10-sdlg11*20+lz+lx-30%d[30+]s@0>@d[[1+]s@lg11<@]s@25=@d[1+]s@24=@se44le-d[30+]s@21>@dld+7%-7+[March ]smd[31-[April ]sm]s@31<@psnlmPpsn1z>p]splpx'|dc` > > (That's all one line if someone gets it wrapped, but it probably doesn't > matter too much.) There's no need to be quite so verbose with dc. ;-) Thanks to tpr5, I now have a nice infix to rpn converter (show me the weasel that claims golf is a fruitless pursuit and I'll show you a weasel). With a little hand holding and post munging, it converts Piers script straightforwardly into the following 166 character dc ditty. echo $* 'dsy19%sgly100/sclcd4/-8lc*13+25/-19lg*+15+30%shlhd28/1lh28/29lh1+/*21lg11/-*-*-silyd4/+li+2+lc-lc4/+7%sjlilj-sl3ll40+44/+smll28+31lm4/*-sdlyn32Plmn32Pldp'|dc Suboptimal but effective. Even calls itself, "sily" /jas -- Jasvir Nagra http://www.cs.auckland.ac.nz/~jas/ echo [91PP93P[dx]P]dx|dc