Boolean Expression Interpreter

Yeah, you would have to use parenthesis no matter what. The tree would actually be what real recursion would do.

I’m not sure how you would write a recursive algorithm to replace the tree, at best maybe you could make one to build it. From what I know about programming languages, the tree building is the approach most of them take, so I think it’s the best solution here.

1 Like

bruh.
I feel so stoopid.
There’s an and and or block.
and I didn’t even read/understand the topic correctly.

now that I’ve learned all about recursion from my cs course… :skull: :skull: :skull:

wait why do we need recursion if we could build a text extraction algorithm to do stuff with this… I’m confuzzled.

If we want to make the game change its own code, do we really need a text interpreter…? could we just activate/deactivate triggers based on what code should be changed?

2 Likes

I have nothing to do for the next 14 hours so I’m just gonna try and make this in python lmao

From there, you shouldn’t have any trouble importing the code into gimkit.

What about converting the boolean expressions into math operations?
Example:
(1 AND 0) XOR (0 XNOR 0)
AND: 1*0 = 0
XNOR: 1 - (0 + 0 - 2 * 0 * 0) = 1 - 0 = 1
XOR: 0 + 1 - 2 * 0 * 1 = 1 - 0 = 1

Math formulas:
NOT: 1 - a
AND: ab
OR: a + b - ab
XOR: a + b - 2 * a * b
XNOR: NOT (A XOR B)

2 Likes