Hello, I am trying to make a simple equation solver with just addition, subtraction, multiplication, and division that follows the order of operations.
In order to do this, I have to have the multiplication and division in the equation done first.
Basically, TempList is the equation in list form that looks something like “1,x,4,+7,-9” so it would be 1*4+7-9
Here is the code:
But when I run the code, it always reads left to right. So 10-4*6 isn’t -14, it’s 24. I have tried adding wait blocks in between and here I split it into two functions but I really don’t know what I am doing wrong.
Any help would be appreciated. Thanks!
Hello, check 10 - 4*6
If there is a problem with block synchronization, then the best solution is to stop using Thinkable X until this huge problem is fixed. Otherwise, instead of developing applications, you will endlessly fight with bugs.
You look for “/” and you ask the program if “/” is = to 0 and to calculate if “/” is < of “x” or of 100?
Your code is very strange to me, can I ask you what it has to do?
In the TempCalcTF block, you are setting this variable to a numeric location of + or x.
In the TempCaLocation block, you are looking for either + or x in the TempCalcTF variable, but that variable is a number. So it will return 0.
Does that make sense?
After simplifying some blocks and adding a variable in between I got it to work
Don’t know why I need the extra variable…
But thanks for everyone’s help!