I've had the 3ds version of Terraria for a while now, and I was curious when I started to really dabble in wiring some secret passageways in it. Could there, in fact, be a steam punk NPC in the 3ds version so we can use logic gates? If not, is there a way to use basic wiring logic to form a logic gate for AND, NAND, OR, NOR, or even XNOR?
The Steampunker NPC is available on console and mobile versions of the game, but unfortunately she only sells logic gates on the PC version.
However, you can still do some logic gates manually. They take up a lot of space, but it is possible. It's a bit of a complex topic, however, and it's not really something I'm particularly good at, so I'll leave this video to explain in a little more detail:
Though this video is from the PC version, you should have most of the necessary items to follow along on console/mobile.