The code I'm using is (in pseudocode):
v = intersectionPoint(ray,object) / scalar
flooredSum = (floor(v.x) + floor(v.y) + floor(v.z))
if( flooredSum % 2 )
And to prove it's ugliness:
EDIT: found two bugs. I wasn't using the ambient light factor in the material correctly and I was using my own shiness coefficient instead of the teachers. That's fixed and the pic above has been replaced with a newly rendered one.