jack: (Default)
I've also added arrays, so you can do:
# Warning, untested
fib = Arr(10,Var)
for a,b,c in fib.adj_objs(3):
 c = a + b
fib[0] = fib[1] = 1
assert fib == (1, 1, 2, 3, 5, 8, 13, 21, 34, 55)

graph = Arr(10,Point)
for x,(pt,f) in enumerate(zip(graph,fib)):
 pt.x = 10 * x
 pt.y = 150 - 2 * f
But I really wanted to give an alternative to the "for ... in" syntax, something like:
 fib_pts = Arr(10,Point)
 fib.each() = fib.prev() + fib.prev(2)
or maybe:
 fib[pyl.idx] = fib[pyl.idx-1] + fib[pyl.idx-2]

Active Recent Entries