Re: Pattern Matching

Die Testmenge sieht vielversprechend aus, jetzt kommen noch mehr
/*
success
(0, (1, 2))
(1, (a, 6, 6))
(2, (3, 4))
(3, (b, 5, 5))
(4, (c, 5, 5))
(5, (6, 6))
(6, (0, 0))
(7, (0, 0))
*/

//char expr [] = "[a,b]";
/*
success
(0, (1, 2))
(1, (a, 3, 3))
(2, (b, 3, 3))
(3, (0, 0))
(4, (0, 0))

*/
//char expr [] = "[a,[b,c]]";
/*
success
(0, (1, 2))
(1, (a, 6, 6))
(2, (3, 4))
(3, (b, 5, 5))
(4, (c, 5, 5))
(5, (6, 6))
(6, (0, 0))
(7, (0, 0))
*/
//char expr [] = "[[a,b],c]";
/*
success
(0, (1, 5))
(1, (2, 3))
(2, (a, 4, 4))
(3, (b, 4, 4))
(4, (6, 6))
(5, (c, 6, 6))
(6, (0, 0))
(7, (0, 0))
*/
//char expr [] = "[[a,b],[c,d]]";
/*
success
(0, (1, 5))
(1, (2, 3))
(2, (a, 4, 4))
(3, (b, 4, 4))
(4, (9, 9))
(5, (6, 7))
(6, (c, 8, 8))
(7, (d, 8, 8))
(8, (9, 9))
(9, (0, 0))
(10, (0, 0))
*/
//[a,b,c,d]
//char expr [] = "[a,[b,[c,d]]]";
/*
success
(0, (1, 2))
(1, (a, 9, 9))
(2, (3, 4))
(3, (b, 8, 8))
(4, (5, 6))
(5, (c, 7, 7))
(6, (d, 7, 7))
(7, (8, 8))
(8, (9, 9))
(9, (0, 0))
(10, (0, 0))
*/
//char expr [] = "[a,[[b,c],d]]";
/*
success
(0, (1, 2))
(1, (a, 9, 9))
(2, (3, 7))
(3, (4, 5))
(4, (b, 6, 6))
(5, (c, 6, 6))
(6, (8, 8))
(7, (d, 8, 8))
(8, (9, 9))
(9, (0, 0))
(10, (0, 0))

*/
char expr [] = "[[[a,b],c],d]";
/*
success
(0, (1, 8))
(1, (2, 6))
(2, (3, 4))
(3, (a, 5, 5))
(4, (b, 5, 5))
(5, (7, 7))
(6, (c, 7, 7))
(7, (9, 9))
(8, (d, 9, 9))
(9, (0, 0))
(10, (0, 0))
*/