• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: The Pyramid - a challenge...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: The Pyramid - a challenge...
      • From: Emmanuel <email@hidden>
References: 
 >Re: The Pyramid - a challenge... (From: David C Andrews <email@hidden>)

  • Prev by Date: Re: adding parameters to run command
  • Next by Date: Re: The Pyramid - a challenge...
  • Previous by thread: Re: The Pyramid - a challenge...
  • Next by thread: Re: The Pyramid - a challenge...
  • Index(es):
    • Date
    • Thread