def EncodeAImv(chessBoard: list, AI_mv: str, winner: str, is_mate: str) -> str:
    """
    param:
        chessBoard: List-> [List ->[int:x, int: y, int: class], [], ...]
        AI_mv: str: [x_src, y_src, x_dst, y_dst]
        winner: str: 'r' or 'b'
        is_mate: str: 0 or 1 or 2,
                      0: continue，1: end，2: draw

    return:
        AI_mv_info str: #[is_mate, player]#[x_src, y_src, class_src]#[x_dst, y_dst, class_dst]
    """
    if AI_mv == (" " * 12):
        [x_src, y_src, x_dst, y_dst] = [-1, 0, -1, 0]
    else:  # e.g. [6, 2, 6, 4]
        [x_src, y_src, x_dst, y_dst] = map(int, AI_mv[1:-1].split(','))
    c = -1
    for item in chessBoard:
        if item[0] == x_src and item[1] == y_src:
            c = item[2]

    part_1 = '[' + is_mate + ', ' + winner + ']'
    part_2 = str([x_src, y_src, c])
    part_3 = str([x_dst, y_dst, c])
    AI_mv_info = '#' + part_1 + '#' + part_2 + '#' + part_3
    return AI_mv_info