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

[教程语法错误] #11

Closed
hotmanga opened this issue Sep 14, 2022 · 1 comment
Closed

[教程语法错误] #11

hotmanga opened this issue Sep 14, 2022 · 1 comment

Comments

@hotmanga
Copy link

func int() fun(){
    int a = 0;
    int b = 1;
    int fibonacci(){
        int c = a;
        a = b;
        b = a+c;
        return c;
    }
    return fibonacci;
}

func int() f = fib();

for (int i = 0; i < 10; i++){
    println(f());
}

感觉这里第一行定义疑似应该是 func int() fib() { ... }.

@crossoverJie
Copy link
Owner

多谢提醒,已经修改。
https://github.com/crossoverJie/gscript/blob/main/example/fib.gs
这里的 demo 是可以直接运行的。

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

2 participants