From: Dave Castellano Date: 2010-07-28T19:56:31+09:00 Subject: Re: multidimensional array insert syntax Jesús Gabriel y Galán wrote: > On Wed, Jul 28, 2010 at 4:02 AM, Dave Castellano > wrote: >> � ] >> >> >> # Randomly insert correct answer. >> �x = rand(4) >> �answer_choices.insert???????? �correct_ans_1 >> �answer_choices.insert???????? �correct_anno_1 >> >> >> I want to insert correct_ans_1 into position [x,0] and correct_anno_1 >> into position [x,0]. > > You nearly had it in that sentence: > > answer_choices[x][0] = correct_ans_1 > answer_choices[x][1] = correct_ano_1 > > (I assume you wanted to insert the correct_anno_1 in position 1 of the > array). > > Jesus. I actually want to insert rather than replace. Is there a way to do that?? Thanks! DC -- Posted via http://www.ruby-forum.com/.