What wrong in this code

Rat chases its cheese

@Adityakumar3112 read problem carefully, as per problem statement rat can go in all 4 directions but your code is only for right and down. update your code for all 4 directions.