From: "Peña, Botp" Date: 2007-10-23T14:11:25+09:00 Subject: Re: recursive array From: Simon Schuster [mailto:significants@gmail.com] # 207:0> a = [1,2,3,4] # [1, 2, 3, 4] # 208:0> a[4] = a # [1, 2, 3, 4, [...]] # 209:0> a[4] # [1, 2, 3, 4, [...]] # 210:0> a[4][4] # [1, 2, 3, 4, [...]] # 211:0> a[4][4][4][4][4][3] # 4 # # have you ever used this technique? can you # provide some example code for us which illustrates # any kind of usefulness of this that you can # imagine? i am not yet in graphs/game theory but recursion things are good for research in those fields :) this is just one stupid example, > def sumb(a,i) > return 0 if a[i]==a > a[i]+sumb(a,i+1) > end => nil irb(main):042:0> a => [1, 2, 3, 4, [...]] irb(main):043:0> sumb(a,0) => 10 i'm just playing w ruby :) kind regards -botp