mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-11 18:23:54 +01:00
Accept valid JSON arrays in coding contracts
This commit is contained in:
parent
1c801c5651
commit
f439f960b7
@ -884,14 +884,17 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
|
|||||||
|
|
||||||
dfs(0, 0, left, right, data, "", res);
|
dfs(0, 0, left, right, data, "", res);
|
||||||
|
|
||||||
const sanitizedPlayerAns = removeBracketsFromArrayString(ans).replace(/\s/g, "");
|
const sanitizedPlayerAns: string = removeBracketsFromArrayString(ans);
|
||||||
|
const sanitizedPlayerAnsArr: string[] = sanitizedPlayerAns.split(",");
|
||||||
|
for (let i = 0; i < sanitizedPlayerAnsArr.length; ++i) {
|
||||||
|
sanitizedPlayerAnsArr[i] = removeQuotesFromString(sanitizedPlayerAnsArr[i]).replace(/\s/g, "");
|
||||||
|
}
|
||||||
|
|
||||||
const playerAnsArray: string[] = sanitizedPlayerAns.split(",");
|
if (sanitizedPlayerAnsArr.length !== res.length) {
|
||||||
if (playerAnsArray.length !== res.length) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (const resultInAnswer of res) {
|
for (const resultInAnswer of res) {
|
||||||
if (!playerAnsArray.includes(resultInAnswer)) {
|
if (!sanitizedPlayerAnsArr.includes(resultInAnswer)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user