# Parenthesis check. Having a random brain day (Solved)

**URL:** <https://forum.choiceofgames.com/t/parenthesis-check-having-a-random-brain-day-solved/6129>\
**Category:** ChoiceScript Help\
**Created:** [November 30, 2014, 12:03pm UTC](https://forum.choiceofgames.com/t/parenthesis-check-having-a-random-brain-day-solved/6129 "2014-11-30T12:03:57Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Havenstone](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/havenstone/32/198451_2.png) [@Havenstone](https://forum.choiceofgames.com/u/Havenstone)\
**Post date:** [November 30, 2014, 12:19pm UTC](https://forum.choiceofgames.com/t/parenthesis-check-having-a-random-brain-day-solved/6129/2 "2014-11-30T12:19:46Z")

</div>

I assume that “var” actually represents a bunch of different variables? Might be clearer for examples like this if you differentiate them e.g. (var1=true) and (var2=false).

I think what you’ve got there is in danger of triggering if the last variable is “both”, regardless of what’s happening with the other variables. For what you describe, I suspect this would work better:

\*if ((var1 = false) and (var2 = true)) and ((var3 = “female”) or (var3 = “both”))

Note that if var3 is a sexual orientation variable with three possible values (male, female, or both), you could more simply use (var3 != “male”) instead of =“female” or =“both”. The exclamation point means not, i.e. var3 is not equal to male.

Have a look at this post for a walkthrough of a mixed or/and condition:

> [@Is it possible... (making or/and statements with 3+ variables)](https://forum.choiceofgames.com/t/is-it-possible-making-or-and-statements-with-3-variables/2411/11):
>
> Glad it’s handy. slight_smile Since you mention and statements, it’s worth noting that they’re a little bit trickier, because the order matters. Don’t know if this example will be helpful to anyone at all, but here’s a stab: If everything is an or, then each variable is equally important in the outcome. Imagine a game with some true/false variables that describe how our companion Dex has developed over the course of the story so far: Will you vote for Dex as leader of the party? \*if (axe\_…

---

_[View the full topic](https://forum.choiceofgames.com/t/parenthesis-check-having-a-random-brain-day-solved/6129)._
