Hello,

This question is following on from my post 'making an array of arrays?', 
but as it is about replacing elements I have started a new thread.

The reply to my last arrays related post did solve one problem, so 
thanks very much for that!

So, I now have an @offspring array that takes copies of @board (a sudoku 
board) according to a population specified by the user.

The aim is to populate all empty cells in @offspring with random 
numbers, but for now I am just populating them with '9'.
Empty cells were represented by '")', but are now represented by '0'
Currently the population is fixed at 4, and my current code is:

     def find_empty!
     #Loop through @offspring and where ever there is "_" put a random 
number.
     4.times do |i|
     if @offspring[i] == 0
     then @offspring[i] = 9
     end
     #For debugging with the test puzzle
     puts @offspring.inspect
     end

When I print out offspring I expect the first element to be changed to 
9, as it was originally set to 0, this is however not the case. I'm sure 
I'm being very dumb, but if someone could please point me in the right 
direction that would be great.

Note I have tried the same thing but using a for loop instead of the 
.times method. This gave me the same results.

Thanks in advance for any advice,
Jen.