Funky Chess Board : Wrong Answer

I have included all the possible cases in my code but I am still getting wrong answer.
Please look into the code.

@mananaroramail,
https://ide.codingblocks.com/s/165758 I have attached the correct code here. With your approach the answer depends on the calls in the stack hence the wrong answer.