The gates in the Great Wall were usually placed near the cities, or where suitable numbers of defenders could be raised. There are dozens of individual gates and thousands of watchtowers.
when the two inputs are shorted, a NAND gate acts like a NOT gate.
hence
AND = NAND + NOT
For OR gate, inverse both the inputs before connecting them to a NAND gate. So three NAND gates...