Has anyone made a Math plugin?

Get help using Construct 2

Post » Mon Oct 10, 2016 8:50 am

Has anyone made a Math Plugin on C2 or anything similar:

http://mathjs.org/

For example, I want to put an equation in a textbox and I want it to calculate the result.
Did anyone make this?

Thanks.
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
83
S
31
G
94
Posts: 1,166
Reputation: 63,468

Post » Mon Oct 10, 2016 9:03 am

@R0J0hound
@rexrainbow
@Aphrodite
@korbach
@blackhornet
@kyatric
@zenox98

Anyone?
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
83
S
31
G
94
Posts: 1,166
Reputation: 63,468

Post » Mon Oct 10, 2016 9:57 am

@chadorireborn

Browser.ExecJS( "3+2" )
Goodbye
B
115
S
31
G
295
Posts: 4,549
Reputation: 164,633

Post » Mon Oct 10, 2016 10:56 am

A very unexpected answer. But still, it makes life easier.....

Thanks a lot!!!
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
83
S
31
G
94
Posts: 1,166
Reputation: 63,468

Post » Mon Oct 10, 2016 11:53 am

@rexrainbow - What do I do for algebraic expressions?

For example: Some might put "AB" instead of "A*B".
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
83
S
31
G
94
Posts: 1,166
Reputation: 63,468

Post » Mon Oct 10, 2016 2:40 pm

Built-in javascriput does not support algebraic, math.js does not support algebraic, either.
Goodbye
B
115
S
31
G
295
Posts: 4,549
Reputation: 164,633

Post » Mon Oct 10, 2016 3:46 pm

@rexrainbow - Ohh. Okay. That actually makes sense considering the programming syntax. Thanks for the info.

I did not know making an automated algebra calculator can be challenging. If you were in my shoes, would you consider using arrays in what I'm trying to achieve or would you use something better?
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
83
S
31
G
94
Posts: 1,166
Reputation: 63,468

Post » Mon Oct 10, 2016 7:59 pm

If you limit your variables to a single character then you could make AB the same as A*B. However you'd need to make your own parser instead of using javascript.

I've done one before here:
viewtopic.php?f=147&t=153525&p=967756&hilit=parse#p967756
It's not a plugin and I don't have plans of making any more plugins.

Here's a more recent example:
https://dl.dropboxusercontent.com/u/542 ... eEval.capx
B
101
S
39
G
134
Posts: 5,591
Reputation: 85,520

Post » Tue Oct 11, 2016 3:47 pm

@R0J0hound - :D :D :D :D :D :D Best example ever, precise yet so readable. This is just the thing that I was looking for. I'm very impressed.
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
83
S
31
G
94
Posts: 1,166
Reputation: 63,468

Post » Wed Oct 12, 2016 5:35 am

@R0J0hound - How did you get the precedence of each operators?

I saw this:

Image

But I don't know how that became this:

Image
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
83
S
31
G
94
Posts: 1,166
Reputation: 63,468

Next

Return to How do I....?

Who is online

Users browsing this forum: hendi544, keithtammy and 3 guests