mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-18 15:28:43 +02:00
Simplified some booleans and if elses
This commit is contained in:
@@ -307,15 +307,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
|
||||
reach = Math.max(i + data[i], reach);
|
||||
}
|
||||
const solution: boolean = i === n;
|
||||
|
||||
if (ans === "1" && solution) {
|
||||
return true;
|
||||
}
|
||||
if (ans === "0" && !solution) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return (ans === "1" && solution) || (ans === "0" && !solution);
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -921,7 +913,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
|
||||
"The provided answer should be an array of strings containing the valid expressions.",
|
||||
"The data provided by this problem is an array with two elements. The first element",
|
||||
"is the string of digits, while the second element is the target number:\n\n",
|
||||
`["${digits}", ${target}]\n\n`,
|
||||
`["${digits}", ${target}]\n\n`,
|
||||
"NOTE: The order of evaluation expects script operator precedence",
|
||||
"NOTE: Numbers in the expression cannot have leading 0's. In other words,",
|
||||
`"1+01" is not a valid expression`,
|
||||
|
||||
Reference in New Issue
Block a user