Siden det er en highscore er det vel også relevant at huske hvem der egentlig satte den?
- Dictionary<string, int> _highscore = new Dictionary<string, int>();
-
- _highscores.Add("Jens", 1001);
- _highscores.Add("Andre", 1000);
-
- Dictionary<string, int> sorted = (from entry in _highscores orderby entry.Value descending select entry).ToDictionary(pair => pair.Key, pair => pair.Value);
- foreach (var kvp in sorted)
- {
- Console.WriteLine(kvp.Key + " : " + kvp.Value);
- }
Indlæg senest redigeret d. 21.08.2011 00:09 af Bruger #14652