develooper Front page | perl.golf | Postings from July 2002

Re: It's so simple ! It can't be that hard !

Thread Previous | Thread Next
From:
perl-golf
Date:
July 31, 2002 10:26
Subject:
Re: It's so simple ! It can't be that hard !
Message ID:
ai96ni$4e9$1@post.home.lunix
In article <3D47EFCF.E4D32408@guideguide.com>,
	Jasper McCrea <jasper@guideguide.com> writes:
> Ton Hospel wrote:
>> 
>> Another one that was done as a (very quick, only half a day) ircnet golf
>> for you to try your teeth on.
>> Won by mtve with a score of 85, but in the postmortem we are at 77.
>> How well can the mailinglist do this as an open golf (post your attempts
>> here)
>> Only for people who haven't played it and haven't looked at the web page.
>> 
>> Consider a 2x2 square where each position can be filled (represented by a O
>> (that's not a zero)), or empty (represented by a .). You can then
>> look how many elements are filled on each row and column, for example:
>> 
> 
> i got 131, so not really threatening the leaderboard.
> 
> sub p{$a[pop]+$a[pop]}sub
> r{($_/=2)&1}map{@a=(r,r,2,r,r,2);pop,print+('.',O,$/)[@a]if
> p(0,1).p(3,4).$".p(0,3).p(1,4)eq"@ARGV"}0..31
> 
> two subroutines! my only excuse is that i am doped up on codeine after
> breaking both arms (so one was only chipped, sue me), and didn't spend
> too long on it.

It's pretty typical for this problem. It's very simple, but writing it
down seems lead to big sizes.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About