Ok, problem solved for now, it seems:
I used video tutorial method and inverted it for the false case ;)
But anyway... I would not only need a "thruth table to logic/boolean
operations converter" but also a "boolean operations optimizer" ;)
# loop has to run if:
# 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))
def TestLogic( BotWaitForCooldown, CooldownDetected ):
# return BotWaitForCooldown or ((not BotWaitForCooldown) and
CooldownDetected) # this logic is flawed, please improve logic.
return (not ((not BotWaitForCooldown) and CooldownDetected)) # fixes it.
if TestLogic( False, False ) == True:
print "test 1 ok"
else:
print "test 1 failed"
if TestLogic( False, True ) == False:
print "test 2 ok"
else:
print "test 2 failed"
if TestLogic( True, False ) == True:
print "test 3 ok"
else:
print "test 3 failed"
if TestLogic( True, True ) == True:
print "test 4 ok"
else:
print "test 4 failed"
Bye,
Skybuck.
--
https://mail.python.org/mailman/listinfo/python-list