PDA

View Full Version : determing lowest number


Joseph McGarvey
02-12-2003, 10:05 PM
Hi,
I am creating five variables based on random numbers. I want to evaluate the variables and return them in their ascending order and assign that value to each:

var redFinish = red.speed1 + red.speed2 + red.speed3

var yellowFinish = yellow.speed1 + yellow.speed2 + yellow.speed3

var greenFinish = green.speed1 + green.speed2 + green.speed3

var blueFinish = blue.speed1 + blue.speed2 + blue.speed3

var orangeFinish = orange.speed1 + orange.speed2 + orange.speed3


How do I evaluate these to determine which is the lowest/highest value?


As I said above, I want to then add to each object a "finish" value:

red.finish = 1
yellow.finish = 2

etc.

Thanks!

Terry
02-12-2003, 10:51 PM
Try out this link: http://www.edevcafe.com/docs/67