3d54128999a0d003014c69935ecba8dd5ef1059d
[vchess.git] / client / src / utils / scoring.js
1 // Default score message if none provided
2 export function getScoreMessage(score, reverseColors) {
3 let eogMessage = "Undefined"; //not translated: unused
4 switch (score) {
5 case "1-0":
6 eogMessage = (!reverseColors ? "White win" : "Black win");
7 break;
8 case "0-1":
9 eogMessage = (!reverseColors ? "Black win" : "White win");
10 break;
11 case "1/2":
12 eogMessage = "Draw";
13 break;
14 case "?":
15 eogMessage = "Undetermined result";
16 break;
17 }
18 return eogMessage;
19 }