mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-03-08 03:24:48 +01:00
Fix Math Expressions contract
Previously player could submit as many wrong answers in the solution as they wanted, as long as all correct answers were included. Fixed by ensuring length matches actual answer.
This commit is contained in:
@ -1271,6 +1271,8 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
|
|||||||
|
|
||||||
const result: string[] = [];
|
const result: string[] = [];
|
||||||
helper(result, "", num, target, 0, 0, 0);
|
helper(result, "", num, target, 0, 0, 0);
|
||||||
|
// Prevent player from providing extra wrong answers and still receiving credit
|
||||||
|
if (result.length !== sanitizedPlayerAnsArr.length) return false;
|
||||||
|
|
||||||
for (const expr of result) {
|
for (const expr of result) {
|
||||||
if (!sanitizedPlayerAnsArr.includes(expr)) {
|
if (!sanitizedPlayerAnsArr.includes(expr)) {
|
||||||
|
Reference in New Issue
Block a user