Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] 函数 badcase #8

Open
FairyOwO opened this issue Nov 6, 2024 · 0 comments
Open

[bug] 函数 badcase #8

FairyOwO opened this issue Nov 6, 2024 · 0 comments

Comments

@FairyOwO
Copy link

FairyOwO commented Nov 6, 2024

以下代码在测试界面报错

错误: 8:14 keywords: 使用关键字作为变量名 5:10 keywords: 使用关键字作为变量名 2:5 keywords: 使用关键字作为变量名

// 矩阵乘法
func matmul(A, B) {
    result = [];
    i = 0;
    while i < A.len() {
        row = [];
        j = 0;
        while j < B[0].len() {
            sum = 0;
            k = 0;
            while k < A[0].len() {
                sum = sum + A[i][k] * B[k][j];
                k = k + 1;
            }
            row.push(sum);
            j = j + 1;
        }
        result.push(row);
        i = i + 1;
    }
    return result;
}
报错图像

{0866C815-5DC5-46d7-9909-0596C114D8A0}

初步判断为类型问题, func的形参默认类型并非数组(列表), 从而语法检查器发现.len()之后出错

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant