Calculate all possible valid moves for a given board state

uydrhgfkhgfkjgh