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