{"record":{"id":"22f91fedc86af26e","repo":"TheAlgorithms/Python","slug":"each-move-must-have-exactly-two-numbers","errorCode":null,"errorMessage":"Each move must have exactly two numbers.","messagePattern":"Each move must have exactly two numbers\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"matrix/matrix_based_game.py","lineNumber":122,"sourceCode":"\ndef parse_moves(input_str: str) -> list[tuple[int, int]]:\n    \"\"\"\n    >>> parse_moves(\"0 1, 1 1\")\n    [(0, 1), (1, 1)]\n    >>> parse_moves(\"0 1, 1 1, 2\")\n    Traceback (most recent call last):\n        ...\n    ValueError: Each move must have exactly two numbers.\n    >>> parse_moves(\"0 1, 1 1, 2 4 5 6\")\n    Traceback (most recent call last):\n        ...\n    ValueError: Each move must have exactly two numbers.\n    \"\"\"\n    moves = []\n    for pair in input_str.split(\",\"):\n        parts = pair.strip().split()\n        if len(parts) != 2:\n            raise ValueError(\"Each move must have exactly two numbers.\")\n        x, y = map(int, parts)\n        moves.append((x, y))\n    return moves\n\n\ndef find_repeat(\n    matrix_g: list[list[str]], row: int, column: int, size: int\n) -> set[tuple[int, int]]:\n    \"\"\"\n    Finds all connected elements of the same type from a given position.\n\n    >>> find_repeat([['A', 'B', 'A'], ['A', 'B', 'A'], ['A', 'A', 'A']], 0, 0, 3)\n    {(1, 2), (2, 1), (0, 0), (2, 0), (0, 2), (2, 2), (1, 0)}\n    >>> find_repeat([['-', '-', '-'], ['-', '-', '-'], ['-', '-', '-']], 1, 1, 3)\n    set()\n    \"\"\"\n\n    column = size - 1 - column","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/TheAlgorithms/Python/blob/f5988cc09713315817df6a7e327e258013a94440/matrix/matrix_based_game.py#L104-L140","documentation":"Error \"Each move must have exactly two numbers.\" thrown in TheAlgorithms/Python.","triggerScenarios":"Thrown at matrix/matrix_based_game.py:122 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a move containing exactly two numbers (row and column)."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f5988cc09713315817df6a7e327e258013a94440","analyzedAt":"2026-08-14T17:30:07.041Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}