Funky chess board

Can you tell me what’s wrong in my code. I am having problem in keeping the count of maximum blocks traversed.Link to my code