simplify huge if statements - design pattern?
<p>i potentially have a set of if statements that look like this:</p>

<pre><code>if (a and b and c and d) {
  // do stuff
} else (!a and b and c and d) {
  // do something else
} else (!a and !b and c and D) {
  // do yet something else
} ...
</code></pre>

<p>and so on for all possible permutations.</p>

<p>i thought of doing this:</p>

<pre><code>switch ((a ? 'Y' : 'N') . (b ? 'Y' : 'N') . (c ? 'Y' : 'N') . (d ? 'Y' : 'N')) {

  case 'YNYN':
    // do stuff
    break;

  case 'NNNN':
    // etc.
    break;

}
</code></pre>

<p>is there a better way?</p>
