V2.0.2 - Fix faulty array.splice in solver
This commit is contained in:
parent
c4c7098479
commit
f4b0e04cec
|
@ -1,4 +1,4 @@
|
|||
# The Artificer - A Dice Rolling Discord Bot | V2.0.1 - 2022/07/08
|
||||
# The Artificer - A Dice Rolling Discord Bot | V2.0.2 - 2022/07/08
|
||||
[](https://sonarcloud.io/summary/new_code?id=TheArtificer)
|
||||
[](https://sonarcloud.io/summary/new_code?id=TheArtificer) [](https://sonarcloud.io/summary/new_code?id=TheArtificer) [](https://sonarcloud.io/summary/new_code?id=TheArtificer) [](https://sonarcloud.io/summary/new_code?id=TheArtificer) [](https://sonarcloud.io/summary/new_code?id=TheArtificer) [](https://sonarcloud.io/summary/new_code?id=TheArtificer)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
export const config = {
|
||||
'name': 'The Artificer', // Name of the bot
|
||||
'version': '2.0.1', // Version of the bot
|
||||
'version': '2.0.2', // Version of the bot
|
||||
'token': 'the_bot_token', // Discord API Token for this bot
|
||||
'localtoken': 'local_testing_token', // Discord API Token for a secondary OPTIONAL testing bot, THIS MUST BE DIFFERENT FROM "token"
|
||||
'prefix': '[[', // Prefix for all commands
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue