Logic problem: need better logic for desired thruth table.
sohcahtoa82 at gmail.com
sohcahtoa82 at gmail.com
Thu May 28 20:15:15 EDT 2015
On Thursday, May 28, 2015 at 3:17:10 PM UTC-7, Michael Torrie wrote:
> On 05/28/2015 03:58 PM, sohcahtoa82 at gmail.com wrote:
> > I think the logic you're really looking for is:
> >
> > return BotWaitForCooldown or (not (BotWaitForCooldown or CooldownDetected))
>
> Yes this is the simplest form. For more complicated truth tables you
> can create a K map and then apply a reduction algorithm to it. This is
> commonly done in logic circuits to reduce the number of gates to the
> minimum. While not faster, it can be expressed as:
>
> return BotWaitForCooldown or not BotWaitForCooldown and not
> CooldownDectected
>
> Order of operations puts the ands above the ors.
Order of operations might put the ands above the ors, but I still like using parentheses in expressions like that as I think it makes it more clear.
More information about the Python-list
mailing list