Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail From: Grant Edwards Newsgroups: alt.comp.lang.borland-delphi,alt.comp.lang.c,att.lang.c++,comp.lang.c,comp.lang.python Subject: Re: Logic problem: need better logic for desired thruth table. Date: Thu, 28 May 2015 22:01:10 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 34 Message-ID: References: <3794b$55678d83$5419aafe$56138@news.ziggo.nl> NNTP-Posting-Host: 67-130-15-94.dia.static.qwest.net X-Trace: reader1.panix.com 1432850470 2906 67.130.15.94 (28 May 2015 22:01:10 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Thu, 28 May 2015 22:01:10 +0000 (UTC) User-Agent: slrn/1.0.1 (Linux) Xref: csiph.com comp.lang.c:62750 comp.lang.python:91389 On 2015-05-28, Skybuck Flying wrote: > I tried logic below... but funny enough it failed, now I feel like a > noob lol and share this funny little fail logic with you. > > Can you improve/fix the logic ? > # while DesiredResult==True: > # Desired truth table for BotWaitForCooldown and CooldownDetected > # BotWaitForCooldown: CooldownDetected: Desired Result: > # False False True > # False True False > # True False True > # True True True > # desired/suiting logic: > # (BotWaitForCooldown or ((not BotWaitForCooldown) and CooldownDetected)) I don't see why you think that's the desired logic, since it doesn't match your truth table or your test. > def TestLogic( BotWaitForCooldown, CooldownDetected ): > return BotWaitForCooldown or ((not BotWaitForCooldown) and CooldownDetected) > # this logic is flawed, please improve logic. def TestLogic( BotWaitForCooldown, CooldownDetected ): return not ((not BotWaitForCooldown) and CooldownDetected) works for me... -- Grant Edwards grant.b.edwards Yow! Alright, you!! at Imitate a WOUNDED SEAL gmail.com pleading for a PARKING SPACE!!