From: Joop Van den tillaart Date: 2007-06-13T19:07:46+09:00 Subject: Re: Generate a grid of cells, and give characteristics Harry Kakueki wrote: > On 6/12/07, Joop Van den tillaart wrote: >> >> Well I don't really have a deadline but I'm hoping to go as fast as I >> can...and then I hope to be done with it in about 8 - 10 weeks... >> > > Is this a Ruby project? > > You may want to take a look at this. > http://pine.fm/LearnToProgram/ > > Then try writing some code. > > > Harry > > > -- > > A Look into Japanese Ruby List in English > http://www.kakueki.com/ Okay...I followed through the link you gave me...and i found another thread dealing with Array en Grid: http://www.ruby-forum.com/topic/88174#167392 In the last two reactions I think i found a starting point for my problem... I replaced the numbers so now I have this: require 'enumerator' @array = (1..196).to_a @grid = Array.new(14) {|idx| Array.new(14)} @array.each_with_index do |val, idx| @grid[idx/14][idx%14] = val end p @grid I then get to have an array from 1..196 and those are divided in a grid of [[1..14],[15..28], .. ,[183..196]] What I want to do next is work with these cells...make them 'live' so to say... Do i need to put this array in some sort of database? So i get to have some columns where one column represents the cells numbers 1..196 some other columns then need to have some cell characteristics, and with these characteristics and a formula (which i already have) the cell types need to be assigned (infrastructure, housing, facilities etc.) Can anyone help me any further? I would be very grateful for the help... -- Posted via http://www.ruby-forum.com/.