X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=mcwordfeud.cpp;h=049a2196b998b2c53d38c296733f1d243493e89a;hb=79ca58ab629b09e8fe59415578d2ee1ea5cb2079;hp=3b55f01c88ee5dc4433d1322a8c49209dd884d14;hpb=2ce26bc034e52454b894a17c9665fb562c1559e4;p=wloh diff --git a/mcwordfeud.cpp b/mcwordfeud.cpp index 3b55f01..049a219 100644 --- a/mcwordfeud.cpp +++ b/mcwordfeud.cpp @@ -196,8 +196,13 @@ int main(int argc, char **argv) float mu = drawn_ratings(pl1) - drawn_ratings(pl2); int score = lrintf(draw_gaussian(mu, match_stddev)); - scores[pl1][pl2] = score; - scores[pl2][pl1] = -score; + if (score >= 0) { + scores[pl1][pl2] = score; + scores[pl2][pl1] = 0; + } else { + scores[pl1][pl2] = 0; + scores[pl2][pl1] = -score; + } } } @@ -249,7 +254,7 @@ int main(int argc, char **argv) continue; } float mu = drawn_ratings(pl1) - drawn_ratings(pl2); - float z = (scores[pl1][pl2] - mu) / match_stddev; + float z = (scores[pl1][pl2] - scores[pl2][pl1] - mu) / match_stddev; llh -= z * z * 0.5f; } } @@ -277,7 +282,7 @@ int main(int argc, char **argv) if (has_scores[pl1][pl2]) { continue; } - printf("%s %s %d\n", players[pl1].c_str(), players[pl2].c_str(), mlm_scores[pl1][pl2]); + printf("%s %s %d\n", players[pl1].c_str(), players[pl2].c_str(), mlm_scores[pl1][pl2] - mlm_scores[pl2][pl1]); } } }