Ternary / switch/ if/then logic
I'd like to output one of 2 input signals based on a boolean condition of a 3rd, like a ternary expression e.g. the following:
return x < y ? x : y
Even better is if there was a good way to handle multiple cases like a switch statement.
-
Calculator gadget + a NOT gate might be able to do the trick
-
Maybe not, give me a little bit and I’ll try and work something out and send it to you in dreams
-
I’ve send you a basic ternary logic chip I’ve created :)
-
For a switch case I’d guess you’d do something similar to the ternary I send you, just with more calculators
-
Thanks @njm1992!
-
For the benefit of anyone else wondering, the key was finding a way to conditionally send some output. The solution (thanks @njm1992) was to send a signal through a node, the conditionally power that node. So basically a node can act as a signal switch. This way any kind of conditional logic will be possible.
Please sign in to leave a comment.