Quote:
Another one for Thantos, why such a excessive rand function? Using floats then coercing them to ints; I don't know why? To have a one line for loop
Because rand() returns an int and RAND_MAX is an int so if you don't promote one of them to float when you do the division you'll get 0 everytime. Search the board and you'll see better ways for sorting and random but like I said, I was going for something I could throw together to setup the data in a way that shows what needed to be done in the function accuratly.