What is wrong m algorithm i ask here becouse i give formula in C ?

(x + y % 2) *255

i read this way when x and y are both odd or even code gives 255

but if one is odd and one is even i get 0.

how i must modify this to get it working way what i mean. i try make quick algorithm which gives part of checkerboard using given x and y coordinate. in theory when i get it work i can do bigger broads diving x and y using some number...