# Problem Description
The problem involves creating a scoring system for shots on a 10x10 grid where different regions have different point values. We need to:
- Take a list of shot coordinates as input (x,y positions)
- Calculate the total score based on where these shots land
- Return the sum of points from all shots

# Visual Facts
1. Grid Dimensions:
   - 10x10 grid
   - Coordinates range from (1,1) to (10,10)
   - Uses Cartesian coordinate system

2. Scoring Regions (from inside to outside):
   - Green center: 10 points
   - Gray inner ring: 0 points
   - Pink middle ring: 5 points
   - Gray outer ring: 0 points
   - Blue border region: 1 point

3. Region Coordinates:
   - Green (10 points): (5,6) to (6,5)
   - Inner gray (0 points): (4,7) to (7,4)
   - Pink (5 points): (3,8) to (8,3)
   - Outer gray (0 points): (2,9) to (9,2)
   - Blue (1 point): (1,10) to (10,1)

# Visual Patterns
1. Region Pattern:
   - Regions are concentric, forming a target-like pattern
   - Each region is symmetrical around the center
   - Regions alternate between scoring and non-scoring zones

2. Scoring Logic:
   - Higher scores are awarded closer to the center
   - Score values decrease as you move outward: 10 → 0 → 5 → 0 → 1
   - Non-scoring gray zones separate scoring zones

3. Geometric Properties:
   - Each region forms a square ring
   - Regions grow by one unit on each side when moving outward
   - Center region is 2x2 squares


# Solution
from typing import List, Tuple

def solution(shots: List[Tuple[int, int]]) -> int:
    """
    Calculate the total score based on the shot locations and the areas, with points assigned according to the different colored areas on the grid.

    Args:
    shots: A list of tuples where each tuple contains the x and y coordinates of a shot.

    Returns:
    int: The total score calculated based on the shots in the grid.
    """
    def calculate_score(x: int, y: int) -> int:
        # Central green area (Score 10)
        if 5 <= x <= 6 and 5 <= y <= 6:
            return 10
        # Surrounding orange area (Score 5)
        elif 4 <= x <= 7 and 4 <= y <= 7:
            return 0
        # Surrounding blue area (Score 1)
        elif 3 <= x <= 8 and 3 <= y <= 8:
            return 5
        elif 2 <= x <= 9 and 2 <= y <= 9:
            return 0
        elif 1 <= x <= 10 and 1 <= y <= 10:
            return 1
        else:
            return 0

    # Calculate total score by summing the scores for all shots
    total_score = sum(calculate_score(x, y) for x, y in shots)
    
    return total_score


# Test Script
def test():
    test_cases = [
        ([(1, 1), (3, 3)], 6),
        ([(2, 2), (4, 4)], 0),
        ([(5, 5), (6, 6), (4, 4), (7, 7), (3, 3)], 25),
        ([(7, 8), (3, 2), (5, 5), (6, 6)], 25),
        ([], 0),
        ([(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10)], 32),
        ([(5, 6), (6, 5), (5, 5), (6, 6)], 40),
        ([(5, 4), (6, 7), (3, 8), (8, 3)], 10),
        ([(5, 5), (6, 6), (4, 4), (7, 7), (3, 3)], 25),
        ([(5, 1), (6, 2), (4, 3), (7, 4), (3, 5)], 11)
    ]
    for shots, expected_output in test_cases:
        try:
            output = solution(shots)
        except Exception as e:
            error_message = (
                f"An exception occurred while running the test case:\n"
                f"`shots`: {shots}\n\n"
                f"Exception: '{str(e)}'"
            )
            assert False, error_message

        if output != expected_output:
            error_message = (
                f"The following Test Case failed:\n"
                f"`shots`: {shots}\n\n"
                f"Actual Output: {output}\n"
                f"Expected Output: {expected_output}"
            )
            assert False, error_message

test()