Here’s a really fascinating circuit that implements a combination lock using relays and logic gates ... The other chips provide XOR, OR, and AND gates respectively. The relays were chosen ...
As an example, let’s consider the AND gate (the others are OR, NOT, NAND, NOR, XOR and XNOR ... done an excellent job of explaining relay-based logic. The image below show his implementation ...