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

Re: more minigolf

Thread Previous | Thread Next
From:
Chris Dolan
Date:
July 10, 2002 07:34
Subject:
Re: more minigolf
Message ID:
3D2C455D.3010204@clotho.com
Attached is a test script which allows either zero or one as the
starting number:

   tritest.pl <starting index> <scriptname>

e.g.:

  perl tritest.pl 0 tri_0.pl

or

  perl tritest.pl 1 tri_1.pl

My current score (which I hope to improve) is
  0: 56
  1: 54

Chris

Phil Carmody wrote:
> --- Jasper McCrea <jasper@guideguide.com> wrote:
> 
>>Michael W Thelen wrote:
>>
>>>On Wed, Jul 10, 2002 at 12:47:40PM +0100, Jasper McCrea wrote:
>>>
>>>>given a line number on the command line, print out that line
>>>
>>from
>>
>>>>Pascal's triangle. Single space separated numbers, nothing but
>>>
>>a \n at
>>
>>>>the end, you know the drill.
>>>
>>>Do the line numbers begin at 0 or 1?  Is it like this?
>>>
>>>line 0:       1
>>>line 1:      1 1
>>>line 2:     1 2 1
>>>
>>
>>I think line numbering will begin at 1. 0 would be too odd. And it
>>would
>>add a few characters to my solution :)
> 
> 
> (1+1)^0 =     1
> (1+1)^1 =    1+1
> (1+1)^2 =   1+2+1
> (1+1)^3 =  1+3+3+1
> (1+1)^4 = 1+4+6+4+1
> 
> Not odd at all.
> 
> Phil
> 
>>cheerio,
>>Jasper
> 
> 
> 
> =====

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