Re: The Pyramid - a challenge...
Re: The Pyramid - a challenge...
- Subject: Re: The Pyramid - a challenge...
- From: Emmanuel <email@hidden>
- Date: Sat, 23 Apr 2005 16:00:36 +0200
At 12:46 PM +0100 4/23/05, Barry Wainwright wrote:
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
This introduces a new variante: allowing the "xx.0" notation instead
of Martin's integer numbers.
A new variante could be to allow the Satimage osax:
set {x,l} to {1,{}}
repeat 5 times
set end of l to x
set x to addlist (x & 0) with ({0} & x)
end repeat
l
Emmanuel
_______________________________________________
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