I'm not looking for anyone to GIVE ME the answer/ do homework for me.
I'm just looking for a turn in the right direction. Here is my code:

________________________________________________________________________

array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
min = 0
max = 0
x = 0
i = array.length - 1

while x < array.length - 1
  if array[x] > array[x - 1]
    max = x
  end
  x+=1
end

while i > 0 array.length - 1
  if array[i] < array[i + 1]
    min = i
  i-=1
  end
end

puts "Min is: #{min}."
puts "Max is: #{max}."

________________________________________________________________________

-- 
Posted via http://www.ruby-forum.com/.