changed code -> Scoring is now more forgiving (-5 instead of -10 for not killing, 25 instead of 10 minimum)

This commit is contained in:
ElGurkus 2020-11-11 10:19:34 +01:00
parent 2317488087
commit 989db432c1

View File

@ -457,10 +457,10 @@ function checkWinCondition(){
}
}
function score (field){
if(field.piece === 0 && turnPlayer === "Player-Turn: X" && scoreCounterX > 10){
scoreCounterX -= 10;
} else if(field.piece === 0 && turnPlayer === "Player-Turn: O" && scoreCounterO > 10){
scoreCounterO -= 10;
if(field.piece === 0 && turnPlayer === "Player-Turn: X" && scoreCounterX > 25){
scoreCounterX -= 5;
} else if(field.piece === 0 && turnPlayer === "Player-Turn: O" && scoreCounterO > 25){
scoreCounterO -= 5;
} else if (field.piece === 1){
scoreO += scoreCounterO;
scoreCounterO = 100;