亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ladder_calc.c

?? 打魔獸戰網的都知道他是什么
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * Copyright (C) 1999  Rob Crittenden (rcrit@greyoak.com) * Copyright (C) 1999,2000  Ross Combs (rocombs@cs.nmsu.edu) * Copyright (C) 1999,2000  D.Moreaux (vapula@linuxbe.org) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. */#include "common/setup_before.h"#include <math.h>#ifdef HAVE_STRING_H# include <string.h>#else# ifdef HAVE_STRINGS_H#  include <strings.h># endif#endif#include "account.h"#include "account_wrap.h"#include "common/eventlog.h"#include "game.h"#include "common/tag.h"#include "ladder.h"#include "ladder_calc.h"#include "common/xalloc.h"#include "common/setup_after.h"static double probability(unsigned int a, unsigned int b) ;static int coefficient(t_account * account, t_clienttag clienttag, t_ladder_id id);static double two_player(unsigned int *rating);static double three_player(unsigned int *rating);static double four_player(unsigned int *rating);static double five_player(unsigned int *rating);static double five_f1(int a, int b, int c, int d, int e) ;static double five_f2(int a, int b, int c) ;static double six_player(unsigned int *rating);static double six_f1(int a, int b, int c, int d, int e, int f) ;static double six_f2(int a, int b, int c, int d, int e, int f) ;static double six_f3(int a, int b, int c, int d) ;static double seven_player(unsigned int *rating);static double seven_f1(int a, int b, int c, int d, int e, int f, int g) ;static double seven_f2(int a, int b, int c, int d, int e, int f, int g) ;static double eight_player(unsigned int *rating);static double eight_f1(int a, int b, int c, int d, int e, int f, int g) ;static double eight_f2(int a, int b, int c, int d, int e, int f, int g) ;static double eight_f3(int a, int b, int c, int d, int e) ;/* * Compute probability of winning using the Elo system * * The formula is: * *  D = rating(player a) - rating(player b) * *                    1 *  Pwin(D) = ------------------ *                   -(D / 400) *             1 + 10 */static double probability(unsigned int a, unsigned int b){    double i, j;        i = (((double)a) - ((double)b)) / 400.0;        j = pow(10.0,-i);        return (1.0 / (1.0+j));}/* *  This is the coefficient k which is meant to enhance the *  effect of the Elo system where more experienced players *  will gain fewer points when playing against newbies, and *  newbies will gain massive points if they win against an *  experienced player. It also helps stabilize a player's *  rating after they have played 30 games or so. * *  K=50 for new players *  K=30 for players who have played 30 or more ladder games *  K=20 for players who have attained a rating of 2400 or higher */static int coefficient(t_account * account, t_clienttag clienttag, t_ladder_id id){    int const total_ladder_games=account_get_ladder_wins(account,clienttag,id) +				 account_get_ladder_losses(account,clienttag,id) +				 account_get_ladder_disconnects(account,clienttag,id);        if (total_ladder_games < 30)	return 50;        if (account_get_ladder_rating(account,clienttag,id) < 2400)	return 30;        return 20;}/* * The Elo system only handles 2 players, these functions extend * the calculation to different numbers of players as if they were * in a tournament. It turns out the math for this is really ugly, * so we have hardcoded the equations for every number of players. */static double two_player(unsigned int *rating){    unsigned int a,b;    double       ab;        a = rating[0];    b = rating[1];        ab = probability(a,b);        return ab;}static double three_player(unsigned int *rating){    unsigned int a,b,c;    double       ab,ac,bc,cb;        a = rating[0];    b = rating[1];    c = rating[2];        ab = probability(a,b);    ac = probability(a,c);    bc = probability(b,c);    cb = 1.0 - bc;    return (2*(ab*ac)+(bc*ab)+(cb*ac))/3;}static double four_player(unsigned int *rating){    unsigned int a,b,c,d;    double       ab,ac,ad,bc,bd,cb,cd,db,dc;        a = rating[0];    b = rating[1];    c = rating[2];    d = rating[3];        ab = probability(a,b);    ac = probability(a,c);    ad = probability(a,d);    bc = probability(b,c);    bd = probability(b,d);    cd = probability(c,d);    cb = 1.0 - bc;    db = 1.0 - bd;    dc = 1.0 - cd;        return (ab*ac*(cd+bd)+ac*ad*(db+cb)+ab*ad*(dc+bc))/3;}/* [Denis MOREAUX <vapula@linuxbe.org>, 10 Apr 2000] * *     C D E          A D E   The winner may be in the * A B  C E       B C  A E    2 players or the 3 players *  A    C         B    A     group. In either case, a *    A              A        second player must be choosen *                            to be either the one playing * against A in the 2-players subtree or being the winner * of the 2-player subtree if A is in the 3-players subtree. */static double five_player(unsigned int *rating){    unsigned int a,b,c,d,e;        a = rating[0];    b = rating[1];    c = rating[2];    d = rating[3];    e = rating[4];        return (five_f1(a,b,c,d,e)+five_f1(a,c,d,e,b)+            five_f1(a,d,e,b,c)+five_f1(a,e,b,c,d))/30;}/* [Denis MOREAUX <vapula@linuxbe.org>, 10 Apr 2000 * * Two cases to treat : AB-CDE and BC-ADE. * in both cases, A win against B. * In the first case, A win over the winner of a 3-players game * (3 possible winners). * In the second case, B win over one of the three other and A is in * the 3-players game. */static double five_f1(int a, int b, int c, int d, int e){    double ab,ac,ad,ae,bc,bd,be;    ab = probability(a,b);    ac = probability(a,c);    ad = probability(a,d);    ae = probability(a,e);    bc = probability(b,c);    bd = probability(b,d);    be = probability(b,e);    return ab*(ac*five_f2(c,d,e)+ad*five_f2(d,e,c)+ae*five_f2(e,c,d)+               bc*five_f2(a,d,e)+bd*five_f2(a,c,e)+be*five_f2(a,c,d));}static double five_f2(int a, int b, int c){    double       ab,ac,bc,cb;    ab = probability(a,b);    ac = probability(a,c);    bc = probability(b,c);    cb = 1.0 - bc;    return (2*(ab*ac)+bc*ab+cb*ac);}static double six_player(unsigned int *rating){    unsigned int a,b,c,d,e,f;        a = rating[0];    b = rating[1];    c = rating[2];    d = rating[3];    e = rating[4];    f = rating[5];/* A B C D *  A   C    E F *    A       E *        A */    return (six_f1(a,b,c,d,e,f)+  /* A is in group of 4 */            six_f1(a,b,c,e,d,f)+            six_f1(a,b,e,d,c,f)+            six_f1(a,e,c,d,b,f)+            six_f1(a,b,c,f,d,e)+            six_f1(a,b,f,d,c,e)+            six_f1(a,f,c,d,b,e)+            six_f1(a,e,f,b,c,d)+            six_f1(a,e,f,c,b,d)+            six_f1(a,e,f,d,b,c)+            six_f2(a,b,c,d,e,f)+   /* A is in group of 2 */            six_f2(a,c,b,d,e,f)+            six_f2(a,d,b,c,e,f)+            six_f2(a,e,b,c,d,f)+            six_f2(a,f,b,c,d,e))/45;}/* ABCD = group of 4, EF = group of 2, A must win *//* D.Moreaux, 10 Apr 2000: changed double to int for the parameters */static double six_f1(int a, int b, int c, int d, int e, int f){    double ab,ac,ad,bc,bd,cb,cd,db,dc,ef,fe,ae,af;        ab = probability(a,b);    ac = probability(a,c);    ad = probability(a,d);    ae = probability(a,e);    af = probability(a,f);    bc = probability(b,c);    bd = probability(b,d);    cd = probability(c,d);    ef = probability(e,f);    cb = 1.0 - bc;    db = 1.0 - bd;    dc = 1.0 - cd;    fe = 1.0 - ef;    return (ab*ac*(cd+bd)+ac*ad*(db+cb)+ab*ad*(dc+bc))*(ef*ae+fe*af);}/* AB is group of 2, CDEF is group of 4, A must win */static double six_f2(int a, int b, int c, int d, int e, int f){    double ab,ac,ad,ae,af;        ab = probability(a,b);    ac = probability(a,c);    ad = probability(a,d);    ae = probability(a,e);    af = probability(a,f);        return (six_f3(c,d,e,f)*ab*ac+            six_f3(d,c,e,f)*ab*ad+            six_f3(e,c,d,f)*ab*ae+            six_f3(f,c,d,e)*ab*af);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91蜜桃视频在线| 欧美一区二区视频网站| 日本成人在线看| 国产精品免费看片| 欧美电影免费提供在线观看| 色诱亚洲精品久久久久久| 久久99热这里只有精品| 亚洲日本va午夜在线电影| 精品国精品自拍自在线| 欧美日韩另类国产亚洲欧美一级| 粗大黑人巨茎大战欧美成人| 老司机午夜精品| 亚洲福中文字幕伊人影院| 亚洲视频1区2区| 国产欧美精品在线观看| 欧美sm极限捆绑bd| 91精品国产aⅴ一区二区| 欧美亚洲综合色| 色综合天天综合网天天看片| 高清不卡一区二区在线| 国内外精品视频| 久久精品999| 男女男精品视频网| 亚洲成a天堂v人片| 亚洲大片精品永久免费| 亚洲一区二区视频在线| 亚洲一级片在线观看| 亚洲激情在线播放| 一区二区三区在线免费视频| 亚洲免费av网站| 亚洲男人的天堂av| 亚洲六月丁香色婷婷综合久久| 中文字幕亚洲欧美在线不卡| 国产精品久久久久久户外露出 | 欧美大片在线观看一区| 欧美肥妇bbw| 91精品国产品国语在线不卡| 欧美福利一区二区| 91精品国产免费| 欧美大片日本大片免费观看| 精品国产制服丝袜高跟| 久久亚洲一级片| 国产欧美日韩另类视频免费观看| 国产日韩欧美电影| 国产精品热久久久久夜色精品三区| 国产色综合久久| 国产精品高潮呻吟| 夜夜精品视频一区二区| 首页欧美精品中文字幕| 久久av资源网| 国产成人99久久亚洲综合精品| 成人妖精视频yjsp地址| 色综合久久99| 欧美精品电影在线播放| 精品国产伦一区二区三区观看体验 | 麻豆免费精品视频| 激情久久五月天| 成人app在线观看| 在线观看成人免费视频| 91精品福利在线一区二区三区 | 不卡的av在线| 欧美亚洲国产一区二区三区va | yourporn久久国产精品| 91久久国产最好的精华液| 欧美日本一区二区三区四区| 91精品国产综合久久国产大片 | 中文字幕制服丝袜一区二区三区 | 成人h精品动漫一区二区三区| 成年人午夜久久久| 欧美三级视频在线| 久久综合九色综合97婷婷女人 | 国产福利一区二区三区| 99热在这里有精品免费| 欧美久久久久久蜜桃| 久久精品日产第一区二区三区高清版 | 91福利社在线观看| 日韩欧美国产三级| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 国产精品无遮挡| 亚洲一区二区欧美日韩| 国产一区二区在线看| 色综合天天综合网国产成人综合天 | 日韩黄色在线观看| 成人性视频网站| 欧美一区二区视频在线观看2020| 国产精品入口麻豆原神| 婷婷丁香久久五月婷婷| 成人午夜在线视频| 欧美一级二级三级乱码| 中文字幕亚洲一区二区av在线| 免费成人av在线| 91国产精品成人| 欧美高清在线一区| 日本午夜一区二区| 色香蕉成人二区免费| 久久亚洲一区二区三区明星换脸| 亚洲一区二区三区免费视频| 国产不卡视频一区二区三区| 欧美一区二区三区免费观看视频| 中文字幕制服丝袜成人av| 久国产精品韩国三级视频| 欧美色爱综合网| 国产精品三级av| 国产美女娇喘av呻吟久久| 欧美日韩亚州综合| 最近中文字幕一区二区三区| 国内外精品视频| 4438成人网| 亚洲成av人片一区二区三区| 91免费视频大全| 国产精品私人影院| 国产美女视频一区| 欧美大片在线观看一区二区| 午夜日韩在线观看| 一本大道久久a久久综合婷婷| 国产欧美一区二区精品忘忧草| 免费在线观看视频一区| 欧美日韩不卡一区二区| 依依成人精品视频| 91蜜桃在线观看| 亚洲人吸女人奶水| 成人av中文字幕| 国产精品久久久久影视| 国产成a人无v码亚洲福利| 久久麻豆一区二区| 国产麻豆精品95视频| 久久久夜色精品亚洲| 精品一区二区在线视频| 欧美一区二区视频免费观看| 日本免费在线视频不卡一不卡二| 欧洲在线/亚洲| 亚洲午夜一区二区| 欧美日韩国产一区| 丝袜a∨在线一区二区三区不卡| 欧美日韩一本到| 天堂精品中文字幕在线| 欧美一级片在线| 久久99精品久久久久| 久久一留热品黄| 成人三级在线视频| 日韩美女视频一区二区 | 在线观看免费一区| 亚洲国产成人va在线观看天堂| 欧美日韩五月天| 琪琪一区二区三区| 欧美不卡视频一区| 国产成人免费视频网站| 中文字幕日韩精品一区| 日本精品视频一区二区| 丝袜美腿亚洲综合| 精品日韩在线观看| 丁香网亚洲国际| 亚洲免费在线看| 欧美人与禽zozo性伦| 理论电影国产精品| 国产欧美一区二区精品性色 | 另类小说图片综合网| 久久久精品综合| 成人av电影在线播放| 亚洲一区视频在线观看视频| 在线不卡免费欧美| 国产在线精品一区二区三区不卡| 国产精品蜜臀在线观看| 欧美手机在线视频| 久久丁香综合五月国产三级网站| 欧美国产精品一区| 欧美日韩综合在线免费观看| 久久精品国产色蜜蜜麻豆| 国产精品天天看| 8x8x8国产精品| 国产成人av电影在线播放| 亚洲自拍另类综合| 久久综合视频网| 日本精品一区二区三区四区的功能| 奇米一区二区三区av| 国产精品国产三级国产有无不卡| 欧美日韩一级黄| 国产精品一区二区在线观看网站| 亚洲精品日韩综合观看成人91| 日韩精品一区二区三区视频| 波波电影院一区二区三区| 日韩专区在线视频| 国产精品黄色在线观看| 日韩午夜精品电影| 色老汉av一区二区三区| 国产一区二区三区黄视频| 一区二区在线看| 国产欧美一区二区三区在线看蜜臀 | 国产精品网友自拍| 欧美一区日本一区韩国一区| 国产91精品在线观看| 日本不卡一区二区三区| 中文字幕一区av| 日韩精品专区在线影院重磅| 91成人在线精品| 粉嫩蜜臀av国产精品网站| 秋霞电影网一区二区| 亚洲欧美国产77777| 国产欧美视频在线观看| 日韩一区二区三区视频在线 |