Skip to content

Instantly share code, notes, and snippets.

@arsatiki
Created May 4, 2009 14:23
Show Gist options
  • Save arsatiki/106478 to your computer and use it in GitHub Desktop.
Save arsatiki/106478 to your computer and use it in GitHub Desktop.
// Alustus:
var dict:Dictionary = new Dictionary();
var keys = new Array("tekniikka", "...");
for (var key in keys) {
dict[key] = {"name": key, "score": 0}
}
//Käyttö
dict["tekniikka"].score += 10;
// parhaat:
results = new Array();
for each (result in dict) {
results.push(result);
}
results.sortOn("score");
results.reverse(); // Ja sit siitä listan kaks ekaa alkiota
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment