How to print all possible combinations?

Just by returning false in base case, it is printing all possible combinations but How?
What is the logic behind it?
Link to Code-> https://ide.codingblocks.com/s/585973

in base case you print the ans but return false
that means you are telling that i didn’t get output

hence in recursive case we try for next possible ans

in this way you will get all possible combination if you return false


here in nextQueenRakhPaye we always get false hence try for new position and get other combination