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

Requirements on difficulty switches having same number of cases is a bit unintuitive #53

Open
ExpHP opened this issue Nov 13, 2021 · 1 comment
Labels
enhancement New feature or request question Further information is requested

Comments

@ExpHP
Copy link
Owner

ExpHP commented Nov 13, 2021

Currently the rule is, "all difficulty switches in a statement must have the same number of cases".

However, a block is a statement. That means that:

{"ENH"}: {
    ins_10(1:2:3:4);
    ins_11(1:2:3);
}

runs afoul of this rule even though it looks like separate statements. But it's unclear how to loosen this rule; consider the following example

if (I0 == (0:1:2:3:4)) {

} else if (I0 == (1:2:3)) {

}

Should this be allowed? I am not so certain!!

@ExpHP ExpHP added enhancement New feature or request question Further information is requested labels Nov 13, 2021
@ExpHP ExpHP changed the title Requirements on difficulty switches having same number of cases is a bit strict Requirements on difficulty switches having same number of cases is a bit unintuitive Nov 13, 2021
@ExpHP
Copy link
Owner Author

ExpHP commented Nov 13, 2021

Actually wait a second, I don't think the above is even how I would implement the current rule anyways, because it would be repeatedly checking nested blocks.

I don't think there's a reason why I can't simply cut off recursion at entry into a block.

(This is why I shouldn't make issues on things I haven't even implemented yet... cough)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant