The Pyramid - a challenge...
The Pyramid - a challenge...
- Subject: The Pyramid - a challenge...
- From: Martin Orpen <email@hidden>
- Date: Fri, 22 Apr 2005 20:50:55 +0100
Trains are delayed again... So here is an ideal opportunity for somebody to
do a "Garvey" and unleash the "script o":
set l1 to {{1}, {1, 1}}
repeat 21 times
set l2 to {}
set bar to last item of l1
set l2 to nextStep(bar)
set end of l1 to l2
end repeat
set t to {}
repeat with r from 1 to count of l1
set end of t to item r of l1
set end of t to return
end repeat
t
on nextStep(x)
set foo to {}
set end of foo to 1
set n to count of x
set {y, z} to {2, 1}
repeat (n - 1) times
set end of foo to (item z of x) + (item y of x)
set {y, z} to {y + 1, z + 1}
end repeat
set end of foo to 1
return foo
end nextStep
-->{{1}, "
", {1, 1}, "
", {1, 2, 1}, "
", {1, 3, 3, 1}, "
", {1, 4, 6, 4, 1}, "
", {1, 5, 10, 10, 5, 1}, " ...
:-)
--
Martin Orpen
_______________________________________________
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