Scratch that while loop, you're over complicating things. Try something like this instead:
PHP Code:
for (temp.i = NULL; temp.i < players.size(); temp.i ++) {
if (temp.i%10 < 6) {
// The top 6 spots
} else if (temp.i%10 < 10) {
// The other 4 spots
}
// Current 'player object' would be read as:
// players[temp.i]
}