How to express boolean logic as objects?
Posted on 2007-11-27
I have a dumb question. Assume I want to store three test questions, in which BOTH of the first two are true, OR the third is true. For instance, "If ( (Birdie is blue) AND (Duckie is yellow) ) OR (Bear is purple)..."
(I said this was a dumb question...)
I'd like to store each test as an object, and then manipulate them that way, probably in a tree. But I can't immediately think of a way to express the nested AND/OR conditions. How would you folks do it?