digital_electricity: Fix terminals default value being 0

Authored by rudranilbasu on Aug 18 2017, 10:18 PM.

Description

digital_electricity: Fix terminals default value being 0

Previously, the gates would work when one of the input terminals out of
the two is connected. For example, if only one terminal is connected to
an OR gate and it is of value 1, the output will be = 1, even though the
other terminal is not connected to any input. This is corrected by
checking whether both of the terminals are connected via some wire and
setting the input accordingly, ie:

output value = (terminal 1 is connected && terminal 2 is connected) ?
calculate value : 0

Signed-off-by: Rudra Nil Basu <rudra.nil.basu.1996@gmail.com>

Details

Committed
rudranilbasuAug 18 2017, 10:18 PM
Parents
R2:0a79ffcc6721: digital_electricity: Fix OK button skipping levels
Branches
Unknown
Tags
Unknown