mirror of
https://github.com/Burn-E99/TheArtificer.git
synced 2026-06-04 09:03:50 -04:00
V2.0.2 - Fix faulty array.splice in solver
This commit is contained in:
@@ -61,8 +61,10 @@ export const fullSolver = (conf: (string | number | SolvedStep)[], wrapDetails:
|
||||
throw new Error('UnbalancedParens');
|
||||
}
|
||||
|
||||
// Replace the itemes between openParen and closeParen (including the parens) with its solved equilvalent by calling the solver on the items between openParen and closeParen (excluding the parens)
|
||||
conf.splice(openParen, closeParen + 1, fullSolver(conf.slice(openParen + 1, closeParen), true));
|
||||
// Call the solver on the items between openParen and closeParen (excluding the parens)
|
||||
const parenSolve = fullSolver(conf.slice(openParen + 1, closeParen), true);
|
||||
// Replace the itemes between openParen and closeParen (including the parens) with its solved equilvalent
|
||||
conf.splice(openParen, (closeParen - openParen + 1), parenSolve);
|
||||
|
||||
// Determing if we need to add in a multiplication sign to handle implicit multiplication (like "(4)2" = 8)
|
||||
// insertedMult flags if there was a multiplication sign inserted before the parens
|
||||
|
||||
Reference in New Issue
Block a user