@name Master Gate V1
@inputs LessA LessB SPACER1 GreatA GreatB SPACER2 ADDA ADDB SPACER3 SUBA SUBB SPACER4 EqualA EqualB SPACER5 NotequalA NotequalB Spacer6 MultiA MultiB Spacer7 DivisA DivisB Spacer8 SQUARED Spacer9 CUBED SPACER10 SQRT
@outputs LESSOUTPUT GREATOUTPUT ADDOUTPUT SUBOUTPUT EQUALOUTPUT NOTEQUALOUTPUT MULTIOUTPUT DIVISOUTPUT SQUAREDOUTPUT CUBEDOUTPUT SQUAREROOTOUTPUT
@persist 
@model models/hunter/blocks/cube025x025x025.mdl
#LESS
LESSOUTPUT=0

if(LessA<LessB){LESSOUTPUT=1}
else {LESSOUTPUT=0}

if(LessA==0){LESSOUTPUT=0}

if(LessB==0){LESSOUTPUT=0}
#GREAT
GREATOUTPUT=0

if(GreatA>GreatB){GREATOUTPUT=1}
else {GREATOUTPUT=0}

if(GreatA==0){GREATOUTPUT=0}

if(GreatB==0){GREATOUTPUT=0}
#EQUAL
if(EqualA==EqualB){EQUALOUTPUT=1}
else {EQUALOUTPUT=0}

if(EqualA==0){EQUALOUTPUT=0}
if(EqualB==0){EQUALOUTPUT=0}
#ADD
if(ADDA+ADDB>0){ADDOUTPUT=ADDA+ADDB}
else {ADDOUTPUT=0}
#SUB
if(SUBA-SUBB>0){SUBOUTPUT=SUBA-SUBB}
else {SUBOUTPUT=0}

#NOT EQUAL
if(NotequalA!=NotequalB){NOTEQUALOUTPUT=1}
else {NOTEQUALOUTPUT=0}

if(NotequalA==0){NOTEQUALOUTPUT=0}
if(NotequalB==0){NOTEQUALOUTPUT=0}
#Multiply
if(MultiA*MultiB>0){MULTIOUTPUT=MultiA*MultiB}
else {MULTIOUTPUT=0}   

#Division
if(DivisA/DivisB>0){DIVISOUTPUT=DivisA/DivisB}
else {DIVISOUTPUT=0}

#Exponent 2
if(SQUARED^2>0){SQUAREDOUTPUT=SQUARED^2}

#Exponent 3
if(CUBED^3>0){CUBEDOUTPUT=CUBED^3}

if(sqrt(SQRT)>0){SQUAREROOTOUTPUT=sqrt(SQRT)}
else{SQUAREROOTOUTPUT=0}

