Wrote the loop to generate rook moves