Thanks for this. The reason why you get that number is because you set first for loop to repeat 8 times. That just shouldn't happen. Why? Well, when you have rook in top left position, and he slowly progress down, he will make other rook to move down to and don't allow him to go above. Since they are both same color and it has no sence one of them come again on the top (combinations will repeat). So, as he move down, he will reach row 7 and when he is done with moving there, it has no sense again to go to last row. because again, the other rook just did that combinations, it will be repeat again. First loop should happen 7 times, second one 8 times, third one 8 times and last one is dynamic. it's dynamic because when first loop increase, the field for second rook will decrease slowly. From 7 possible rows to move, to 6, then to 5 etc.