From: Josef 'Jupp' SCHUGT Date: 2003-12-02T07:18:59+09:00 Subject: Re: ruby game of life program Hi! * Van Jacques; 2003-12-01, 12:52 UTC: > "Josef 'Jupp' SCHUGT" wrote in message news:<20031129174431.GB2320@jupp%gmx.de>... > One thing I notice was that I used > > a = Array.new > b = Array.new > 0.upto( size - 1 ) do |i| > a[i] = Array.new(size, 0) > b[i] = Array.new(size, 0) > end > > while you used > > tos = Array.new > tng = Array.new > > 0.upto(N) { |row| > tos[row] = Array.new(N+1) > tng[row] = Array.new(N+1) > tos[row] = [0, 0, 0, 0, 0, 0, 0, 0] > tng[row] = [0, 0, 0, 0, 0, 0, 0, 0] } You seem to be confusing something. In the message I did answer to you did use a = Array.new b = Array.new 0.upto( nnm ) do |i| a[i] = Array.new( nn ) b[i] = Array.new( nn ) a[i] = [0,0,0,0,0,0,0,0] b[i] = [0,0,0,0,0,0,0,0] end I was assuming you did intentionally implement it in that way (to better point out the initial values) and so I saw no reson to change it. Josef 'Jupp' Schugt -- for i in $(seq 1 9); do rm /bin/cat done