From b2476b2c9d4ade565b658919cb0163745235be1c Mon Sep 17 00:00:00 2001 From: Zack Buhman Date: Fri, 20 Dec 2024 03:00:05 -0600 Subject: [PATCH] 2024 day19 (incomplete) --- 2024/day19/input.txt | 402 +++ 2024/day19/input.txt.h | 15 + 2024/day19/radix.c | 7398 ++++++++++++++++++++++++++++++++++++++ 2024/day19/radix.py | 59 + 2024/day19/sample1.txt | 10 + 2024/day19/sample1.txt.h | 15 + 2024/day19/solution.c | 67 + input_dreamcast.inc | 10 + runner.c | 2 +- runner.inc | 7 + solutions.mk | 5 +- 11 files changed, 7988 insertions(+), 2 deletions(-) create mode 100644 2024/day19/input.txt create mode 100644 2024/day19/input.txt.h create mode 100644 2024/day19/radix.c create mode 100644 2024/day19/radix.py create mode 100644 2024/day19/sample1.txt create mode 100644 2024/day19/sample1.txt.h create mode 100644 2024/day19/solution.c diff --git a/2024/day19/input.txt b/2024/day19/input.txt new file mode 100644 index 0000000..2534533 --- /dev/null +++ b/2024/day19/input.txt @@ -0,0 +1,402 @@ +wurw, uww, wubbwb, rbwu, bruw, grw, gbub, ugwbbrwg, ggur, uuguw, bbrug, wgrwrr, rwwrrgu, bwrg, bbg, rbrbuu, rbwwg, ubbwb, g, rrbwgb, guubbw, rgwr, rwrwgb, bgg, guwr, grrw, wubugb, bug, rrbwg, bbgru, gwrw, rgrbwg, buuwub, rguur, rwrbgb, ruwrwrb, bgr, rbrwbu, wwg, bww, rgwrw, wrrgr, wur, burb, bur, uw, wgr, gwr, ugugb, brrwwwwu, uuubgg, rbu, ubw, bwu, bgwbubu, wbr, wguu, rgwbrbu, gwbbruur, wu, uurbww, wbbg, wuuwr, ggggurr, uubr, ggb, uub, uuubr, guuw, bgrwr, rrrw, gu, guwb, wbw, rwwwuug, bwr, rruuu, uubbww, gbw, wbrbur, gwgr, bw, ggw, bwgug, bruwu, bb, gwwur, uwbgwb, wwguu, rr, rggw, wwru, rrwbwgru, wrbwr, uurgu, urg, rgwrb, wuwb, brugruu, uuugr, gwugu, rgwb, urugbgu, wwwr, bru, uwwgb, gw, gruu, gbuuwrb, urwr, rug, ruuruu, wrg, w, rbw, gwg, rrwbwbrr, wbwb, grg, rub, brbubr, uwuugb, rwrg, uuubgr, wwu, wgu, rwrb, rbwuw, gub, guw, rrg, urruwbu, bbrwgur, grggbu, bg, gurrwub, ugr, wrrgg, guguugb, rubb, urgr, ugu, bbbwb, bgwgbb, rwu, wg, uggbbgrw, uwu, rru, rwrrgugr, bbgwu, bgwu, ggbrg, gbr, guu, wgwr, bgwwgbb, gbur, uwuurwbb, wgwbr, rbb, rrugbbur, rrbwggb, gww, uubuu, wuuubub, wgug, uuu, grrr, ugwrr, urbugg, uugwg, rurrubru, brwbbwg, gg, urw, rwwrru, rwgr, uwwb, gbgww, burrgb, rrubwrg, gwu, rrbgrr, brug, wbrrr, rgubbwu, wggw, uuub, ggrrub, bubg, ubr, ugwuwwr, brbu, bbururr, rwwu, gwuw, rwbr, ggbb, wwrgrb, ub, gr, rgr, uwr, bbbgwr, gwug, rrgwbgb, bu, wgbwugg, uwg, gbbw, ubu, ubgu, uruwgg, buw, guggwr, gruwr, ugbww, ggg, ugbwug, wwr, ugwrrw, grr, rgu, wrgwbru, rrrub, grwu, ruw, wwbrw, gugg, ggbr, rrbwbbgu, bburuuwg, wrgwrwgr, bbgu, rgg, grguug, wgggr, ggrrug, bubggbb, rggwbbb, rugbww, rrbbg, wwubb, wrug, wbb, wrb, ggrr, wbwrugu, bbb, gubbbrug, rgrg, ggr, uubbwwb, bwrwgbw, ruwr, wuw, br, wbrrwu, bwugu, buwb, wbu, uuw, uwwgrg, uuuu, uugb, bgur, bgrwg, rgb, ug, rrwbb, wbrbgb, grb, gbb, gb, ruur, wbrru, grgg, ruubg, brgru, bgrwgb, urwgrg, wgg, urruu, bwbru, uwbgu, wug, bbwr, ggggw, ubrgw, wrgr, wrurrrg, bwb, rrb, wr, bwwub, gwrwuwu, gbbgw, rrug, rwugb, wwbu, urb, ur, bbw, rrw, gbu, brb, ggu, rwg, uwuu, wrugg, uurrr, rgw, wugwbw, bgw, rur, brrg, buu, rrbw, uuuwr, ugb, uu, urwbug, bub, uwrwr, wwubrw, ugwwrb, bwru, uwrg, wgw, uuwwrb, grwrb, u, wrr, uur, buurbgb, ugw, gur, wgb, buub, bbgrbrbr, ubbb, ggww, bwbw, rwr, wbbbgu, wru, rb, ugg, brr, uwubwgr, rubub, brrbwwu, urbgg, ugwg, bggw, bbrgwb, brw, rrgug, wbrwb, wwbugwbb, wrgwuuur, uurwrb, wbg, grbr, bbr, ggugb, wbrrw, ugbuu, ruurwr, gggbg, wb, bwur, grwurb, uwbr, ruu, urbugb, gbbr, guruwg, rgwg, bgu, wgrbru, grbw, ru, www, ruwurw, brggw, gug, rrr, bbgwruu, ruurubgb, uug, wgggrw, bguuwuu, rrwgu, ubg, bwug, ruru, urbwrrb, rbwuugg, grwbrr, rbg, brg, wub, ubbr, uurggr, wgrgbr, ruugw, wuubb, bugubu, gbrb, rgrb, rbub, wugr, wwb, bugr, bwg, uugbrwu, uru, rg, ubb, gbwgwrg, gwb, wuru, bwwu, uwggr, buur, rwb, uuru, wugwbbru, bgb, gbbur, rgbgw, b, ggbw, uggr, wrw, gru, grgwgurb, gwbb, bwuur, guur, wwwbg, rbr, wbbwb, uwb, gurwu + +gggurgwrgguuugbwrburwbuurwwbrrurbuurubuuurr +rwwrgwguwrbgguurruwwgbbbrrbuuwrgwwwrwgrrguwrbguurgwgr +rwwrrbburgrbgguwrwgrrbgugwrruguwubbrrwwwwugggburuwgugggbg +bwguurbrrbbrrrwbwgrwgggrwwuubwbrrgwrwurbgbwwbrrbwbwg +wrwwbwgubbgwrggrrgubwuwuubrugubggrrrbwwubgrwrbgw +urggwrrbuwbrgwwgrgubbugggwgbbgggwruugugbubgugrruu +rwwgbbrbrwubrgbgrbbbbgrggurgggwwwrrrguwbwwrrugugww +rwwbbrgggrgwugwrrwruubggbgrbwruuwwwguwwwwggwg +wrgugggrwwbwgbwggwbwgbuwubgwgwrrrgwuwuwggu +ruugrubbwwurguurrurgwgbgbgugbbrgbrwbruuuuggwgbrggwgrubruu +urwrrgrubuwbrgbugggbrurgwgbugrrbwgggwrbgbw +rwwrgwgwbuwbbbubbwgwbggwggwrgubbwubwwbgrwuwrgbug +gwgwubggburrgurrbrgrwrwbwwrurrbggugbgugrrbgrbu +brwbbugbrbuwurrruwrgbgrbubwbgwbrwgbbwgbrruwbbggburguwg +bwgwwrububbrwbuugbbbbuggbgrwwuwgwbbwggrwburruwgrrwbww +bguwrgrugggwugbrbrrbwbbruuwugugrgwgrgwuugg +wbugwubguwbwbbbguwburwrwwrwwrwwbwuurugggwbrbwgwrgwurugbgg +uwgrggrruwwbrrwrbugugruwggwwwgwuwwwrbwugbbgbuubb +urgurrggrbgubrbrbbgrbbgbrruwuwbgbbwbwubbuurbgbrug +rwggurruuwrbubrubugrgrbwrrggbwwwgrbwbrgbururrubrugbgbruwbw +gwbwrrruuurrubbguuuurwuuubgrrrrgrgruguugur +rwwbgbbwuuwbrgbruwwgbbggrruwugbrwuwruggwuwggwur +rwwrwrurrwwwbwubgwgbrrurwgwugwuugwwurrubr +rwwrbrrwbwuwrurwbggbuggwbgrrgrrbrbuwbgbbbgwwbgruuwrbuggr +rggrrbgggubgwuwbrrrwgururrbbgbrbgwbrggwbrguu +rrgggrrwuguruuuwgbwwrugrgbbbrgubrgbgwgrwwrbruuurgrugwugg +rbuubgwrrwrgwwggwgbrgrrbwwbuubwrbgbggwrbggrbwwg +rburubbguugbgrugrbbruwbwgurwurbbgbrwbrurrgwbgwbwbuwrrbwuu +rrbwbbguwubruuruuruggruruubbgwrbgrbgrgruugbu +rwwwwgrrgrbggrubwwbrburwbgguwwguggrbbgbbgbbrgw +rwwrwububguwgbugwgugbrubgbbrurgrruuuwburuggbuuurbgwrruubgbru +rwwgrwuwrwbbgrruuburwgrurgrgrwruuwwubruruwugbbrg +rwwbbggbbrugbgruguwuuuuubwbrggbgwgruwbbugburwwwrbugbrgguggur +rwwwbgwrwuruwwrgbugrrbwwwubrbrbgubbugbbrrbwurwubb +rgwgwbgurwruuuugbruuwubrugwgugwwruggbwbgbuwurwggwuwbgrburr +wbugrgwgrbrrwruwugwwrburburwrwubrrwgrwwuuurru +rwwbggbbuguguwggurgurbbbwwuwguuugurbgrbgr +wuuwggrwbuurrruuuwbrbbgwrrubwrwurugwbbbggbgw +rwwbbuwbugubbwbrbgbuuuggrgugggwubuguwuggbbuwgubugwrbguwubugb +rwwgrwbgurbrrguugbubgruwguwugwwwuwurwrwuwwbu +bbwwbrrruwrgugruuwurrubbgrwwgbruwbggwrwuubbbugubgrubgbwgug +bbgurrrgwbuuuwwubwuwuwgguggwbrguuwgwrggwubrwuruuubbrwuugu +ugubbbubbgrruwgguggbbgwggrurbwwwwugrbrggwbbbruwbbgrbuwwug +bwbwgrrwbwbbgwrubrrgbrwwwwbwrbrburrbwggubbbwwubbrurubrgu +bwrwbwgrbbuguwrwrwwwgbrwwwbruwugbwgrgrubwgwgruburwbubr +rwwrgruburrwwwggruwrbuggubgrugbwrrgwuubbbrbb +ubgurbwbuubrrgbwbbbwbrurgwwrrubuggugguururu +rgwbrrbbuubggbrwwgrbwbrrbruwuuggrgbggwrbbuuwbwrwrgwrg +rwwwrrruuurwguwbwwugwgggwrurwguuwbrbrbggr +wwuuubuwwggwgwbugbbwrugwurwwwbrbuubbgurwwguubwwurgw +wguwbrgubrwuwbwugbwbburgggrwgrbwwgbwbugbuubgw +gbrgrgrbbbwbbrrbbrubgugwwbugwbbubrurwwgrgwbwbbbwrwuwubb +rwwgrrurbuuwuwgwgrrgrgwbbgwrugbgbwbbbgbrrgrbgrubwrwrrwuwwgbg +ubbrbbbwububrburruguwrbgwwuwwrgrbubuuuubwgwwwgrw +urgbgbwgbgbgwgubuubburrgwwwrwgrbgwwbubuwggrbwurrr +rwwwuwurrwbrgwgruurugbggrbuguwgubguuwbbgw +bbwbrgwwgbwuuuwuurrbururrrgrrwggwbgwwbuuwbgrwbbggrrgrwrw +rwwbgurrgubgbwrguwwrwrurwggwgbubwbrwuurugwbwrwwubruwbbw +bgrwrwbbwrrwuugbwrwwbuwwbbbwrgwuwuugrrurubugwggggrb +rwwrrbbwwgrurbgrgwgwwgwrgbuwbrgrbgrgguubgrrwggbu +rwwwbrbgurgwuwbbbgwuwwugbrwbwuugrgbgwruugbwrrgugrwurururruu +rwwggwwbuuururwruuuguwwububbbwgugbrrbrugwubrr +wruubgwgwbruwwwbwuwwubuuwwwwgbrrrwgbrwwgrrwuwg +gwuuruwbwbbubugbwrwwurbwuurrggrwguuwggwguguubrrurbwrgwbr +bwguwwuurguwwggwrbrgubguburrgrwwuwugugrwrruggr +wguruugwuubwrwurrrbrrrwgwbwrrrurwgurgbbuguubwggwbr +bgbbugguubgbrubgwuuugrggbrbruggrbbuugubgrwwgrru +rwwbuwrbgbbruugwuuurubgbbgubbwrgguuwgrwwugbbwbggrwubwugb +rgggrbbbrwwgwwuwguwbubbgggwgbgurrbubrbuugbrb +rwwrbrwuububrbubbbbuurwubgwrbrwubwuggwbrugwbggugwrugbwwwb +gruuwwgggbwwbbgbwwuwwrggbuguubwbuwgrgbgwguwrwuwwgw +urrgrbrgggbrwgwurwwrbwgbuubguugbuwwwgrruurrwgbuwbuwbbuubug +rwwgbbugbuurrwguuuggwwrwuwwrrruubwuuwgww +ugrbggurgrbguugwbbrgrbbrgwrgubrggbwgrbbwugbwgubgburg +rwwwwwgwgbggrwbbwbrrbwwruurubgbrgwbgbubugbwuuw +bugbgrwrwgwubwbgwrruwuruuggwbwrgrrgbruugbr +wbruwwrbrgrgwgurbgrugrbgwbwgrrgggwbgwwwwgrrbru +wgbbwgwuuugbubbuugbrrbuwbugbwuggburrbgbbrugwubuguubwgrw +rwwgbguubgguururuuuburbbwrwgrrrwrrbbwwwrubbuuuwwwuuww +rwrrwwwgrrurbrburwugrwuwuwgugurwrgwrwgrgrbww +ubggbbgwuuugwwrbwwbbbrbuwuwurwgwrrgwgbbwuwugr +buggugwggrugwguwguugrrrwruggwgbwwuugwrgrbgrbbbgbbrg +wwwwuwurbguuwrrwbwgurrrrgbgwrggwgwwbbbwrrrg +rwwbgurbrgggburguubbggwubwuwbrwbbgubrrguuuwbwubwurggr +burgwwbrrbrrwubbuwurrbububrwbuuubruwwugbbgg +rwwwwwwwrggrbbggbgguurbgwrwgwguurburwwbbgbgg +rwwrgguubrrwubbwubuwgururuurguggrwggbubwwrgurgwrugwr +rwwgwbwbburrwbwbrrbbbgrwggwrwubgbwuwbbuwbbu +grwuwrggwruuuuwggbwwbwgrrbwbuwrururrwgrwbburwwuu +urgruwbbgbrbgbuuubbwwuguwubugwrrrurbgugbwbuwbugrururur +rwwruggurrrrbwgbuuurgwuubrggbwgrgwwuwgugbbrwrwgrgrr +rwwbgwgwggruwwgrwrwggguwgbwbugwgwgwubgggrrggrggugruuurggww +rgurwrgbgrwgubrburuwwgrbgrbwwbwgbwwwwugrgbubwrubuwugb +rrwrwrrugbwwwbgbrrwbgrbgwuwwbrwgbuwburwggbwggwbbgww +rwwrwuwrgurwwgwbbrbbgguwbbrguwrrruwugugb +rwwrrwgugbwrrggggwrwbuwgrgbbuuubuugbuuubw +rwggbbuubuubgrgwrggwugwwruwugbwuugguuwurrgwr +rwwwbbbguuguruwgguugbwrrwrgwwuggwuuuuwubrruuwuuuwuruw +wgrubggbburgruwwguuggrbwbgwwwwwgwwuurbrbugrwrrgrbwwg +rwwrbrrrgwrbubuuwrbububuwrrruwuwrurwwrggubrwggrruwuwbr +gbgwgrbguwwbuuuwrurgwrgwubgwwurwbbwgrubggrgrwubrrgg +rwwbbwwggrbgggbrbgwrrwbggggwgwwuurbgwbbruuru +rwwrgwbrrwwwgwrbgrbbwgbwubwuuwbgubguggwrwww +ubgwubuwwbbgwuubwgwwruggubwugburggrbgbggrgrrg +rwwrbbububwgwruwwbbguurugwuugbgwrbbugwwwuwwgr +wgbuurgurwrrbbruruggwgurgwuuugggrbgbuuuuwgbwggwrbgubburb +guubbrgrrbgrbggbwrbgrwbbrwwrwwbgrbbbwwbbuwuw +rbrwrguwwgwwgubgbgwugubgwuwgrbwrbrguwbbrruggubbbubggrbrr +rwwbugwwrbruuwwubwwruwbrgwwbrbbrgrbwbuuwuubwrwwbbu +rbgwrwubwbrbrgurgwgwrbbburbwbugubgwbbruurgwbw +rwwbuwuwrbgwgwuwwggwrurbbbbrguwwbuugwuguuburugbguwrw +bbrggwwrwbgwrrrwrggbgurbrbrurggrgubbbrgbrgubuuwbrguwg +brrrgwwbgwbgrbburbbgbubrrbuuwrrrguugrggruuubuww +rwwbbgrrgrbwbuburrgbwbwwbuugbbbrubrwbwwuwrurgugrwuubbuu +rwwguwuguwwbrrbubrbgbgubbrugwubguuwrwbwbgb +rwwbuugwgbbwuuwgbggurubwrbubwgbrwurbrrrrw +bggbrubrruwwwwgrwrrubgbugrgwburbwuguwgwgbrrwrgguggbbubg +rwwbrbugwwbbgbwgrbbrwwgbrrugwrwbwwgbwbwgr +bgrwrrrugrgurrubrrrgrrbwbwrgguwbbbwbgbrbuwbw +rwwbwggubgwrrwwuubwwrwrruwbbbwuugbgrbrbwrbugru +rbubgurggrubrurbuwbuuwwbrrbbruuuwwbrgwgrrbbgrrwbbwbwggu +rbrurbugbbguwwgwgwwbgrgrbrgrgbgbwuuugubgbbgggbruw +ggbbrbbrwwrbbrwgurbrbgrbbggrgwuwgrgbbuubwwgggwrrggrr +rwwbbwgwuwgrwrwguuwrrwbwgrubrgwbgwwbggur +bguruggbrwwguuubgwgwrwbrwuggruggrrgrwbgbugg +rwwrgbwggguguggrbwggruuuubggwgbuugrwgbruwwurwuwgggbburr +wggwrwrrgugrwrbwwugwbugbgrrwbwgwuuwbgguwbwruwwbwr +ruburwrububwwwrugwuwggwrgggrrgbrbgrbrwwgbbb +rwwbgrguwbbgwgugruugwwbgrgugwgrugwbgguuwggwuurbbbbggwrrrrbr +wrgbwrwwurrbggrwururggbgrrrurbrggwbrgguggbuuwwugrurwgrbug +urburgwrurwwgrbbuubbuurbbbwwgubrgggbbgbwruuwggrubbrg +rwwwuwuwurugurgggbggwuubruuwwgbgwbwrbbbuu +rugwbgbugguurwrbwuwrbwwrrwubrwbbwwururrwbwrwwwgwugggrwuww +rwwgbuugbbwwuuwrrbbwuwggwgrwrrbgwurgguuwgwuggwrug +rwwrbwbbwruugwbwuguurrugbubgwuwbwubwbgggwbrurugwubgurwubrrr +wrrburbggrbuwbwgrbubrrwuwwbugurbbruwrugrgwgbgrwubwwuw +ugggwbuubgrbbgugrwbbgbwwgwgrubbrrrwgurbwwr +brwgwggbbgwgrrrugwubugubugrugggbubbrbruwrrbbrgwubwguuw +rbrrggwwrrrgrurrbggbbubwrbwwbwbwwbrggwwwgbuwwwurbgbuuuubgr +rwwrbgbwurbbwwwuwwrubuwbgbgbbwugwbrbwwbrrgwwwbrgurrrw +gwrburubgrbbgrrbgrrbwwgbgggrgrbwbuwuguuugugubgu +gwburrugbbrurggwbbrrbguwwgbwurrbbgrwwbrwuru +rwwrggruurrugruugrbrbuwwrwwbbubbbguuwgrwu +uruurubgbgbgbbubbubgbguuguwguugwuugbwbwrwugubrwrgwugbgwubw +rwwwbgwgrbrbggbgwrwubwuuuuwbruwuggbbgrwgbubwb +rbgurrbwwruubgbbwrwwubrrgrbbrrgbwwwrugwwbruburrurrgbrrwbrg +gggubbwbbugwbrurbrguwgubbwubuuuguwwwbwgwgurwrurrwugrbbugrr +bgwrbuwgbuuwbrbuwwbrggugrbrubwuurbrbggwbwwwwrwbugbrur +guurgrgrwwbrbgbbburbubruugbrgugubrwguguuugbugwwwgwrwbw +wrbbgrgwrbubrwbubgwurbwbuwrruubbrwbrrgrwbwrburgrwbr +rwwgbgbwgbruwbwbbgbbuggwurubwwwubgrugrugwgr +rwgrwgrrggubbubggwgwwgubgwuwugwggwgurwwwbuwuuruwuwbgu +rwwruwuwuwrgrrgrrrgwbwbggrrbubrbwwgrbbru +wgrbgbwbbrwugwuuwwrrgrbuuuwbgbwgrgwbrrwbrrwugbwrbuwrwrgggg +rwwwugwgwgwwwgrrubwrggwbwuggrwburwguuwuwwwubgbrwubgb +gguwwurwwuwwgrubgwrbbubrbugruggugwgbrbrbrwwbgw +bbwgbrbgrgwwwugwbbrubrruwrgrruwuubuwbwrugrbuwgrubrruuugu +gwwbwruuubrugwuuurbwwbgrbrbuwwururggrwgwgwggbb +grwwbgwurbrwgwuwbguugurbrbwruuwbugguwggbrrrurrrwuug +rwwrbguububrgrwuuwgwwuggrbgurwwgbwgbuugbbggugwwuuurrugwuuwru +rgrwurubgwgwbugrwbguububuwbuuubwuburrrgubgggwbw +gbgwwrgwrwgrbugbugbrgbubwrgrrbgwwgurbgugbgwgubrbrr +rwwwwubbbrruuwrgugrwburrrwgwrguuwbwgrugwurburguugwwwww +rwwbwrurubgrrrruubbugruwwwbubuwbrbgbrbuuubguwb +rwwbwuuwurwuwrbgbubwrwbgwwgbrbrrwwrbrruburugwwrwuruwuru +buwggbwgwugubuwruuurgubbbbbubrgbbrggubgrbgurubbuub +rwwbwwruuwgruburbbbubggrbubgrrwwbrrwbrguwwbwgburwrr +grrgruurrwbwrbbgburwrbugrwwrbwgrurruwgguguwwgbgurgg +gbbubugrwrbuwubbugwruuwgbbgubggbwurgwggrrg +rwwbbruubrbgubwurwrbrgurwugbrrgururwgrggubb +rwwgrrrrwrgwrwubgbrgggbbwuugbgwruwbuwgrguubgwwugbururbgrbgwu +rwwbbuwrwbgwwwrwwgwuugrgwgurbruwrgrrbuwubwg +bgwguwggruwbwbwbruwrrbugggbbruurrgbburuuwgurbrbggugrbg +gggurrbbgrbwwwbbuwwburburgrbrwurbwwuwrrbwgbr +guubbguwbggbuuwbwugwruubwbbgbrwbwbbwbrbbrurgbwwbburu +urggguuwrrbruuwrbbgbwrubbwwuuwrwburubugwwb +wrwbwuwuwggrurrrugbuwugubrbwburbbbwrbbburbgwwgurg +rwwbrrgrrrguwgwuugurugrurgwgrgggubwgrbgugwgrgbwwgggbbbbgugw +bwrwuurgwgwuubbggurwwgwwbwwwuguwuugwrbrruw +gubbwbwgwgugrgrrggwbrbbwrgurgbrwwrbugwbruuu +gurbuurruwgrrbrwrbbbwruubgwgggububurubwurbu +rwwwbrgrbrrbrwbgwugbguuwgwuubrugwwrggrgrub +rwwwwbrrrwbguurrrwbrggwrwbbggbururrururbwbbgbrug +ubrbwgrrbrgbgbuuburrwwbrbburuwurgwrrwruwuubwwbrwwbbwbwr +rwwgbuwwgwrruwuuubwruubggguugrggwbbwwwgbrrbwgrwgbbub +rwwgugwrurgbrrwbruuuuuubuuwuugwuguwgwrrgwwggu +bgwubugwbrggwgbwwwbuwrgwbrgwbbwwwuwrwugbugugbbrgu +bwuuwgrrubgrbuuwwwrrrrwuwwggwbrbwwgwguugrwrwwgub +gbwggbgbwbwruuurgwbbrruuwbbbbwuruwggubrbrrubruuurwbwbbg +rwwrgwrurrrugrrwbbrwgbbgbggrwrbubwrwrgguw +rwwguuwwgwgrgubbwubrurruuububwbrbwwggwggwwuruwbwbrwgrrur +bbrgbrbrgrbbuuwwwbbrgwwrbuwwubrwururgbubrrwwuubugbu +urbubwgurubbuurbgugwwbwwugwbwwbwbrrrguuwguwwugbbrggwwgur +uurgrugbuwwbbwwwrubuwrbgruwuuwubrruwwwbrrbugwugrrgu +wgrguugbggrgbrgbuuuuwrwrgbbuggruruwuuwgbruruuwbwuw +rwwbggwbrruwuwgwrbbgbrbrrrburrgwggrugwrbrbgrwwuuwuwubububg +rwwbggrggguwgbbuurubgrbrrbbwgubrgwguuubwbg +rrgbwgrbbrbuwubgbwbwgurggwgrwgrbbugbrbwugbggg +brwgbgbwrugbwrgbwgbwggrwrwgurbbwrwwwrwgwuuwbgwbgw +rwwbwrburbrrwwrubwbwrwgrwwurgurbbgrubbubrggwggbwwgwbgwgr +wrwrwwrbrrbbbburggrgwwuwrrbbuwubgbrurggburbuwrgbubrrgbubw +gwwbbbbrrbbuwurubugbggbwbrgwwugbrbrgrguwwgbub +rwwbrugwbubbgburbrwgrruwggwwgrbubwgrggbbgbrguuurrruwgr +rwwwrrgbwruwrwwuwbrgrbgruwbuwguugubgwggrubwrwubugg +rgrbgguubgwurugwurubbwguubbrwwurubbubuwbrbwrrur +rwwburuuubrgugrubwgbwuuruuuwgwgrrurrbrrrbubrg +rwwwburwuuugrgrrrrwugwwbwgbbwgbrrububuurwbbbgbrguugwrgguuug +rwwruuugugwwugbwwwgrwuwwggrwrbbubrwbbgrbrgwru +rwwrgrrgubbbrugbwguwuwuwwwrwguugwwbruwwwurwbrgrbrgg +rurrgrrurrubbwrrrrrwbgrrrburrubgubwwwuwgguwr +rwwrubwbrrbbrwbugruuguwrwgubbuuurggwbrwbruwwubrwwrwbuwr +rwwrbrrugbburwwggrgrrbbgubggwwburwwgbwrbbgr +rwwbbuuguruwuuwggbgbbgwbgrwwgrgbwbwbuwwrrrr +rwwrrwrurwrrurbubgbwrrgwruubugrggbubrwgwuug +rwwrwwururrbwrrbgrwwbgruwwbrburggwbguruwrwbgwgrg +grbrrbguwrrugwgrgrrrbbubruuuubbgbgugbbrbgwuurrurbbwgrub +rwwwbrruuurruubbwrrwgubbrwwrbwwburwgrbwbwwgbgubgw +ubwwwguwbrgurbruuuuuugbguugrwrrubgwwgwwbubrbww +bwrgwwubrggwrbbbgwrrruurbwwruwugurgwgrgugwwg +rrgburguugguuugbrgrbwurbgwububwwrrurugbgururgwubbrggrrb +rwwgwrrrgbguugbwwruwrggrbwrwwbrubbgwggrgwbwbbgrr +rwwgwbbrwbguguuwurwgwgbbruwrwugrgrgwuwwgbbgbbuwbub +rbrruurwwbgrbrrbrggbbrugbwbgrrgrrgwbruwwwgggurrubu +rwwgrbbwgruuwggruguwbbbrrwggwubgwgbgwrgwgrgurggbrgbuww +rwwruuwgrrurguuwgrbburuuwgwwburgbbuwwggggrbrbgrwwrgwu +urggwugwgggggrubgrwgrrggurrwwbwugurbruggrbrubgrgggwru +uuurbbuburubbgugburugrwgbgwubgugbubbggrwgbrrugbbgr +rwwrwrbwwrbwuburburrubgbbguwrrgrgwbugrrugbgburug +rwwbbuwwugggbrbuwwuggrbbruwurwwwbuwrrrbrgrwwrbgwubbwugg +rwwbggwggugbgrgbrwwuruuugbuugbubggrggwrugggggrwrwr +urwbbbubrbggwbubugwgrrubrrgbwuwuwbuggwuuwrrr +bwwwbrbrwgrwrrwwwuguurgwwuggbugwubbwrrgbbbb +rwwrgrwbrwgrguuwgbbwugurwgrrwrrrbbuuwurubuwgrggbuggwrruu +rwwgwbuwwbwrrrruwugwguwbwrrugwugrugwrwbrwwwgu +uuwwugwgbgguwbruuugrggwwwgbgwgwugwbwbwwbrgbugu +rwwgubrbwgrwwburwbugwubbuggruwbubgggbguuubwbuw +rwwwrrbgggbgbubrwrgrurubburuwguubwbrbbgwgugbuburuurwgwurbu +rrwruwuurwbbuwgwwugbrbbwugurrbrbrwbgrgwwwuurrw +bgrggrbbbwwbrwwrbwuruubbrrbbruugbuuubgugwbbww +uwrwwgrrggwbburgwwgbbgwugrrbuuurugugwrrrbwuwrgugbbgwguwg +rwwrbwubrrwwbbwuuwugwbbrwgurrbwugrwurwrbrbrrgbbb +uwburrrwwbwgwwurgrgwubrgwgbwwbrgwbrrbwrggwrgbbrwbru +wrrwbruurwwwgrgubgwgwgwuuubgrbrrggbburgbgwwuurwbbgbrgrggr +rwwbuuurwrrwguguurgbuuwwwwbguugruguwrugguwwwwug +gguwuggwbgrbrubbgrgbbwbggrrggrggwuwrggggrwwruub +rwwgbbuwbgwrrrbgwrwwubrrrwggbrubgrgbuuguwbgrrgggbugbbwbbgrgg +urbwbbrrggbgubwwwrrubwuguwbuurwbrgbgwrwrgrwubrburwgg +gbggbrbguwgbrbwurwuwrgrggrbrubggwruwbwbbgrwbwbgwububbuuu +bwuggwgbgubwwubrbbgwrwuugrruggbbwrrrgrgrbuuruwrbrgwbbrr +gwwugubrgurgguwbgbwrrrugurbubguwrrgrbrrwwwwugbgur +bruuguwrwrgburwrbwrbgburgubbgrgwuuggbrbuwgugbuuwwb +rwwwggwbwrbbgguwubrrbrgrwrubwuggubgruugg +wurgbgrrbubbbrgbbbwguuwuubgguwuwbrgwwgrurwwrbb +rgubwwbgrrrrubbrwgrwbuuuurubrwwuwgburbbruubuuuugr +rwwgwbbbwuggrbggubrgurggbgbgubggwwwbrurb +rwwgbbuwgrbwggrrbggwrgbwbuwuwuurwbbwrbwwrruwgrrbuwgrwrbuu +rwwggrwuuurgbwwbgwgrggwwbrrgwwgwwrwurwrrwwruuw +rwwbgbbwuuwwrguurwbrbuwgurruguwwrrburuurgurwu +rwwwuwgubwgbrbguuurrrgruruggwugububwwgbbuwuwgwgbrrbb +rrrbgwgwruuuubgubggwbrurugrrwugugbwwbbbrrrrurgrwbubwuwr +uubwbggwbrguwbgrgrrbwbuuwrwbrbgrrwrwburbrrwbbruruwburbr +rgurbbrrgwwuuurbwgwbgruruwbbwwgbbgrugwbrubuwrg +rruggrwrgbrgbgwbubuwbrguubuububgbrwwguwwwbbbbrggwrbrburggw +rwwwbruwbuwbrrrurwbbwgrrbggwbwrwrggwgburugbggggrrbbgrurwrwgg +rwwgrwrbbrruwuwrbbbbbgubuwwruwugwrgwwrwguwbwwwggg +rwwwwbggurgggrrbrgwbbbrrubgugrggbrgbuugrruuggbubgwrur +gubburrgwgrbgwrggruwrrwrbuwbruuubuurgwgrgggbwwrgg +rwwgbururububurruwbbwgbbwbbrrrburwubbrggrbbubgwbbrbrbw +ugbwgurrrwgbbbgruwgrwrbubuugbbuwrbwurrwruggbggrgbbguubw +wrbbruwuwgwgbrwgwgrbuuurbbggbggurrbgurbwbbrrrw +gbbgugurwbgubbbruguurrbggwgrwbbwggbwwwbbrr +ruuwuwwbubwrbbgubwrgguurgbgrbbbwggubrwugwbbrr +wbbbbbggwuurwbggguuurggguuwgwugruurbbuuguggubugrbuggwguwwb +gwwrubrwruubbwruwbgwrwwuwbbgwwubwrbugwgubwgruwru +rwwgwwwggugurbburggurrguruwubwrwwwuuwuwuuwbwbugur +rwwwwwrgwbbwrrbbwggwgwbbwgrwbwgrwrwwbuggwg +rwwrgbruuuugrwubbggwbwruwrurbrrrbrrgbbruuwwggwrwrrbugurub +ururbubgwuuuugrrbbggbugurwugwrwbgrubguuuubggggb +wbwubrbwubwgggwuwubgrrwbgruurwwrbgwguwrgwuwwugubugrgbbw +rwwwrwrrrbuuguuuuubwurbbrrrbwwgrwwggwgwgwuwrguuuwgu +ruuggwrwgggwrurbgubbrgrwuurbwwwrrwwrrbgugwgbrg +rwwbubuuuwwwbrwuwbwwrbrurgwrgubrrgwbrwrwwwwwgrugwwurwwgg +rwwwwbubgrugrurbbbrubrrgbrruwrgbugwwbuurgbwrbbggwg +rwwbbwuggwuwwubwrgrbrrbbwuuwugbugbuwrwwuwururrbruwgwwrbb +uburwgwbrrrgubugbrrggguubgwwgubrgwubrgwbbrbuuwwwr +grwbugbbwruwrbbuwrbbburwggruwbbbwubuubwgwwwwubrrruwbgwr +rbwbwwwgrbrgrruwubuwgwrbwbbubgbrrgwwbwrubbwubgbgg +gugbgbuugbwwuuuwgwbrgrgbgruuwrrwrbuggwwrwuurubrugwrburr +gbggwurrwgrwrbrbbuubuuubbbguwbggwwgrrrgwruur +gbbbgggugugwrwuwuwuwrwgubrgrrwbgruwuguwbbuw +rwwggrubburwwubgurbrwguggubwgwuwubrbgwwgrburw +gggwrurubbrrrbrgbwrggbrgbwguwwbuugbbuwwrbwug +rwwbugwbbwuwuwrwuwgwuubggrrwwuubrgubrgbw +uuwuwrubgbbrugugbubuuwggbgubgbrwbbrgbrwgubugubgbbgrbbg +wugwbggrrruguwwwwgugurgugrwguwbbbgwubgbgbbwrrwg +rwwggbwbgbwbgwuuggbwrwrgrrrgrwgubrgurrgrggruwrgubrwuuu +gbgwubgrbgwuwugrbwubrwrbgbbwbrrrurgwbgurwwwbuwb +rwwwuwbrgugurrurgububwwugwwbrrwuwwuwurrrgbwbugguubb +buguwgwuwrrwwuwbguwbwugbrrrbuwrbwugguugubuuubrw +rwwwwgrrbgugurbrbwbwgrwubwbwggbgbwrrwrwbgwuwrbgbubgbguru +wbrugbrgbbwuubgwwbbwrgbrwrwrruwurrggbrgrgbgwrwuuuuwugwrwb +rguguurwbuuguurrgrrrrbgbwbrrbwbwwgwrugggwuuwuwguggrgbwubrb +rwwwuwwgrbwurwrwubwbgbrrwwrgwuuurbgwuwggrrrrrgbuwwburw +ubugrbuwbggrwguguwwrbubrurgwbwgrbugwgugbugbru +rwwgbwuruuurgrruggruruubgbwwuwguwggurugwgruwbwgwrbwbwur +bbububrwrubbwuuugbubwbbrwbuwrwrruwgguurwuwbwbwbbrbbrwbwgg +bbugrbbgrgbugwrgubguwurrwuwubbgwrbwwuwgwguwruurguw +rwwbwbuwgubgrrbbwuwbbruwrggrrrbuugwurwrbr +wrgrurbggwbbugbggwrgrwuuwrruwbggggrwrbrrrugrwurgrrwugubgr +rgurururbgubuwrrbugurrwwbgbggguuubwgruuuwrwwugrwbuugburr +gbrbguguuggrwggbwrgrrbgubggrwggbuwuguuggrggu +rwwwgwurgrrwugwurgbgbbggbrbbwrwbwbgggwrurgrwbuggrrrgbrgggugb +rwruwbwgwguwwbwubguwubwrrugbburrbwgggbgubur +ggrggwwgrgbrgrgrurgwrgurwrbwbrwuwbwubrbrrbubwbgrubugbrubr +rwwrrrwwgrgurwuububwwugbggguruwgrruruubb +uugrwgguggrgubugrrrbgwbgrwruwgguwrwwuubgrwurbuwwgwgrgwgw +rwwrgwrgbguguwurrrbwwbuwubbuwwbugwuuwbrrw +rwwwrggrbwgbgrwbuwbbbgwggwbgruurbguwbuubwwrruuubrugbgbrguwr +wrwwgrrwbbrwbuuurugwbbrwgrgrbbbbrugrwubwugubgwrbbrwggurrr +gbubwbwuwggbwuwbuuubrgbbbrrbubwgwgbguggwbrrugubuww +brrwwuuwbwgrrrwrgbuwrgwuuurwrbrrwuugwrwgbgbrrbwuguwuwuuuu +rwwbwgbbuuruwugwbbruurwgbuuggrwggrbgwgubugwrbbrrgubgugwwbw +gurrwurwurruruguwwwrrrwbbbggggrwrbgwbuwugubuuwr +rwwwwbggguguwbbgrgrggwuwbbbgrwbrbrwbrubgwurbwrgugug +rrurbrrburgurgwbbgrgrgbgurubgwgwugggbgwbrbruwgugbwbwrwru +rwwggurubwugbrwwgwrwrurguwuurrrrrbwbbguuuwrggrugugwbrgwurrrr +rwwgwwrrurugrugwgrrbwwgwuwruruwgrubrwrgu +rgwuubuguuwburrgbugbgrgbrgwruwbbuwgurgurgurguuwgbgbrbbrw +rrrggwwbubururwruuugwgburwuwuwgbwrwbrwrbwg +rrwbggrggrbrbubrgwuubrbgbbbrbuurwbbwgbruwuwrwbugburw +rwwbwgrwbwuguuubrwgwgwrguggbggbwgbuwbuggbburw +rgbggwrbwrbwuugrurgbuwrugbwuuwrggwrwubwwrwwu +brrwbgwrrbrrbwwbbrgrgbbrbwrrggururrwgwuuwguuwgwrr +rwwwwguwugrbwwgrbwrbwbrwurgggbwgugrwwwwbbrubuwbbrgwgurbg +rwwbrwrrurrubrugwbgbwwgwwubrrguwwurruwgwg +brbbwwrwurwwggruwuwrgugguwwruurubbgrggurbgwgugwbbbbgwuggb +rbggbrwgbgwbguwrrrburbrgbrggrbgggrrbuggbbr +uwbuwuwbbrgrwuwugwwuuwgwruurubbggwbwggwwrbgbubwrgrwugwrbw +rgruwrbrbbbguguurrrwuburubwbbrubbbgrggbrwgguugb +urwbuwwrwggrgguuubugrgwwwbbrwgrrwbwgruwuubggrgwuurbbbwurb +rwwbuuuurbwrbubwbuwggrbwrbbbgrubrwgururrrwrrrwrrwggb +urbbbuwrrrbwruuuwguwurbgubgrbbrwrwuurwruruwbuburggrruwru +rwwrgrbgbwbwwuurwbugbwwrbwwgrrwbbbrgburwrbwgwburgbuwrrrrub +rwwwgrrrrgrrgrugggbburuuwgwgugwbgurrbggwbwugwrrwwgrrruub +gurguwrrrgwgwubruuruubwuwugubuwwgruugubrggbwgwuuwrbu +rwwwrrwubgbgggwwwwrgrgrwgrrrggwuwruuurrugbwbrwwrb +grrwbwbrrgburuuguwwrrrbrrwburrburwbrgbwrgw +uuggbugrggrubgrrbugwwrgwugrbgubbwrrgrwwbbbbguub +rrwggwguwbuwrwgrwuwguguwgguwbubrggwrgwbwbrggugwgrbgwrbggw +rwwrurgwbrwgwwuuurggwwururrgwrgbrubrbuuwwbgwb +bbbgbrburubrwrwbrurgbrbuwwrwgrwwrrbggbubwrrubrrrgbbrbbgwr +urgrrgbugrbwbugrrgubgrubuuuguwbrrrrubbwubwgggbburu +rbgrbgbwrruggubbugrwbubgbbwgbwbrbrububbrgguwgbwwrur +urgwuwrwwurwgwbgbrgwgrggrbwrgwugbwrrgbwgbguwrrrbrgbwrrgg +rwwggwgrgrwrgrwugrwugwbuuwbuwrrgbbgrbrbrur +wrrgwrgruwbugggbbbrrgruwrrrrbrgrgwgururrbwuugwuwu +burubrbwwwugwwbgurbuwbbwbgrgbwwrgwwbgwwgbwwuwwuw +bbururugbwgurbbbwguwuwguurwruwwwburwbgbugurruggwguugg +brgbbrugruurwwbggwbuuwwuruubuggbubwuwbrwuwwggbbwrwrgu +rwwbgruubbbggubruwurguwrurrrgrbuwwgwbwwwwguuwwrbbgwg +rwwbrrwbwbwuuwbbgbwbwbbgwwgrgurbwbrgbuguugwguubggwu +guwwbgwrurugwrbbwuuwuruubrugbwbugrbgbgbuwbwg +rwwwwwugwgbgbrrurwwubrwwwbrgbrbwwwuwgbbrbwbrruubbrwrb +wgbgbbgrbrbruugruuurrwgurwuwuubggububbggubgrwgubgggburuugb +rburuuguguwbgugwwggrbwruwwuuwwugbbwwgrbwuwgrrbbrwuuggg +gwgubbgruurrbgwrwrggurrwwwguuurrgggwrgrbwgbwg +rwwbbubrrrrrgwrubuuugrwwgrrurugwruguwugrbgr +rwwbuuwrrgggwgugggbgwuubrwgbwuwrrgggbgrwggwubgbbbwubbrgbu +rwwbrrwbgwrgbruwwuruggbbgbgrrurgrbgbwbgbugwu +grwwuubguubbguuwwrrwbwgwugwguugbruwrgrbwwub +rwwwbrgruruwrbugwbwgurrbguggubwubrbbrubrugrwbubbbgwwb +wgggwwbgruwugbruugubururruuugwgrwbrrwgrubwwwgurwwwuw +urbbrrrguwbgbbrrrrrgbburgwwbwwrgrwggwggwrg +ugwgbwgbrbbbggbggbwgrgugugbwrwwbbwrrrburuburrubgwgbwwwgwr +rgwwgrrwrrgbrbuuuwbuugwwgbubrrubugbbwrgggrbwuuruwuwgb +rwwwrrrubbgrrwrgugburgbwgubggbugrbubbuuruwurbwwwwugbgubbbwbu +buwwwuwubugrggurrbwgruugrbwrbrrwbubwgwuwwbwwwwbbgb +rurguwbbgruuugwuggrwrwbrgwbuwubrbrugwrrrrwbbwubg +ugrwgwubwrwburgurrrbwgubrrbwrrurgrugbrwgwruwwurgruwrguuwwu +rwwrbbrrgggbwbwuuuuurgrrbgbbuwbrggrwbgwuwwuuugwugu +uwubgguwugbgubrbuuuuggubgrgugubrggrggbubwgwgr +uuwwbrwurwguuugbgrwwggubbbubuwgbwubwurggubrwgbgubwrw +rwwwwrwrrgugrwgrbrwuwbwwwurbgbwrbubuubrgw +uwwuugrwbwrgrwuwrwugrrbbgbbbrugrbgbrgbwbwbbbbr +wururguwwguwruruwgrwurrwbguwwuuwrbubbrbbrgbrwrrubrrrgw +rwwgugububurrbruggwuggrbuuwbuuugwrrgbrwwwwbbrrrruwuw +rwwgbrwuwwwrrrubugrwrbgwgbgwgbwruguuwrggwww +wubrbwbuugrrbwburwwgugubbgrwruurrwwruuwbgbggwrwuwu +bubbgrgubwbrubrwrbbwuuwwgubgrugubwbubuwgrrugwwb +gbguburuwgbbbuuwgwrubbwbruuuwgggrrbgubbruu +rwwwgwgugrgbwrwrbguggwubwubrgruwwbwubbwbrgwrrrbbub +rbwbwwrggwggubwuwgggruurwuuuubwwrurrbrrrwrgwrrwbr +bubrbguugrwbuubbbuwrggwrubbrgbugugbrgbgwrubwurwbwguwrr +rugbwrruwwbuguuuwwubrggwwgrrrwuggwrggbgwubr +rurwwurrrbbgurwwgbwrubrbwrubgrrbbgubrrguuwgwbgggwuuggbbgrw +grbbgwrrgbrrubburrbbgrrbuugwurbuwugwuwgrgbwwbrg +rburgwrbrbrruguubgubggurugwgurgwuwrwguuwrugwugr +ubggwwggwrrrrbwurrrwbgrbbbrrbrwuubbrburwrg +bubgrwrrbbgwuuwubugurruwbggbubrwrgrwwgwurggrbuwwgwrruwrgw +rwwbubwuuwwgubrrgrwrguurgbwuwruruwwubgwgbwbwbuwruwwrwgruu diff --git a/2024/day19/input.txt.h b/2024/day19/input.txt.h new file mode 100644 index 0000000..34de78b --- /dev/null +++ b/2024/day19/input.txt.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +extern uint32_t _binary_2024_day19_input_txt_start __asm("_binary_2024_day19_input_txt_start"); +extern uint32_t _binary_2024_day19_input_txt_end __asm("_binary_2024_day19_input_txt_end"); +extern uint32_t _binary_2024_day19_input_txt_size __asm("_binary_2024_day19_input_txt_size"); + +#ifdef __cplusplus +} +#endif diff --git a/2024/day19/radix.c b/2024/day19/radix.c new file mode 100644 index 0000000..0eae561 --- /dev/null +++ b/2024/day19/radix.c @@ -0,0 +1,7398 @@ +static uint32_t count_substring_matches(const char * s, int length) +{ + int ix = 0; + uint32_t matches = 0; + if (ix >= length) + return matches; + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'w': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'b': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'r': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'g': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + case 'u': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + case 'w': + matches |= (1 << (ix - 1)); + if (ix >= length) { + return matches; + } + switch (s[ix++]) { + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + break; + default: + break; + } + return matches; +} diff --git a/2024/day19/radix.py b/2024/day19/radix.py new file mode 100644 index 0000000..c0de33e --- /dev/null +++ b/2024/day19/radix.py @@ -0,0 +1,59 @@ +from pprint import pprint + +with open('input.txt', 'r') as f: + s = f.read() + +patterns = s.strip().split('\n\n')[0].split(", ") + +def radix_add(d, s): + c = s[0] + tail = s[1:] + + if c not in d: + d[c] = {} + + if not tail: + pass + #d[c].append(None) + else: + radix_add(d[c], tail) + +tree = dict() + +#print("max", max(map(len, patterns))) + +for pattern in patterns: + radix_add(tree, pattern) + +def print_tree(d, indent, s): + indent2 = indent + " " + indent3 = indent2 + " " + + if d is None: + return + + print(indent + "switch (s[ix++]) {") + for key, value in d.items(): + print(indent + f"case '{key}':") + if s + key in patterns: + print(indent2 + "matches |= (1 << (ix - 1));") + print(indent2 + "if (ix >= length) {") + print(indent3 + "return matches;") + print(indent2 + "}") + print_tree(value, indent2, s + key) + print(indent2 + "break;") + + print(indent + "default:") + print(indent2 + "break;") + print(indent + "}") + +#print(patterns) +print("static uint32_t count_substring_matches(const char * s, int length)") +print("{") +print(" int ix = 0;") +print(" uint32_t matches = 0;") +print(" if (ix >= length)") +print(" return matches;") +print_tree(tree, " ", "") +print(" return matches;") +print("}") diff --git a/2024/day19/sample1.txt b/2024/day19/sample1.txt new file mode 100644 index 0000000..29648be --- /dev/null +++ b/2024/day19/sample1.txt @@ -0,0 +1,10 @@ +r, wr, b, g, bwu, rb, gb, br + +brwrr +bggr +gbbr +rrbgbr +ubwu +bwurrg +brgr +bbrgwb diff --git a/2024/day19/sample1.txt.h b/2024/day19/sample1.txt.h new file mode 100644 index 0000000..24f7e77 --- /dev/null +++ b/2024/day19/sample1.txt.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +extern uint32_t _binary_2024_day19_sample1_txt_start __asm("_binary_2024_day19_sample1_txt_start"); +extern uint32_t _binary_2024_day19_sample1_txt_end __asm("_binary_2024_day19_sample1_txt_end"); +extern uint32_t _binary_2024_day19_sample1_txt_size __asm("_binary_2024_day19_sample1_txt_size"); + +#ifdef __cplusplus +} +#endif diff --git a/2024/day19/solution.c b/2024/day19/solution.c new file mode 100644 index 0000000..3b5aae4 --- /dev/null +++ b/2024/day19/solution.c @@ -0,0 +1,67 @@ +#include + +#include "parse.h" +#include "printf.h" + +#include "radix.c" + +const char * find_first_towel(const char * input) +{ + input = parse_find(input, '\n'); + input = parse_skip(input, '\n'); + return input; +} + +static int towel_valid(const char * start, const char * end) +{ + if (end == start) + return 1; + + int length = end - start; + uint32_t matches = count_substring_matches(start, length); + int ix = 1; + + int sum = 0; + + while (matches != 0) { + if (matches & 1) { + sum += towel_valid(&start[ix], end); + } + matches >>= 1; + ix += 1; + } + + return sum; +} + +int64_t _2024_day19_part1(const char * input, int length) +{ + const char * end = input + length; + const char * towel = find_first_towel(input); + + int valid = 0; + while (towel < end) { + const char * towel_end = parse_find(towel, '\n'); + valid += (int)(towel_valid(towel, towel_end) > 0); + + towel = parse_skip(towel_end + 1, '\n'); + } + + return valid; +} + +int64_t _2024_day19_part2(const char * input, int length) +{ + const char * end = input + length; + const char * towel = find_first_towel(input); + + int sum = 0; + while (towel < end) { + const char * towel_end = parse_find(towel, '\n'); + sum += towel_valid(towel, towel_end) > 0; + + towel = parse_skip(towel_end + 1, '\n'); + } + + return sum; +} diff --git a/input_dreamcast.inc b/input_dreamcast.inc index 16ff8f6..576984a 100644 --- a/input_dreamcast.inc +++ b/input_dreamcast.inc @@ -48,6 +48,8 @@ #include "2024/day17/input.txt.h" #include "2024/day18/sample1.txt.h" #include "2024/day18/input.txt.h" +#include "2024/day19/sample1.txt.h" +#include "2024/day19/input.txt.h" static struct start_size sample[][2] = { { @@ -188,6 +190,12 @@ static struct start_size sample[][2] = { { ( char *)&_binary_2024_day18_sample1_txt_start, (uint32_t)&_binary_2024_day18_sample1_txt_size }, }, + { + { ( char *)&_binary_2024_day19_sample1_txt_start, + (uint32_t)&_binary_2024_day19_sample1_txt_size }, + { ( char *)&_binary_2024_day19_sample1_txt_start, + (uint32_t)&_binary_2024_day19_sample1_txt_size }, + }, }; static struct start_size input[] = { @@ -237,4 +245,6 @@ static struct start_size input[] = { (uint32_t)&_binary_2024_day17_input_txt_size }, { ( char *)&_binary_2024_day18_input_txt_start, (uint32_t)&_binary_2024_day18_input_txt_size }, + { ( char *)&_binary_2024_day19_input_txt_start, + (uint32_t)&_binary_2024_day19_input_txt_size }, }; diff --git a/runner.c b/runner.c index 941ed9d..ad7d6a0 100644 --- a/runner.c +++ b/runner.c @@ -38,7 +38,7 @@ bool runner_tick(struct runner_state * runner_state) int year = solution[ix].year; int day = solution[ix].day; - if (year != 2024 || day != 18) { + if (year != 2024 || day != 19) { return false; } diff --git a/runner.inc b/runner.inc index c5cdc4c..4f4557e 100644 --- a/runner.inc +++ b/runner.inc @@ -50,6 +50,8 @@ int64_t _2024_day17_part1(const char * input, int length); int64_t _2024_day17_part2(const char * input, int length); int64_t _2024_day18_part1(const char * input, int length); int64_t _2024_day18_part2(const char * input, int length); +int64_t _2024_day19_part1(const char * input, int length); +int64_t _2024_day19_part2(const char * input, int length); struct day_funcs solution[] = { { @@ -167,4 +169,9 @@ struct day_funcs solution[] = { {_2024_day18_part1, _2024_day18_part2}, NULL, }, + { + 2024, 19, + {_2024_day19_part1, _2024_day19_part2}, + NULL, + }, }; diff --git a/solutions.mk b/solutions.mk index ee3dfc1..1750bb3 100644 --- a/solutions.mk +++ b/solutions.mk @@ -73,4 +73,7 @@ DAY_OBJ = \ 2024/day17/solution.o \ 2024/day18/sample1.txt.o \ 2024/day18/input.txt.o \ - 2024/day18/solution.o + 2024/day18/solution.o \ + 2024/day19/sample1.txt.o \ + 2024/day19/input.txt.o \ + 2024/day19/solution.o