Make 3 stars possible in ep, stalemate, piece value and protection
parent
105e328f86
commit
481e660617
|
@ -28,7 +28,7 @@
|
|||
"watchify": "~3.7"
|
||||
},
|
||||
"dependencies": {
|
||||
"chess": "github:ornicar/chess.js#learn",
|
||||
"chess.js": "github:ornicar/chess.js#learn",
|
||||
"chessground": "github:ornicar/chessground#v3.8.0",
|
||||
"mithril": "github:ornicar/mithril.js#v1.0.0"
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ function getStageMaxScore(s) {
|
|||
function getStageRank(s, score) {
|
||||
var max = getStageMaxScore(s);
|
||||
if (typeof score !== 'number') score = score.reduce(function(a, b) { return a + b; }, 0);
|
||||
if (score === max) return 1;
|
||||
if (score >= max) return 1;
|
||||
if (score >= max - Math.max(200, s.levels.length * 150)) return 2;
|
||||
return 3;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue