Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
798 B
1
Indexable
Never
    # upright
    if(x > 11 and x < 15 and y > 5 and y < 9):
        for i in range(6, 21):
            if Matrix[y][i] == n:
                return False

        for i in range(0, 6):
            if Matrix[i][x-3] == n:
                return False
        if Matrix[9][x-6] == n:
            return False
        elif Matrix[10][x-6] == n:
            return False
        elif Matrix[11][x-6] == n:
            return False
        for i in range(12, 15):
            if Matrix[i][x] == n:
                return False
        x0 = (x//3)*3
        y0 = (y//3)*3
        for i in range(0, 3):
            for j in range(0, 3):
                #  print(board[y0+i][x0+j])
                if Matrix[y0+i][x0+j] == n:
                    return False
        return True