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

Critical errors on the connections between if family statements (if, elif, else) #43

Closed
redocmath opened this issue Dec 19, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@redocmath
Copy link
Member

Needs to check the evident error.

@redocmath redocmath added the ambigious This issue is ambigious. label Dec 19, 2021
@redocmath redocmath self-assigned this Dec 19, 2021
@redocmath redocmath added bug Something isn't working and removed ambigious This issue is ambigious. labels Dec 20, 2021
@redocmath
Copy link
Member Author

Checked error: there are critical errors on the connections between if family statements (if, elif, else)

Example case

  • code
int n = toint(in())

for i in range(1, n+1, 1) {
    out(tostring(i)+": ")
    if (i % 15 == 0) {
        out("fizzbuzz")
    }
    else {
        if (i % 3 == 0) {
            out("fizz")
        } 
        elif (i % 5 == 0) {
            out("buzz")
        }
        else {
            out("none")
        }
    }
    out("\n")
}
  • in
30
  • output
1: none
2: none
3: fizz
4: none
5: buzz
6: fizz
7: none
8: none
9: fizz
10: buzz
11: none
12: fizz
13: none
14: none
15: fizzbuzz
16: none
17: none
18: fizz
19: none
20: buzz
21: fizz
22: none
23: none
24: fizz
25: buzz
26: none
27: fizz
28: none
29: none
30: fizzbuzz
  • reported issue: the flow is strange

@redocmath redocmath changed the title Seems there are some errors to if-family statements Critical errors on the connections between if family statements (if, elif, else) Dec 20, 2021
redocmath added a commit that referenced this issue Dec 20, 2021
@redocmath
Copy link
Member Author

Fixed. 🚀

@redocmath redocmath mentioned this issue Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

1 participant