from typing import Dict
import string


def assign_coordinates(starting_position: tuple, spacing: int) -> Dict:
    """ Assigns coordinates to the points 

        Args:
            starting_position (tuple): Coordinates of point A1
            spacing (int): Spacing per step on x columns and y rows

        Returns:
            grid_coordinates (Dict): Dictionary of point names and coordinates

    """

    grid_coordinates = {}

    for letter in string.ascii_uppercase:
        y = int(starting_position[1]) - ((string.ascii_uppercase.index(letter))
                * spacing)

        if letter == "I":
            break

        for i in range(1, 13):
            x = int(starting_position[0]) + ((i - 1) * spacing)
            point_name = letter + str(i) 
            grid_coordinates[point_name] = (x,y)
            
    # print(grid_coordinates)
    return grid_coordinates