Difference between revisions of "Category:Conditions"

228 bytes added ,  22:11, 1 November 2013
a further refinement of Complex Conditions discussion
imported>Egocarib
imported>Egocarib
(a further refinement of Complex Conditions discussion)
Line 90: Line 90:




If we properly distribute these conditions using the formula above, the first '''OR'''-block that checks for ('''''A''''' OR '''''C''''' OR '''''E''''') will, in our case, be a check for ((Global == 1) OR (Global == 2) OR (Global == 3)). If these are the only three valid settings for our global variable, we know that this block of statements will ''always be true'', so we can simply eliminate it from our conditions list to shorten things up. Furthermore, the last check for ('''''B''''' OR '''''D''''' OR '''''F''''') will also always be true, because the actor's health will always be at 100% or less, so that final OR-block can also be eliminated. Thus, by taking these steps we would have cut our condition list down from 30 conditions to only 24!
If we properly distribute these conditions using the formula above, the first '''OR'''-block that checks for ('''''A''''' OR '''''C''''' OR '''''E''''') will, in our case, be a check for ((Global == 1) OR (Global == 2) OR (Global == 3)). If these are the only three valid settings for our global variable, we know that this block of statements will ''always be true'', so we can simply eliminate it from our conditions list to shorten things up. Furthermore, any triplet of ORs above that includes condition F (Health <= 100%) will also always be true, because the actor's health will always be at 100% or less, so we can eliminate several more sets of conditions as a result, leaving us with:
 
'''''A''''' OR '''''D''''' OR '''''E'''''  &nbsp;&nbsp;AND&nbsp;&nbsp;  '''''B''''' OR '''''C''''' OR '''''E'''''  &nbsp;&nbsp;AND&nbsp;&nbsp;  '''''B''''' OR '''''D''''' OR '''''E'''''
 
 
Thus, by taking these steps we would have cut our condition list down from 30 conditions to only 9!




Anonymous user