Re: Perl vs. C?
[email protected] (Yanick)
| Newsgroups | perl.golf |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Jan 21, 2003 at 09:48:51PM -0500, Yanick wrote:
> On Tue, Jan 21, 2003 at 09:39:18PM -0500, Yanick wrote:
> > On Wed, Jan 22, 2003 at 12:08:23AM +0000, Ian Phillipps wrote:
> > > The following was distributed a while ago as "footguy.c".
> > > Can any golfers duplicate its function in perl using fewer characters?
> > >
> > > There are a couple of literal ^G in here:
> > >
> > > main(l){main(8^putchar(l++["xx77Rd$fR$wPP"]^88)?l:26+fflush(sleep(1))-l);}
> >
> > One first, naive try:
> >
> > perl -i_ -e'$_||=" oo\n<|>\n_|_\n",s#.$#$&eq$^I?"/":$^I#e while sleep print'
>
> A second, almost as naive, try:
>
> perl -e'$_="oo\n<|>\n_|";sleep print while$\=("_\n","/\n")[--$|]'
perl -e'sleep print"oo\n<|>\n_|"while$\=("_\n","/\n")[--$|]'
(sorry, I'll shut up, now)
`/.
--
"For those who want prayer in school, I'm willing to
consider a tradeoff: algebra in church. If you're so hot on
absolute truth, I've got absolute truth for you."
- comic book writer Steven Grant