# Problem Description
The problem involves determining the position of a pointer on a circular dial divided into eight indexed positions (1 through 8). The pointer starts at position 1 when time t = 0. The number of moves of the pointer increases by 1 each time

# Visual Facts
1. The circular dial is divided into 8 positions, numbered 1 through 8.
2. The pointer starts at position 1 when t = 0.
3. The pointer rotates counter-clockwise.
4. The number of moves of the pointer increases by 1 each time.
5. The positions are arranged in a clockwise manner:
   - 1 at the top center
   - 2 at the top right
   - 3 at the right center
   - 4 at the bottom right
   - 5 at the bottom center
   - 6 at the bottom left
   - 7 at the left center
   - 8 at the top left

# Visual Patterns
1. The number of moves of the pointer increases by 1 each time.
    - moves = ((1+t)*t/2) % 8
    - position = 9- moves(if move !=0).(e.g., starting from 1, 1 moves to 8; starting from 1, 3 moves to 6.)
2. The positions repeat every 8 steps (since there are 8 positions on the dial).
3. the pointer initially points to position 1 when t=0,


# Solution
def solution(t: int) -> int:
    """
    Returns the number that the pointer indicates at the given time t.

    Parameters:
        t (int): The current time

    Returns:
        int: The number that the pointer indicates
    """
    moves = t * (t + 1) // 2
    position = (9 - moves % 8) % 8
    return 8 if position == 0 else position

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

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

test()