@char = charlist # array holding the character data
@match = false
for i in 0..@char.size - 1 do
@char[i].position_x = rand(1...4) #randomize x position
@char[i].position_y = rand(1...4) #randomize y position
if @char[i].index != 0
for ii in 0..@char[i].index - 1 do
if @char[i].position_x = @char[ii].position_x #if x matches
and @char[i].position_y = @char[ii].position_y #and if y matches
@match = true #a match was found
end
end
if @match = true #if a match was found
redo #redo the for loop
end
end
end