truth icon indicating copy to clipboard operation
truth copied to clipboard

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

Open ExpHP opened this issue 4 years ago • 1 comments

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 avatar Nov 13 '21 19:11 ExpHP

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)

ExpHP avatar Nov 13 '21 19:11 ExpHP