Page 1 of 1

Just for fun! needles on Christmas Tree

Posted: Fri Dec 30, 2022 6:04 pm
by AndyP
A silly script to calculate the number of needles on your Christmas Tree

Code: Select all

on mouseUp
   -- calculate radius of cone in feet
   put 6 into treeHeight
   put 4 into treeBase
   put treeBase / 2 into radius

   -- calculate cone volume in cubic feet
   put radius * radius * pi * treeHeight / 3 into coneVolume

   -- calculate surface area of cone in square feet
   put radius * radius * pi + radius * pi * sqrt(radius^2 + treeHeight^2) into coneSurfaceArea

   -- calculate number of needles using surface area and needles per square foot
   put coneSurfaceArea * 1000 into needleCount
   answer "There are approximately " & round(needleCount) & " needles on your Christmas tree."
end mouseUp
Who's going to be the first to verify against their own tree? :D

Re: Just for fun! needles on Christmas Tree

Posted: Fri Dec 30, 2022 6:21 pm
by richmond62
Our Christmas tree is plastic, and we've had it for 25 years.

Sorry if that needles you. 8)

Re: Just for fun! needles on Christmas Tree

Posted: Fri Dec 30, 2022 8:18 pm
by dunbarx
I just made a physical count, and you are off by 42.

Craig

Re: Just for fun! needles on Christmas Tree

Posted: Fri Dec 30, 2022 8:27 pm
by Klaus
dunbarx wrote:
Fri Dec 30, 2022 8:18 pm
I just made a physical count, and you are off by 42.

Craig
LOL! :D :D :D

Re: Just for fun! needles on Christmas Tree

Posted: Fri Dec 30, 2022 8:27 pm
by SparkOut
I demand a recount!

Re: Just for fun! needles on Christmas Tree

Posted: Fri Dec 30, 2022 11:10 pm
by AndyP
dunbarx wrote:
Fri Dec 30, 2022 8:18 pm
I just made a physical count, and you are off by 42.

Craig
That's the answer to everything... Isn't it?

Re: Just for fun! needles on Christmas Tree

Posted: Sat Dec 31, 2022 1:11 am
by dunbarx
Not everything, jut the product of six and nine.

Craig