You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: 999. Available Captures for Rook.go
    path of file: ./repos/LeetCode-Go/leetcode/0999.Available-Captures-for-Rook
    
    the code of the file until where you have to start completion: package leetcode

func numRookCaptures(board [][]byte
    
func numRookCaptures(board [][]byte) int {
	num := 0
	for i := 0; i < len(board); i++ {
		for j := 0; j < len(board[i]); j++ {
			if board[i][j] == 'R' {
				num += caputure(board, i-1, j, -1, 0) // Up
				num += caputure(board, i+1, j, 1, 0)  // Down
				num += caputure(board, i, j-1, 0, -1) // Left
				num += caputure(board, i, j+1, 0, 1)  // Right
			}
		}
	}
	return num
}