void Results_addsorted(Results re, Round ro) { re->ntotal++ ; /* Si liste vide ou points>max , on réinitialise la liste avec ce round */ if (re->nresults == 0 || Round_points(ro)>Round_points(re->list[0])) { Results_init_p(re) ; re->list[0]=Round_create() ; Round_copy(re->list[0],ro); re->nresults = 1 ; } else if (Round_points(ro) == Round_points(re->list[0])) { /* Sinon points=max et on ajoute un isotop à la liste */ re->list[re->nresults]=Round_create() ; Round_copy(re->list[re->nresults],ro); re->nresults++ ; } }
int traite_joker(Game game, int num) { int i; int score = 2 ; Round round ; round=Round_create() ; Game_getsearchedround(game,num,round) ; for(i=0; i < Round_wordlen(round); i++) { if (Round_playedfromrack(round,i)) { if (Round_joker(round,i)) { score -= 1 ; } } } Round_destroy(round) ; if (verbeux >=2) { printf("<score_joker>%d</score_joker>\n", score); } return score ; }