X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=mcwordfeud.cpp;fp=mcwordfeud.cpp;h=c8d28a47b85bcf933374d49f1339378bcd4bee31;hb=464befbe16de81e327e2317ac88aaab2311fbcdb;hp=0010010d89a5d002a105ad6267b8ceedf3f0a9cd;hpb=2d60f0d0b70fe99afcd7d3d9360aa7357aa18022;p=wloh diff --git a/mcwordfeud.cpp b/mcwordfeud.cpp index 0010010..c8d28a4 100644 --- a/mcwordfeud.cpp +++ b/mcwordfeud.cpp @@ -14,6 +14,8 @@ using namespace std; #define MAX_PLAYERS 16 +float match_stddev = 70.0f; + struct player { int player_index; int points, margin; @@ -66,6 +68,11 @@ int main(int argc, char **argv) { int trials = atoi(argv[1]); + if (scanf("%f", &match_stddev) != 1) { + fprintf(stderr, "Could't read match stddev\n"); + exit(1); + } + int num_players; if (scanf("%d", &num_players) != 1) { fprintf(stderr, "Could't read number of players\n"); @@ -145,7 +152,7 @@ int main(int argc, char **argv) float mu = ratings[pl1] - ratings[pl2]; - int score = lrintf(draw_gaussian(mu, 82.9f)); + int score = lrintf(draw_gaussian(mu, match_stddev)); scores[pl1][pl2] = score; scores[pl2][pl1] = -score; }