I have a list, it contains (for example) 567+9-sinx/5
How do I translate the equation from the list, all into one equation on one block
like this
when I receive [turn into equation v] put in scripts to help turn into one equation here set [variable v] to <<[567]+[9]>-<<[sin v] of <x>>/[5]>>please help!
Offline
You're going to have to use a script that looks a little something like this first:
when I receive [turn into equation v] set [# v] to (0) repeat (length of (answer)) change [# v] by (1) if <[symbols] contains (letter (#) of (answer))> add (letter (#) of (answer)) to [ops v] else if <(last) = [Num]> replace item [last v] of [numbers v] with (item) else add (letter (#) of (answer)) to [numbers v] end end endSorry...not quite finished, I have other stuff to do, sorry. Hopefully this at least helps a bit!
Last edited by AtomicBawm3 (2012-03-19 23:37:05)
Offline
AtomicBawm3 wrote:
You're going to have to use a script that looks a little something like this first:
when I receive [turn into equation v] set [# v] to (0) repeat (length of (answer)) change [# v] by (1) if <[symbols] contains (letter (#) of (answer)> add (letter (#) of (answer)) to [ops v] else if <(last) = [Num]> replace item [last v] of [numbers v] with (item) else add (letter (#) of (answer)) to [numbers v] end end endSorry...not quite finished, I have other stuff to do, sorry. Hopefully this at least helps a bit!
What does symbols contain?
If someone can please explain this script to me and what it does, that would be helpful. I barely (if not at all) understand the scripts that I already make.
Offline
The best way I can describe it is with my own project . Read the scripts, it's easier programming then reading them though
Easier to understand
Harder to understand
Last edited by laptop97 (2012-03-20 18:30:55)
Offline
Thank you, I'll bump again if I don't know what to do.
Offline
Symbols would be a preset list you make containing the items:
+
-
*
/
^
(
)
then you can label each symbols "importance" in another list for PEMDAS to work...sorry, it's complicated, but could work.
Offline
I actually found a method (using laptop97's project). It will be based off of that, but a little more complicated since I am building a "grapher" project that one of the options for a graph is an equation.
Offline
Well, using an idea from laptop97's project I was able to finish one part of it. You can look at it here. Although some of the scripts will be kind of hard to understand.
Offline