Re: The Pyramid - a challenge...
Re: The Pyramid - a challenge...
- Subject: Re: The Pyramid - a challenge...
- From: Barry Wainwright <email@hidden>
- Date: Sat, 23 Apr 2005 12:46:12 +0100
Title: Re: The Pyramid - a challenge...
On 23/4/05 5:34 am, "David C Andrews" <email@hidden> wrote:
Not a "Garvey" and no "script o" but a bit simpler:
Still no ‘garvey’, but I’d do it mathematically:
set itCount to 100
-- precalculate the factorials
set f to {1} --0! =1
repeat with x from 1 to itCount
set end of f to x * (last item of f)
end repeat
-- loop through row & place
set theAnswer to {}
repeat with n from 1 to itCount
set nLine to {}
repeat with k from 1 to n
set end of nLine to (item (n) of f) / ((item (k) of f) * (item (n - k + 1) of f))
end repeat
set end of theAnswer to nLine
end repeat
return theAnswer
--
Barry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden