This code used here functions same as an XOR logic gate. I am using different projects for each logic gate not in scratch. You can copy this code for your own project. NAND Gate: https://scratch.mit.edu/projects/916201071/ XNOR Gate: https://scratch.mit.edu/projects/916208653/ NOR Gate: https://scratch.mit.edu/projects/916195080/