Hi,
I have the following function in a program that I am modifying. I know that its sorting a collection of Card classes by the Rank property.
But I don't understand the code, why are they multiplying the rank value by 100?
Code:private class RankComparer : IComparer<Card> { public int Compare(Card x, Card y) { return (100 * (int)x.Rank + (int)x.Suit).CompareTo(100 * (int)y.Rank + (int)y.Suit); } }




Reply With Quote