I do not think you should expect this result to be 1 0:
/:'((()))';'(())'
0 1
Consider:
>'((()))';'(())'
((()))
(())
Here, the first character mismatch is in the third column, and '('
comes before ')'
As for aoc day 13, I remember it as being rather annoying.
What I did there, if I recall correctly, was modify each string to be
executable J, generating a boxed representation of the structure, and
then I built a recursive compare verb to implement the comparison
rules. (It might have been possible to normalize nesting depth so that
grade could have been used, or maybe that was a different aoc day that
I'm thinking of...)
I hope this helps,
--
Raul
On Mon, Jan 30, 2023 at 12:41 PM Brian Schott <[email protected]> wrote:
>
> I expect all of the following results to be 1 0 , but the result is 0 1 for
> the parentheses and brackets examples. If I am wrong and the results are as
> they should be, can you suggest a way to produce my desired results? (Btw,
> I am working on AoC day 13.)
>
> /:'((()))';'(())'
> 0 1
> /:'[[[]]]';'[[]]'
> 0 1
> /:'((()))';'(())'
> 0 1
> /:'{{{}}}';'{{}}'
> 0 1
> /:' ';''
> 1 0
> /:'aaaaaa';'aaaa'
> 1 0
>
>
> --
> (B=) <-----my sig
> Brian Schott
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm