Skip to content

Commit

Permalink
sortmemo() in case of draw sorts by average score - fix #13
Browse files Browse the repository at this point in the history
Line 460: test scores to decide to swap
  • Loading branch information
drbeco committed Apr 16, 2016
1 parent 78fc114 commit 7d5a6ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion qualcard.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ char *filenopath(char *filepath)
return filename;
}

/* prioritary (old) comes first (selection sort) */
/* prioritary (older) comes first (selection sort) */
void sortmemo(tcfg *c)
{
int i, j, iux;
Expand All @@ -457,6 +457,8 @@ void sortmemo(tcfg *c)
kj=newdate(c->cfdate[j], ave2day(c->cfave[j]));
if(ki>=kj) /* ki is after, invert */
{
if(ki==kj && c->cfave[i]<=c->cfave[j]) /* 1st score is lower, do not swap */
continue;
/* swap cards number */
iux=c->cfcard[i];
c->cfcard[i]=c->cfcard[j];
Expand Down

0 comments on commit 7d5a6ee

Please sign in to comment.