|
|
@@ -811,7 +811,7 @@ int optimize(int argc, char *argv[]){
|
|
|
stats.acc >= min_stats.acc
|
|
|
){
|
|
|
for (int i = 1; i < 7; i ++)
|
|
|
- strcpy(results[result_count].rune_ids[i - 1], runes[i][index[i]].id);
|
|
|
+ strcpy(results[result_count].rune_ids[i - 1], runes[i][index[i]].id)cd ..;
|
|
|
result_count ++;
|
|
|
//printf("Result found: %d\n", results);
|
|
|
}
|
|
|
@@ -924,6 +924,25 @@ int unit_callback(void *NotUsed, int argc, char **argv, char **azColName) {
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+void sort_results(Result results[1000], int total){
|
|
|
+ // Bubble sort
|
|
|
+ int i, j;
|
|
|
+ Result temp;
|
|
|
+
|
|
|
+ for (i = 0; i < total - 1; i++)
|
|
|
+ {
|
|
|
+ for (j = 0; j < (total - 1-i); j++)
|
|
|
+ {
|
|
|
+ if (results[j].rating < results[j + 1].rating)
|
|
|
+ {
|
|
|
+ temp = results[j];
|
|
|
+ results[j] = results[j + 1];
|
|
|
+ results[j + 1] = temp;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
int md_comparator(const void *v1, const void *v2){
|
|
|
const Result *p1 = (Result *)v1;
|
|
|
const Result *p2 = (Result *)v2;
|