我正在尝试制作一个自动更改此人评级的程序。我遇到了一个我似乎无法解决的问题。这是代码:
Liam=1000;
Stefan=1000;
Dylan=1000;
Dennis=1000;
Daniel=1000;
K=32;
//eloX is the player who won
var ratingChange = function(PlayerX,PlayerY){
//Expected Winning percentage of player X
var EWP_X = 1/(1+10^((PlayerY-PLayerX)/400));
//WP=Winning Percentage
WP=1;
//Player X rating change
PlayerX = PlayerX+K*(WP-EWP_X);
console.log(PLayerX)
};
ratingChange(Liam,Dylan)
每当我测试这个Javascript时,我都会收到错误" PlayerX未定义"。我在Javascript中生锈了,所以我确定这是一个明显的问题,我看了。谢谢你的帮助!
答案 0 :(得分:2)
Javascript区分大小写。 L应该是l:
var EWP_X = 1/(1+10^((PlayerY-PlayerX)/400));
console.log(PlayerX)