Help on Ranking
Hi, my name is Nicholas I'm current new to programming and I'm working on a scoring program so it can help my friend record the score with ease.
The link below is an example on how the scoring works.
http://img.photobucket.com/albums/v684/nictan/example.jpg
http://img.photobucket.com/albums/v684/nictan/example.jpg
My question to it is
how can you do a Ranking system?
How can you do a prioritizing as in if the best of 3 scores are the same.
They will do a comparing with the score1 first if they are the same will proceed to the next score2 till score4
They will do a comparing with the score1 first if they are the same will proceed to the next score2 till score4
If all 4 scores are the same user can input who won that draw at the end of entering the score.
NicholasPosted Oct 10, 2005, 11:09 PM
MichaelPosted Oct 10, 2005, 8:02 PM
eg in an address book if 2 people have the surname Smith the given name is used to determine the order in which they are shown
SolitairePosted Oct 10, 2005, 7:43 PM
Array.Sort(arrayname);
MichaelPosted Oct 10, 2005, 7:42 PM
public void Sort(bool largeToSmall){
object obj;
for(int i=1;i
if(largeToSmall)
test = ((IComparable)items[i]).CompareTo((IComparable)items[i-1])>0;
else
test = ((IComparable)items[i]).CompareTo((IComparable)items[i-1])<0;
if(test){
obj = items[i];
items[i] = items[i-1];
items[i-1] = obj;
i-=2;
}
if(i<0)i=0
}
}
and you compare method says something like
public int CompareTo(object obj){
YourClass class = (YourClass)obj;
if(class.TotalScore
else{
if(class.Score1
else{
<
}
}
}
I've written the second bit on the fly so it's might have mistake (like having the < & > the wrong way round but generaly it should work