d6b916cf14016cfa0750fabd7055acb0dc8536b7
[vchess.git] / client / src / data / problemCheck.js
1 export function checkProblem(p) {
2 const vid = parseInt(p.vid);
3 if (isNaN(vid) || vid <= 0) return "Please select a variant";
4
5 if (!V.IsGoodFen(p.fen)) return "Errors in FEN";
6
7 if (p.instruction.trim().length == 0) return "Missing instructions";
8
9 if (p.solution.trim().length == 0) return "Missing solution";
10
11 return "";
12 }