Open Jack10270 opened 1 year ago
This issue is related to the math expression parsing library I am using on this plugin I think you should open an issue at https://github.com/Muqsit/arithmexp Their library doesn't seem to support solving equations yet
Hi sir,,in the repository arithm exp in readme there is this code I think for allow to add variables
$expression = $parser->parse("x + y");
var_dump($expression->evaluate(["x" => 2, "y" => 3])); // int(5)
var_dump($expression->evaluate(["x" => 1.5, "y" => 1.5])); // float(3)
It doesn't work as you think. I opened an issue on his library You can see here: https://github.com/Muqsit/arithmexp/issues/12
@NhanAZ I mean equation substitution, equation solver will different thing yes
If I will give equation a + b
and also give value for a
and b
, this is variable substitution
To do this the plugin will replace a
with 3
and b
with 4
and do calculation
If I will give equation a + bx
and ask to find value of x
, this is equation solving (solve for x)
To do this the plugin will do like "Let y = a + bx" or if its quadratic a(x^2)+bx+c
the plugin will do like "Let a(x^2)+bx+c=0"
But it will also be good to have equation solver but my intend here was variable substitution
(Sender) /calc x + 1
(Server) Enter value for variable x:
(Sender) 3
(Server) x + 1 = 4 where x = 3
Why don't you use something like this?
(Sender) /calc 3 + 1
(Server) Result: 4
(Sender) /calc x + 1 (Server) Enter value for variable x: (Sender) 3 (Server) x + 1 = 4 where x = 3
Why don't you use something like this?
(Sender) /calc 3 + 1 (Server) Result: 4
After about 2 years I realized my question was stupid :D
Hi this request for adding variable support to plugin
When user types expression sender can set value of variable:
For this cyou can use await-std to be done easy (code adapted from https://github.com/SOF3/await-std-examples/blob/master/BanHammer/src/SOFe/BanHammer/Main.php)