This site hosts my projects.
commit b391a58df74321ea6cb5fdc7fabbd44015be145b
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Sat Dec 6 23:18:01 2025 +0100
Part 2 complete
diff --git a/src/examples/aoc20255/aoc20255.meta b/src/examples/aoc20255/aoc20255.meta
index fb4011f..685d3b3 100644
--- a/src/examples/aoc20255/aoc20255.meta
+++ b/src/examples/aoc20255/aoc20255.meta
@@ -32,28 +32,30 @@ main = range*:ranges '\n' id*:freshIds !. -> {
< "}\n"
"return count;\n"
< "}\n"
- "Id overlap(Range a, Range b) {\n" >
- "if (a.start > b.start) {\n" >
- "return overlap(b, a);\n"
- < "}\n"
- "if (a.end < b.start) {\n" >
- "return 0;\n"
- < "}\n"
- "if (b.start > a.end) {\n" >
+ "Id count_total(Range range, int my_index) {\n" >
+ "if (range.end < range.start) {\n" >
"return 0;\n"
< "}\n"
- "return a.end - b.start + 1;\n"
- < "}\n"
- "Id count_total(Range range, int my_index) {\n" >
- "Id total = range.end - range.start + 1;\n"
- "int index;\n"
- "for (index=0; index<my_index; index++) {\n" >
- "total -= overlap(range, ranges[index]);\n"
+ "if (my_index > 0) {\n" >
+ "Range previous = ranges[my_index-1];\n"
+ "if (range.end < previous.start) {\n" >
+ "return count_total(range, my_index-1);\n"
+ < "} else if (range.start > previous.end) {\n" >
+ "return count_total(range, my_index-1);\n"
+ < "} else {\n" >
+ "Range left, right;\n"
+ "left.start = range.start;\n"
+ "left.end = previous.start-1;\n"
+ "right.start = previous.end+1;\n"
+ "right.end = range.end;\n"
+ "return count_total(left, my_index-1) + count_total(right, my_index-1);\n"
+ < "}\n"
+ < "} else {\n" >
+ "return range.end - range.start + 1;\n"
< "}\n"
- "return total;\n"
< "}\n"
"Id count_db_total_fresh() {\n" >
- "Id total;\n"
+ "Id total = 0;\n"
"int index;\n"
"for (index=0; index<" ranges.count "; index++) {\n" >
"total += count_total(ranges[index], index);\n"
commit d050381af59adc1620b2a1b76286e0a2d65ff110
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Sat Dec 6 22:40:03 2025 +0100
Part 2 in progress
diff --git a/src/examples/aoc20255/aoc20255.meta b/src/examples/aoc20255/aoc20255.meta
index c7e6fbc..fb4011f 100644
--- a/src/examples/aoc20255/aoc20255.meta
+++ b/src/examples/aoc20255/aoc20255.meta
@@ -32,9 +32,37 @@ main = range*:ranges '\n' id*:freshIds !. -> {
< "}\n"
"return count;\n"
< "}\n"
+ "Id overlap(Range a, Range b) {\n" >
+ "if (a.start > b.start) {\n" >
+ "return overlap(b, a);\n"
+ < "}\n"
+ "if (a.end < b.start) {\n" >
+ "return 0;\n"
+ < "}\n"
+ "if (b.start > a.end) {\n" >
+ "return 0;\n"
+ < "}\n"
+ "return a.end - b.start + 1;\n"
+ < "}\n"
+ "Id count_total(Range range, int my_index) {\n" >
+ "Id total = range.end - range.start + 1;\n"
+ "int index;\n"
+ "for (index=0; index<my_index; index++) {\n" >
+ "total -= overlap(range, ranges[index]);\n"
+ < "}\n"
+ "return total;\n"
+ < "}\n"
+ "Id count_db_total_fresh() {\n" >
+ "Id total;\n"
+ "int index;\n"
+ "for (index=0; index<" ranges.count "; index++) {\n" >
+ "total += count_total(ranges[index], index);\n"
+ < "}\n"
+ "return total;\n"
+ < "}\n"
"int main(void) {\n" >
"printf(\"Part 1: %d\\n\", count_fresh());\n"
- "printf(\"Part 2: %d\\n\", 0);\n"
+ "printf(\"Part 2: %ld\\n\", count_db_total_fresh());\n"
"return 0;\n"
< "}\n"
};
commit 00df5bd8400c65bfa0f6486e9557fdb0f9c81a83
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Sat Dec 6 22:27:59 2025 +0100
Clean up
diff --git a/src/examples/aoc20255/aoc20255.meta b/src/examples/aoc20255/aoc20255.meta
index 720b68d..c7e6fbc 100644
--- a/src/examples/aoc20255/aoc20255.meta
+++ b/src/examples/aoc20255/aoc20255.meta
@@ -1,6 +1,6 @@
#id = aoc20255
-main = range*:xs '\n' id*:ys !. -> {
+main = range*:ranges '\n' id*:freshIds !. -> {
"#include <stdio.h>\n"
"typedef unsigned long Id;\n"
"typedef struct {\n" >
@@ -8,14 +8,14 @@ main = range*:xs '\n' id*:ys !. -> {
"Id end;\n"
< "} Range;\n"
"Range ranges[] = {\n" >
- xs
+ ranges
< "};\n"
- "Id ids[] = {\n" >
- ys
+ "Id fresh_ids[] = {\n" >
+ freshIds
< "};\n"
"int is_fresh(Id id) {\n" >
"int index;\n"
- "for (index=0; index<" xs.count "; index++) {\n" >
+ "for (index=0; index<" ranges.count "; index++) {\n" >
"if (id >= ranges[index].start && id <= ranges[index].end) {\n" >
"return 1;\n"
< "}\n"
@@ -25,8 +25,8 @@ main = range*:xs '\n' id*:ys !. -> {
"int count_fresh() {\n" >
"int count;\n"
"int index;\n"
- "for (index=0; index<" ys.count "; index++) {\n" >
- "if (is_fresh(ids[index])) {\n" >
+ "for (index=0; index<" freshIds.count "; index++) {\n" >
+ "if (is_fresh(fresh_ids[index])) {\n" >
"count++;\n"
< "}\n"
< "}\n"
@@ -39,15 +39,11 @@ main = range*:xs '\n' id*:ys !. -> {
< "}\n"
};
-range = start:x '-' end:y '\n' -> {
- "{" x ", " y "},\n"
-};
-
+range = start:x '-' end:y '\n' -> { "{" x ", " y "},\n" };
start[Reserved] = number;
end[RuleName] = number;
id[Escape] = number:x '\n' -> { x ",\n" };
number = digit digit*;
-
digit = '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9';
commit e2afa9067ad2c115798c5030562100e594279f81
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Sat Dec 6 22:07:58 2025 +0100
Day 5 part 1
diff --git a/make.sh b/make.sh
index f9c5f27..7839e1d 100755
--- a/make.sh
+++ b/make.sh
@@ -15,6 +15,7 @@ main() {
example_aoc20252
example_aoc20253
example_aoc20254
+ example_aoc20255
}
dotall() {
@@ -98,6 +99,16 @@ example_aoc20254() {
out/rl
}
+example_aoc20255() {
+ example aoc20255
+ out/aoc20255 <src/examples/aoc20255/example.aoc20255 >out/example.c
+ c_compile out/example.c out/example
+ out/example
+ out/aoc20255 <src/examples/aoc20255/rl.aoc20255 >out/rl.c
+ c_compile out/rl.c out/rl
+ out/rl
+}
+
example() {
banner "Example: $1"
meta_compile src/examples/$1/$1.meta out/$1.c
@@ -133,6 +144,7 @@ languages() {
meta_compile src/examples/aoc20252/aoc20252.meta out/language_aoc20252.c
meta_compile src/examples/aoc20253/aoc20253.meta out/language_aoc20253.c
meta_compile src/examples/aoc20254/aoc20254.meta out/language_aoc20254.c
+ meta_compile src/examples/aoc20255/aoc20255.meta out/language_aoc20255.c
}
banner() {
diff --git a/src/examples/aoc20255/aoc20255.meta b/src/examples/aoc20255/aoc20255.meta
new file mode 100644
index 0000000..720b68d
--- /dev/null
+++ b/src/examples/aoc20255/aoc20255.meta
@@ -0,0 +1,53 @@
+#id = aoc20255
+
+main = range*:xs '\n' id*:ys !. -> {
+ "#include <stdio.h>\n"
+ "typedef unsigned long Id;\n"
+ "typedef struct {\n" >
+ "Id start;\n"
+ "Id end;\n"
+ < "} Range;\n"
+ "Range ranges[] = {\n" >
+ xs
+ < "};\n"
+ "Id ids[] = {\n" >
+ ys
+ < "};\n"
+ "int is_fresh(Id id) {\n" >
+ "int index;\n"
+ "for (index=0; index<" xs.count "; index++) {\n" >
+ "if (id >= ranges[index].start && id <= ranges[index].end) {\n" >
+ "return 1;\n"
+ < "}\n"
+ < "}\n"
+ "return 0;\n"
+ < "}\n"
+ "int count_fresh() {\n" >
+ "int count;\n"
+ "int index;\n"
+ "for (index=0; index<" ys.count "; index++) {\n" >
+ "if (is_fresh(ids[index])) {\n" >
+ "count++;\n"
+ < "}\n"
+ < "}\n"
+ "return count;\n"
+ < "}\n"
+ "int main(void) {\n" >
+ "printf(\"Part 1: %d\\n\", count_fresh());\n"
+ "printf(\"Part 2: %d\\n\", 0);\n"
+ "return 0;\n"
+ < "}\n"
+};
+
+range = start:x '-' end:y '\n' -> {
+ "{" x ", " y "},\n"
+};
+
+start[Reserved] = number;
+end[RuleName] = number;
+
+id[Escape] = number:x '\n' -> { x ",\n" };
+
+number = digit digit*;
+
+digit = '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9';
diff --git a/src/examples/aoc20255/example.aoc20255 b/src/examples/aoc20255/example.aoc20255
new file mode 100644
index 0000000..2e9078d
--- /dev/null
+++ b/src/examples/aoc20255/example.aoc20255
@@ -0,0 +1,11 @@
+3-5
+10-14
+16-20
+12-18
+
+1
+5
+8
+11
+17
+32
diff --git a/src/examples/aoc20255/rl.aoc20255 b/src/examples/aoc20255/rl.aoc20255
new file mode 100644
index 0000000..0ba9926
--- /dev/null
+++ b/src/examples/aoc20255/rl.aoc20255
@@ -0,0 +1,1179 @@
+514636401848126-515021264549070
+284036251378482-284592982874520
+296164416018017-299046449889301
+283426891017632-284036251378482
+343608343658787-349486968016855
+518754439264536-519443780540781
+203443194067628-203933432910977
+519443780540781-519633512362687
+210005855985412-210549428703488
+282811585081172-283522815708147
+282103439366027-282811585081172
+146191319211378-148928182943279
+542009870509829-542009870509829
+285110984007607-285557627386426
+181836090026423-187133491027023
+191383217925987-193740672523902
+529067077613194-530556181878483
+304959261875505-310322684117777
+5221298087814-5845643808551
+121449485422025-121449485422025
+288819540858543-289732112842441
+31314012134697-34077678147946
+355346276508449-356961978424786
+210005855985412-210154987714222
+31314012134697-38289146357504
+57372486536812-58906664319153
+63107431158211-64549017086535
+4590169517791-5221298087814
+50650192430993-52130829319473
+530953193123290-532382284125787
+265252883201638-269190040850024
+496653674559961-496653674559961
+525886102629992-527695520308656
+234586469402843-238198950451156
+519633512362687-520345553919679
+384980372022383-389006578880062
+317844855413056-320364244125646
+503139165919699-507064243567239
+463493316343339-469362738286899
+43073032066090-49251433333982
+6600924130212-7444318394218
+111838895260979-117094893375877
+7648228942274-7897731755256
+84776658354341-90046495985385
+11562463563199-18329087766001
+313521138229416-320364244125646
+193977202606502-196647888828768
+530153466102565-531523921526216
+553391357437896-562488274516946
+459525942526207-459525942526207
+53393578131918-54955075378575
+404190643739100-408213916357702
+520945760876904-521172857358597
+2727821450473-3340299640579
+286048130453075-286665795820799
+528177694307708-529471263275682
+301956083638360-307163599509656
+507064243567240-511953396823239
+260061486329253-260061486329253
+101450700607317-106472683347649
+544317206779689-552355052009161
+283196635166397-283522815708147
+288819540858543-289732112842441
+131234255850576-137062902674911
+352070211023717-353583840322516
+520186230488106-520945760876904
+415995383355085-415995383355085
+395615962419343-397864940668161
+94366474861793-99527846051448
+205173320654056-206051449292310
+58711690964932-59879231977934
+519633512362687-520345553919679
+516022119170784-516365566181711
+238198950451157-238198950451157
+206639071565785-207304603090383
+518602829412794-519443780540781
+82147453568207-84776658354339
+23956737879583-28622963935851
+484025043897742-489248708112258
+544317206779688-544317206779688
+340128853274594-340128853274594
+444827419361595-451800098044043
+294297486844512-296164416018016
+176240640987270-178847650802940
+192995036697202-195029211979726
+404190643739100-408213916357702
+423420802261041-430543339190155
+438096745586433-440661544775439
+516668731856740-516826848891136
+289079205608282-289927106556831
+515546891366899-516365566181711
+56576870014158-58238248382778
+523020705694172-524681162845767
+432699609410984-440661544775439
+73622261592470-78368864856562
+203615147167346-203933432910977
+252433626704883-260061486329253
+415995383355086-418601199927456
+225742115230077-227522359650710
+536745635162015-542009870509829
+208725672081644-208995628405837
+328742269957098-328742269957098
+163318839464148-163318839464148
+242450869652517-250877827576819
+496653674559961-498166797604837
+353406104646330-355006194373241
+207866368794809-208446995196529
+1708595883983-1909532685738
+360121938111677-361422333382878
+173867301639925-176240640987268
+181836090026423-188217989877988
+206944308839538-207304603090383
+101450700607316-101450700607316
+222235372532517-229028822916590
+142908285233132-146191319211377
+354320242004358-355829534227523
+46225481831810-49251433333982
+358708341359993-360462576296801
+1909532685738-2356756942759
+459010164236-822787238930
+52595367244327-53842968937424
+526841632481036-528402608506153
+284592982874520-284889275037951
+198480173290999-200502677914655
+206051449292310-206639071565785
+553391357437896-559252440639087
+213282678483051-217578951006125
+336185428498850-340128853274593
+121449485422025-129884332810178
+356409937299519-358284721371764
+362754678790488-368199822970279
+51349595474361-52880663948995
+163318839464149-167177497489124
+375764731455726-379099669341280
+372528206409103-375764731455724
+283522815708147-283904486146961
+444827419361595-451800098044043
+3811607178621-4081675716328
+154354622006539-157453469587934
+517803425605817-518054191542013
+426576897630361-429161675325908
+284889275037951-285337573624635
+111838895260979-117094893375877
+272614047343400-277766344260508
+392633898190960-400562908625803
+137062902674912-137062902674912
+247628951587102-250877827576819
+466773209641268-471334211762712
+285557627386426-286298272038457
+282557763450697-283426891017632
+2813781325022-3627969709652
+524077645740986-525409953554452
+197098088554829-199433303049802
+54481491520234-55965788224234
+456199144939177-459525942526206
+474922814171466-476551147548164
+14558671052767-16713866144325
+92219205556280-97580264143478
+283426891017632-284036251378482
+55460508141658-56966989766365
+282557763450697-283426891017632
+287379516759852-287963386979452
+64549017086536-69089566650446
+206051449292310-206470060622464
+384980372022383-384980372022383
+525084947593291-526380411135762
+476551147548166-480592004834004
+78368864856562-78368864856562
+286048130453075-286298272038457
+325663773852006-328742269957098
+343608343658787-346343013406331
+154354622006539-154354622006539
+283196635166397-283904486146961
+215411212460336-220375303342442
+517803425605817-518352016878202
+265252883201638-269190040850024
+195877371240788-197931294682307
+357924716181756-359488291571889
+
+278402555432346
+132663185371131
+308642641112043
+33559341434412
+405303123438474
+485951992574145
+313064131630188
+260158596036936
+88167936209309
+172542568004197
+458979566798645
+326040316021558
+441814331976477
+15242696475530
+532409453906558
+264386719516534
+462500896724966
+31810962837711
+376074010339133
+296957769366533
+214356649810920
+391352103109617
+397015393429102
+209254749760423
+396869971040626
+492567648450273
+74223735388468
+235765509681740
+393369865380685
+354084263929807
+29151194853127
+331213306580185
+200775948660881
+184162024247630
+73539350853939
+119830435623787
+27248780736717
+273944736921943
+298748652980771
+299124411214164
+505045728033385
+465052402342861
+114174482868245
+59857080667886
+385740132696595
+80006398406086
+164797560065538
+449676350447067
+331107394599031
+329904479261567
+28661521864528
+241775855437174
+70075146805242
+100377917697325
+320925037686437
+240701225007949
+71167017443884
+409486741604745
+213210388272121
+193305527209317
+454232214381698
+373477528355225
+107915765152720
+484093453725123
+384598203260425
+87692352508770
+287601254688301
+245281846783672
+346938039089651
+268195944549448
+161737144675390
+263926978453657
+399878538434895
+480794774065006
+528604895528697
+140772160424647
+72063884537085
+324924109510539
+232186650292489
+287021682047962
+119395417223177
+63888428378797
+47703189063136
+128421895159085
+145092004217697
+545399776926267
+551091745204299
+324205236371585
+142734991670084
+138011721050796
+29106037358317
+285779273281918
+544729165988472
+278655342638262
+431782774238901
+274987201312127
+482150377119121
+532329225332989
+230886711948544
+277742281856869
+542469937573351
+110928323185174
+406956845060793
+392495345988528
+373156790449365
+28897120503935
+555056437619844
+288282240953804
+233071070092757
+535916810866149
+202318644863533
+274044733613351
+445204650220846
+562599592138838
+484891673726876
+397310529392326
+51152753289229
+221691413891037
+430268065726843
+292727401143432
+148174775882288
+541971954149702
+230205232252218
+394846657281655
+258961064557207
+168538135912262
+306892797457040
+41143047884962
+263909135855905
+555322955749641
+254690587424659
+414433873970870
+24119954815073
+105258178545862
+51575143573061
+129106627117303
+374522807056431
+447497507528143
+223506299719559
+467044350364998
+107409890260230
+503048129804246
+419888793709599
+223670494400224
+254116980329454
+140949814523698
+361281828985173
+52452532098109
+134884440069559
+454230992392750
+513793320462354
+143974081539492
+301367706287735
+112278821902328
+78129336797298
+70183930773340
+113803338297946
+473304604596770
+461769367861589
+357444038347590
+464409465642740
+169918162583622
+381412251915951
+78436010713279
+74247991214850
+294408435111807
+539136654561650
+374103328543636
+211026210839033
+457850304567788
+322287802901955
+393893358183306
+189132199406123
+482062087499501
+119105849679363
+506514462708219
+134680768346040
+174484013026133
+314742387120658
+234825446647221
+526814730910876
+405094103017447
+552239665074466
+487198509367609
+543612878502850
+245955810359582
+138188761104744
+124126125471817
+561823724773957
+129469363656788
+177468379111918
+241039809480056
+550066267667976
+219843124814009
+462720788415678
+274618609488050
+364147995137340
+278379015579457
+340585878842776
+350875903168946
+331070729467974
+100327817295410
+141147271521536
+351926657214835
+262919286473957
+386199840114074
+53393671829457
+379586140154652
+491620501293264
+249990257576572
+64519244313495
+184847470149212
+89126789338975
+544825673728682
+274803776293650
+153834366278901
+435022235924159
+173873826434726
+59042972581418
+148219795626852
+444346667071188
+475532278427376
+507142501942950
+100854211818626
+47917266954190
+288864792760325
+8989755789362
+128822889809511
+478526536303692
+31049864185284
+1587848580816
+147372848518905
+8157614781088
+10988325260280
+449440693245530
+202957505221201
+468146580196327
+341156307953798
+330457556390284
+119275777031453
+157293448767060
+517712624111396
+83382707578378
+211798817670718
+403812991504731
+52438345000658
+141602527034518
+209814406404292
+288892296326853
+278940982316157
+161337794616069
+193325468633700
+385876393717156
+308588158065137
+200934729386951
+307804488538044
+112310131645211
+407549193596788
+347309160609625
+277807738036876
+1124741478798
+181850807389162
+87340536548673
+108917779897587
+409088291844305
+7327968226076
+331409906632409
+55018818407287
+135959244326713
+255607337735622
+404990318863556
+252681084988887
+502726075212134
+376076478146492
+447466454412473
+257429453228785
+252531857544466
+223649896206420
+99921279410798
+289191726250755
+87940639643249
+291657704833929
+250707386270082
+305532517235714
+457845768362257
+499633834016084
+414660722808058
+115185592261478
+323695771212749
+53067690857484
+164312891564458
+184608065212843
+404061324161713
+546670579412106
+34185905019669
+517810909767627
+318928880485847
+57145094982366
+185136468761899
+123803278607569
+275181571671734
+505187529712629
+238513631615170
+150637997035758
+60696159914228
+509153087482532
+143960871978648
+532742283360955
+321896467398818
+78923110493982
+319410013097706
+374545822434791
+329978068684180
+546234683333382
+518615064982021
+265458933753218
+282556850446800
+556536919099390
+408821451178422
+550450331006822
+387020961781675
+392293780264327
+108001809829709
+541151472944936
+372695991295080
+179700539466037
+130945353612610
+29145725683464
+329997728133242
+446881378976432
+127076551811482
+17299891883245
+159462273043256
+393020453645122
+481706204119683
+382389483886370
+423730095802717
+303184318437817
+365797078969040
+209007197844304
+247220926807876
+264292571087588
+135295985727166
+473540877207725
+42383569639867
+284148851920777
+459839683672452
+29598628425336
+92458461620063
+31618483157264
+185648070289563
+98984221426980
+327261545504740
+339544125209591
+351523051242673
+503549480739263
+451133172113710
+198137406661747
+206433566752702
+323117582234084
+402246977646126
+333793124009912
+98992932009061
+501628586740342
+94911549846737
+325461668807707
+130688966388691
+415706162750143
+431795300584506
+551496845169982
+47236321942328
+245545983075020
+110817343051994
+249570412216764
+374802975869957
+325600137603466
+295130410119795
+365918011942534
+22696813705554
+56381928509742
+322479977663160
+328995696233853
+393181808509923
+486543754315217
+384770321822425
+434901434482810
+209992693025500
+35175387586406
+30890674797432
+329334211904446
+95416474896760
+369941677173765
+408776374541039
+463328601327576
+352193059714251
+515561825104149
+509085802605817
+289033271841082
+284129612437330
+128877515059923
+11710783019097
+134496055286541
+318240924531146
+257570046738609
+104319616549205
+89453172689676
+296422863501405
+272224036719966
+403967683900289
+208395071342657
+306101872949874
+120029032017318
+361623195531845
+248456545529726
+314657311386942
+561664993912685
+365060228244264
+20958161702758
+248843859686259
+200203858186422
+6136051960313
+10355251433495
+64511549654450
+55163120105713
+549156964833318
+321255232483566
+302170372255759
+533118918134213
+147734475468464
+531959177379478
+482924799913380
+369403215999109
+517854494165516
+30763624515305
+7116155983626
+82446528448816
+462227031945577
+179818584376189
+123434101955415
+216299405959612
+46271087218668
+463013904377275
+273259685222153
+491125748072723
+448512985842556
+196859191340249
+252832456458708
+442160277872053
+524958983300282
+390106990435196
+129663515108030
+5622352673985
+257173052193326
+239287224626983
+120562509703631
+274159882479959
+228371247154455
+80267049091762
+382314795358348
+529415203479662
+459858722387131
+264282200528651
+75151228174069
+82951634913109
+342763415768211
+28971157275146
+60472601493332
+276337537927196
+351969714938165
+562587650705150
+297284704851148
+499285017085531
+324125551256360
+392206072182703
+35713645611554
+183126895651293
+424679526469974
+271552485627674
+158719592578564
+471693342183649
+97426653934358
+40613102488781
+371993554902223
+114458195370676
+219355431601203
+250239066927683
+376186023004647
+60722752493741
+463087018526652
+34201411990755
+345550248000346
+211780373002897
+169234342894556
+192841149843724
+100042399395284
+111437480645508
+452954711661644
+245907180732031
+418641728926307
+147960464589869
+33233317907622
+473530477343507
+136008282418109
+105521325435126
+487250089102014
+513133744508381
+264552966427013
+176071042788430
+268961848299179
+119949783203076
+51903620717392
+364379781128387
+131580485824532
+344131994194304
+418295349123048
+136697151966550
+548004430449314
+344380637925610
+295135201549386
+155783901147440
+265375979957582
+110702726863666
+475146284606014
+528156187870536
+206423623361985
+320983281821409
+32308190883767
+445953790831068
+280339418761001
+431229011831650
+46684003610056
+38399734614755
+281215185501015
+273353978839061
+449133569775397
+94595686369921
+175731354902944
+21307525454258
+9489987407002
+172412146731026
+193850453491238
+19446253288803
+285378598978585
+135951933336291
+480773983458421
+552984670280393
+261970498485095
+144592737060723
+138116131924687
+460915272940883
+84482553628168
+174659735669386
+404736756586967
+231412765264382
+411604040108554
+172738598023485
+394223174139584
+163258717553805
+53736088706942
+266563475927420
+390310434289887
+83706278003247
+396738905795074
+278225826503322
+191082728745913
+266651846055938
+492508384095809
+316296449653752
+343106511714695
+210459733293601
+233031956892925
+76418270871678
+29769627349822
+556381730568057
+257012482652597
+248840481200902
+222958858307134
+84042322564436
+35720953789269
+260547639489491
+182683830490502
+36952171920209
+307732212279124
+163247408905762
+435855157710622
+318189444743170
+103870743821491
+312285224574605
+98654666776816
+489010975151168
+399507638671271
+365893303170644
+6908925999420
+393324878695594
+383316081935321
+148738496718000
+52774828932456
+296650357872477
+80337082594428
+269671017806274
+55920709856139
+495013170752544
+561155374851795
+338945539513000
+156445561127481
+409561529233480
+484226615652481
+192448259839345
+481903333391252
+264212783399038
+353174725814555
+96222086088154
+493177058134893
+142723498613148
+510045939338343
+213082967590207
+451414930130011
+287178562027706
+35874332629426
+423663996970455
+88932640030339
+898865885810
+366568691213396
+93353448826935
+108107203011512
+484400437194786
+548596042489566
+529313056823226
+463540798359816
+300970233625678
+533498899750362
+134719012789179
+97353115132835
+140521188335366
+445672791299124
+123320177593172
+216791781266638
+119134890365880
+221205354293267
+184784974544773
+179139368257981
+272193704994870
+170024298461309
+271291402037580
+197907060425420
+420240113592691
+414603513638433
+250476880188896
+420090525955459
+61717209916128
+48894483980599
+377367325324804
+172567330529867
+368761772868553
+243859097661139
+116238986487276
+481244946660263
+128604756311656
+247732487283249
+425716677005089
+286601334753733
+361697552270269
+332491437490283
+371464644131715
+359812466559957
+293124187798925
+370182692549338
+402836813601382
+164523843452144
+245507429744801
+26733519594785
+546495124583763
+54555721459701
+198117667481074
+348191326815994
+184329200281240
+539356383362926
+84656623890568
+258149845295513
+209516619356014
+410555079429028
+161984645206044
+357193302837692
+177148646246335
+79841196917799
+4868559382286
+402367850249728
+362642247369303
+478292748379088
+473744859329195
+82709011229711
+524705537585961
+511883694500252
+57879549575559
+73479392417576
+349000443868403
+486425967984117
+323320630688457
+532783358104403
+50005892324280
+10448553976733
+555289371666192
+179277875998235
+295489636648645
+281583361605010
+319406015645873
+209154331723171
+252336179080392
+220101468243703
+123423381556053
+249424456885568
+142214490657924
+394722317410561
+197456057951525
+548966841451350
+266746513524031
+139098093873876
+466273909877373
+312345615912482
+458924144953335
+445118920882541
+24234079914386
+362088150037853
+460399844392608
+111163631417516
+506849603803255
+532375417265875
+187870869665168
+278574590109391
+202009760679628
+266496090594638
+88270214836837
+561632831464762
+76021467178330
+187623147965793
+357276166666099
+166068895666405
+188702242445761
+482351061167209
+391289279201523
+520990493507818
+497475469916
+339228708691089
+495434152189714
+516949693658243
+131555860183160
+481541018788302
+295012343119003
+120501704104067
+165640591375618
+529132580016293
+277893188385960
+269777289670590
+159109932761167
+455564136979615
+188185367614591
+350833577764253
+557233591767987
+123761048587147
+151314215719767
+477449342398537
+62831624082314
+234848279993236
+430602997047715
+405246019124706
+464912511081924
+197393908639185
+291554048390173
+226121989951378
+212676557405587
+554655885820685
+299727225116809
+407472777371527
+420362905416978
+296266044226918
+58192476181379
+121583520951625
+180106397580363
+260200116504662
+498917279509807
+297365431128272
+313584997350275
+456939228573020
+294370795539257
+449502356758512
+312894062722575
+216863658149932
+549519029638937
+491172219037448
+385632358076595
+203419042895174
+180179598866078
+432578305088914
+210183865431187
+388350948160814
+496476163009942
+345666993119293
+445972232903888
+492968915961196
+321236953037237
+272000749564280
+533278028352087
+6448234606804
+255371133551395
+281168111236994
+329978895797265
+81518297099960
+516583473847205
+473238890315554
+312390116937975
+428025089774473
+302568806855463
+442737529200618
+53628674268291
+559025617844995
+335152898280854
+335195085857352
+128606928001719
+539405453793625
+5091586482817
+368211480784205
+72528232324196
+192747744975660
+495687218221476
+244535070342225
+204542989872716
+333607935179787
+460896301612722
+229112968047752
+391421680374751
+110507896326982
+299550929112341
+457383042303170
+307772312034787
+442036711139656
+302535233032398
+386186344798926
+262893592415689
+372413274467022
+279479327522831
+13437891268612
+506325313609980
+131236709875043
+464308682311645
+411378982136999
+120230773754944
+423195153134786
+405990565834555
+534776597763966
+437411109031200
+219742760290494
+228865825066033
+515184891428578
+488544471552241
+269300858458577
+371478928400050
+130159606369408
+287272634734329
+461905672458027
+60329891379141
+60132187294951
+99521362347276
+309350255318622
+510729754639616
+547692850287734
+294380662401067
+310564837887649
+443429135254524
+225864458441609
+204476139942432
+157661558341040
+522328233479084
+108698387051238
+42634436032669
+91659921452940
+541453034568481
+379103522672315
+555689720604736
+132759062170768
+20346299669759
+285095936176573
+75365643884669
+238524319293110
+420903339435757
+334551123089634
+113762253792017
+28849956098160
+194797696966968
+57440169624766
+544810253201978
+436237035019730
+482781361879861
+451562898872753
+395879028348892
+121395935599089
+409431456319018
+154902071228101
+224635463987990
+459013953938681
+142670869874565
+282448069258152
+242382451120362
+17978883345856
+312070524637348
+509249001510454
+336550531120605
+420225858411694
+166872469098795
+554769014606773
+442084799525247
+112555026716453
+518399540637934
+167266744320249
+11629931904201
+313172360380743
+266675580438473
+489981067892109
+539983856126462
+40108126506885
+466597055011791
+293430577847972
+472762959360632
+441385832889494
+421905983310428
+398934722838607
+339061961403756
+225899065252817
+71937122920443
+119350445262324
+261403626362185
+486224612531414
+225971309674624
+473770813799428
+239548733721372
+435235155627578
+317885697957624
+361613326555781
+79814119607842
+459240120548328
+438955250274333
+220175009690700
+474694472577049
+318872451274205
+480338784671075
+270411228834924
+119054285786706
+348514924618706
+122354174726256
+464617525355901
+416113411057972
+420659618938099
+324487471873350
+533600567909712
+300307723453151
+112468187845819
+376164210917809
+26459568637185
+234667763068328
+330656966021309
+227128592895505
+432311421643340
+34030502774204
+437956683674722
+217413642330271
+75283583441064
+538895257967714
+119250975633432
+465464122849785
+239631273839922
+528823824074518
+470974372167650
+457264121923056
+145031905797091
+72730415213737
+106684985437402
+216605441143417
+457701708831003
+224519273459026
+75903444087925
+365475786184033
+122035276077927
+52166796219168
+546664440416045
+542053754220912
+324351452837800
+63702067734507
+243546103671323
+102770017086619
+462250185637793
+292472813603365
+562009114368012
+58620889775917
+138398280327120
+322144689531392
+42371902751795
+291727918325773
+285725217009853
+174366888517324
+366069369837793
+14937448831527
diff --git a/src/language.c b/src/language.c
index f124ea0..b6fc35d 100644
--- a/src/language.c
+++ b/src/language.c
@@ -5,6 +5,7 @@
#include "language_aoc20252.c"
#include "language_aoc20253.c"
#include "language_aoc20254.c"
+#include "language_aoc20255.c"
#include "language_generic.c"
typedef enum languages {
@@ -14,6 +15,7 @@ typedef enum languages {
Language_AOC20252,
Language_AOC20253,
Language_AOC20254,
+ Language_AOC20255,
Language_Generic
} Language;
@@ -24,6 +26,7 @@ Language language_from_string(String name) {
if (string_eqc(name, "aoc20252")) { return Language_AOC20252; }
if (string_eqc(name, "aoc20253")) { return Language_AOC20253; }
if (string_eqc(name, "aoc20254")) { return Language_AOC20254; }
+ if (string_eqc(name, "aoc20255")) { return Language_AOC20255; }
return Language_Generic;
}
@@ -34,5 +37,6 @@ static MetaParseFunction LANGUAGE_HIGHLIGHERS[] = {
language_aoc20252_rule_main,
language_aoc20253_rule_main,
language_aoc20254_rule_main,
+ language_aoc20255_rule_main,
language_generic_rule_main,
};
commit 4d60916b526bd0f0d94ea3d82188e1b36f7c8d1b
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Sat Dec 6 21:49:15 2025 +0100
Clean up
diff --git a/src/examples/aoc20254/aoc20254.meta b/src/examples/aoc20254/aoc20254.meta
index 2bc1a92..e9b2d81 100644
--- a/src/examples/aoc20254/aoc20254.meta
+++ b/src/examples/aoc20254/aoc20254.meta
@@ -24,21 +24,22 @@ main = grid:x !. -> {
"sum += paper_roll_at(row+1, col+1);\n"
"return sum;\n"
< "}\n"
- "int count() {\n" >
- "int row, col, paper_roll_count = 0;\n"
+ "int count_accessible_paper_rolls() {\n" >
+ "int row, col;\n"
+ "int count = 0;\n"
"for (row=0; row<" <rowCount "; row++) {\n" >
"for (col=0; col<" <rowCount "; col++) {\n" >
"if (paper_roll_at(row, col) && neighbour_paper_rolls(row, col) < 4) {\n" >
- "paper_roll_count++;\n"
+ "count++;\n"
"can_be_removed[row][col] = 1;\n"
< "} else {\n" >
"can_be_removed[row][col] = 0;\n"
< "}\n"
< "}\n"
< "}\n"
- "return paper_roll_count;\n"
+ "return count;\n"
< "}\n"
- "void remove_rolls(void) {\n" >
+ "void remove_paper_rolls(void) {\n" >
"int row, col;\n"
"for (row=0; row<" <rowCount "; row++) {\n" >
"for (col=0; col<" <rowCount "; col++) {\n" >
@@ -48,22 +49,18 @@ main = grid:x !. -> {
< "}\n"
< "}\n"
< "}\n"
- "int count2() {\n" >
- "int total = 0, paper_roll_count = 0;\n"
- "while (1) {\n" >
- "paper_roll_count = count();\n"
- "if (paper_roll_count > 0) {\n" >
- "total += paper_roll_count;\n"
- "remove_rolls();\n"
- < "} else {\n" >
- "break;\n"
- < "}\n"
+ "int count_total_removable_paper_rolls() {\n" >
+ "int total = 0;\n"
+ "int count = 0;\n"
+ "while ((count = count_accessible_paper_rolls())) {\n" >
+ "total += count;\n"
+ "remove_paper_rolls();\n"
< "}\n"
"return total;\n"
< "}\n"
"int main(void) {\n" >
- "printf(\"Part 1: %d\\n\", count());\n"
- "printf(\"Part 2: %d\\n\", count2());\n"
+ "printf(\"Part 1: %d\\n\", count_accessible_paper_rolls());\n"
+ "printf(\"Part 2: %d\\n\", count_total_removable_paper_rolls());\n"
"return 0;\n"
< "}\n"
};
@@ -75,12 +72,8 @@ grid = row*:xs -> {
xs
< "};\n"
"int can_be_removed[" <rowCount "][" <colCount "];\n"
- >rowCount {
- W[1]
- }
- >colCount {
- W[2]
- }
+ >rowCount { W[1] }
+ >colCount { W[2] }
};
row = cell*:xs '\n' -> {
@@ -96,5 +89,3 @@ cell =
empty = '.' -> { "0, " };
paperRoll[Escape] = '@' -> { "1, " };
-
-number = '1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9';
commit 8d50434a8dd2e0a6c78724fda5736cce8ff7ea84
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Sat Dec 6 21:38:55 2025 +0100
Part 2
diff --git a/src/examples/aoc20254/aoc20254.meta b/src/examples/aoc20254/aoc20254.meta
index bcbf3e2..2bc1a92 100644
--- a/src/examples/aoc20254/aoc20254.meta
+++ b/src/examples/aoc20254/aoc20254.meta
@@ -25,18 +25,45 @@ main = grid:x !. -> {
"return sum;\n"
< "}\n"
"int count() {\n" >
- "int row, col, paper_roll_count;\n"
+ "int row, col, paper_roll_count = 0;\n"
"for (row=0; row<" <rowCount "; row++) {\n" >
"for (col=0; col<" <rowCount "; col++) {\n" >
"if (paper_roll_at(row, col) && neighbour_paper_rolls(row, col) < 4) {\n" >
"paper_roll_count++;\n"
+ "can_be_removed[row][col] = 1;\n"
+ < "} else {\n" >
+ "can_be_removed[row][col] = 0;\n"
< "}\n"
< "}\n"
< "}\n"
"return paper_roll_count;\n"
< "}\n"
+ "void remove_rolls(void) {\n" >
+ "int row, col;\n"
+ "for (row=0; row<" <rowCount "; row++) {\n" >
+ "for (col=0; col<" <rowCount "; col++) {\n" >
+ "if (can_be_removed[row][col]) {\n" >
+ "paper_rolls[row][col] = 0;\n"
+ < "}\n"
+ < "}\n"
+ < "}\n"
+ < "}\n"
+ "int count2() {\n" >
+ "int total = 0, paper_roll_count = 0;\n"
+ "while (1) {\n" >
+ "paper_roll_count = count();\n"
+ "if (paper_roll_count > 0) {\n" >
+ "total += paper_roll_count;\n"
+ "remove_rolls();\n"
+ < "} else {\n" >
+ "break;\n"
+ < "}\n"
+ < "}\n"
+ "return total;\n"
+ < "}\n"
"int main(void) {\n" >
"printf(\"Part 1: %d\\n\", count());\n"
+ "printf(\"Part 2: %d\\n\", count2());\n"
"return 0;\n"
< "}\n"
};
@@ -47,6 +74,7 @@ grid = row*:xs -> {
"int paper_rolls[" <rowCount "][" <colCount "] = {\n" >
xs
< "};\n"
+ "int can_be_removed[" <rowCount "][" <colCount "];\n"
>rowCount {
W[1]
}
commit 6d56c2295bcdb2f576d6dabe9ff466a4fbb18f86
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Sat Dec 6 21:22:57 2025 +0100
Clean up
diff --git a/src/examples/aoc20254/aoc20254.meta b/src/examples/aoc20254/aoc20254.meta
index 6144d9d..bcbf3e2 100644
--- a/src/examples/aoc20254/aoc20254.meta
+++ b/src/examples/aoc20254/aoc20254.meta
@@ -3,41 +3,40 @@
main = grid:x !. -> {
"#include <stdio.h>\n"
x
- "int is_paper_roll(int row, int col) {\n" >
+ "int paper_roll_at(int row, int col) {\n" >
"if (row < 0 || row >= " <rowCount ") {\n" >
"return 0;\n"
< "}\n"
"if (col < 0 || col >= " <colCount ") {\n" >
"return 0;\n"
< "}\n"
- "return paperRolls[row][col];\n"
+ "return paper_rolls[row][col];\n"
< "}\n"
- "int neighbours(int row, int col) {\n" >
+ "int neighbour_paper_rolls(int row, int col) {\n" >
"int sum = 0;\n"
-
- "sum += is_paper_roll(row-1, col-1);\n"
- "sum += is_paper_roll(row-1, col);\n"
- "sum += is_paper_roll(row-1, col+1);\n"
-
- "sum += is_paper_roll(row, col-1);\n"
- "sum += is_paper_roll(row, col+1);\n"
-
- "sum += is_paper_roll(row+1, col-1);\n"
- "sum += is_paper_roll(row+1, col);\n"
- "sum += is_paper_roll(row+1, col+1);\n"
-
+ "sum += paper_roll_at(row-1, col-1);\n"
+ "sum += paper_roll_at(row-1, col);\n"
+ "sum += paper_roll_at(row-1, col+1);\n"
+ "sum += paper_roll_at(row, col-1);\n"
+ "sum += paper_roll_at(row, col+1);\n"
+ "sum += paper_roll_at(row+1, col-1);\n"
+ "sum += paper_roll_at(row+1, col);\n"
+ "sum += paper_roll_at(row+1, col+1);\n"
"return sum;\n"
< "}\n"
- "int main(void) {\n" >
- "int row, col, paperRollCount;\n"
+ "int count() {\n" >
+ "int row, col, paper_roll_count;\n"
"for (row=0; row<" <rowCount "; row++) {\n" >
"for (col=0; col<" <rowCount "; col++) {\n" >
- "if (is_paper_roll(row, col) && neighbours(row, col) < 4) {\n" >
- "paperRollCount++;\n"
+ "if (paper_roll_at(row, col) && neighbour_paper_rolls(row, col) < 4) {\n" >
+ "paper_roll_count++;\n"
< "}\n"
< "}\n"
< "}\n"
- "printf(\"Part 1: %d\\n\", paperRollCount);\n"
+ "return paper_roll_count;\n"
+ < "}\n"
+ "int main(void) {\n" >
+ "printf(\"Part 1: %d\\n\", count());\n"
"return 0;\n"
< "}\n"
};
@@ -45,7 +44,7 @@ main = grid:x !. -> {
grid = row*:xs -> {
$rowCount
$colCount
- "int paperRolls[" <rowCount "][" <colCount "] = {\n" >
+ "int paper_rolls[" <rowCount "][" <colCount "] = {\n" >
xs
< "};\n"
>rowCount {
commit 9d7072adaa14309eaabecb756f961faacb263243
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Sat Dec 6 21:11:32 2025 +0100
Day 4 part 1
diff --git a/make.sh b/make.sh
index 1299e50..f9c5f27 100755
--- a/make.sh
+++ b/make.sh
@@ -14,6 +14,7 @@ main() {
example_aoc20251
example_aoc20252
example_aoc20253
+ example_aoc20254
}
dotall() {
@@ -87,6 +88,16 @@ example_aoc20253() {
out/rl
}
+example_aoc20254() {
+ example aoc20254
+ out/aoc20254 <src/examples/aoc20254/example.aoc20254 >out/example.c
+ c_compile out/example.c out/example
+ out/example
+ out/aoc20254 <src/examples/aoc20254/rl.aoc20254 >out/rl.c
+ c_compile out/rl.c out/rl
+ out/rl
+}
+
example() {
banner "Example: $1"
meta_compile src/examples/$1/$1.meta out/$1.c
@@ -121,6 +132,7 @@ languages() {
meta_compile src/examples/aoc20251/aoc20251.meta out/language_aoc20251.c
meta_compile src/examples/aoc20252/aoc20252.meta out/language_aoc20252.c
meta_compile src/examples/aoc20253/aoc20253.meta out/language_aoc20253.c
+ meta_compile src/examples/aoc20254/aoc20254.meta out/language_aoc20254.c
}
banner() {
diff --git a/src/examples/aoc20254/aoc20254.meta b/src/examples/aoc20254/aoc20254.meta
new file mode 100644
index 0000000..6144d9d
--- /dev/null
+++ b/src/examples/aoc20254/aoc20254.meta
@@ -0,0 +1,73 @@
+#id = aoc20254
+
+main = grid:x !. -> {
+ "#include <stdio.h>\n"
+ x
+ "int is_paper_roll(int row, int col) {\n" >
+ "if (row < 0 || row >= " <rowCount ") {\n" >
+ "return 0;\n"
+ < "}\n"
+ "if (col < 0 || col >= " <colCount ") {\n" >
+ "return 0;\n"
+ < "}\n"
+ "return paperRolls[row][col];\n"
+ < "}\n"
+ "int neighbours(int row, int col) {\n" >
+ "int sum = 0;\n"
+
+ "sum += is_paper_roll(row-1, col-1);\n"
+ "sum += is_paper_roll(row-1, col);\n"
+ "sum += is_paper_roll(row-1, col+1);\n"
+
+ "sum += is_paper_roll(row, col-1);\n"
+ "sum += is_paper_roll(row, col+1);\n"
+
+ "sum += is_paper_roll(row+1, col-1);\n"
+ "sum += is_paper_roll(row+1, col);\n"
+ "sum += is_paper_roll(row+1, col+1);\n"
+
+ "return sum;\n"
+ < "}\n"
+ "int main(void) {\n" >
+ "int row, col, paperRollCount;\n"
+ "for (row=0; row<" <rowCount "; row++) {\n" >
+ "for (col=0; col<" <rowCount "; col++) {\n" >
+ "if (is_paper_roll(row, col) && neighbours(row, col) < 4) {\n" >
+ "paperRollCount++;\n"
+ < "}\n"
+ < "}\n"
+ < "}\n"
+ "printf(\"Part 1: %d\\n\", paperRollCount);\n"
+ "return 0;\n"
+ < "}\n"
+};
+
+grid = row*:xs -> {
+ $rowCount
+ $colCount
+ "int paperRolls[" <rowCount "][" <colCount "] = {\n" >
+ xs
+ < "};\n"
+ >rowCount {
+ W[1]
+ }
+ >colCount {
+ W[2]
+ }
+};
+
+row = cell*:xs '\n' -> {
+ #inc(W[1] 1)
+ #max(W[2] xs.len)
+ "{" xs "},\n"
+};
+
+cell =
+ | empty:x -> { x }
+ | paperRoll:x -> { x }
+ ;
+
+empty = '.' -> { "0, " };
+paperRoll[Escape] = '@' -> { "1, " };
+
+number = '1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9';
diff --git a/src/examples/aoc20254/example.aoc20254 b/src/examples/aoc20254/example.aoc20254
new file mode 100644
index 0000000..8209399
--- /dev/null
+++ b/src/examples/aoc20254/example.aoc20254
@@ -0,0 +1,10 @@
+..@@.@@@@.
+@@@.@.@.@@
+@@@@@.@.@@
+@.@@@@..@.
+@@.@@@@.@@
+.@@@@@@@.@
+.@.@.@.@@@
+@.@@@.@@@@
+.@@@@@@@@.
+@.@.@@@.@.
diff --git a/src/examples/aoc20254/rl.aoc20254 b/src/examples/aoc20254/rl.aoc20254
new file mode 100644
index 0000000..ba20dae
--- /dev/null
+++ b/src/examples/aoc20254/rl.aoc20254
@@ -0,0 +1,138 @@
+.@@@@.@@@@.....@@@@....@.@@.@@.@@.@@..@@.@.@@@@@@@@@.@@@@....@@.@@@@@......@@@@@@.....@.@@@@@.@@.@@.@@.@.@@@@@@@@.@@.@.@.@.@@.@@.@.@.@.@@.
+@@@@.@@@@...@@@@.@...@....@@@@.@@.@.@@@@@@@.@...@@.@@.@@@@@.@@@@....@@@..@...@@@@.@@.@@@@..@.@.@@@@@@.@@...@@@@.@@.@@.@..@@@..@@@@@.@@@.@@
+@...@.@.@.@..@@@.@...@@.@@..@.@...@@@@.@@@@@@@@@@@@@.@....@@@@@@...@@@@..@@@..@@...@.@@@@.@...@@@@@@@@@.@@@@@.@@@@@@@.@@@@@..@@@...@.@@@@@
+@@.@@@@@@.@..@..@@@@@@@@@.@...@@@.@@.@.@@.@.@@@@.@.....@.@@@@@@.@.@..@@@@.@@@...@...@.@..@@..@.@..@.@.@@.@@@@.@..@@@@@..@@@@@.@..@@...@@@@
+@.@@@@@.@@@@@@..@@.@@@@...@.@.@.@@@@.@@@@.@...@@@@@.@.@..@@@@@@.@.@@.@@@@.@@@@..@@@.@.@@.@.@.@...@..@..@@.....@@@@.@@@.@.@.@..@@@.@..@@@@@
+@.@.@@@@.@..@..@@@@@.@.@.@@.@.@.@@@@..@.@@.@@@@@.@.@@@.@@.@..@@@@@@@@.@@....@@@.@.@@@.@@@.@@@...@@@@.@@@@....@@@@.@..@@@.@@@@.@@@@.@@@@@.@
+@@..@@..@@@@@.@.@.@@@@@.@@@@@@@@@.@@.@@@@@@@@@@@@@@.....@@@@@@@@.......@@@@.@..@@@.@...@@@@@@@@.@@@@@.@@..@@.@@@@@.@.@@@@.@@....@@@@@.@.@@
+.@.@@.@@@@@.@..@@@@@@@@@@.@@@@@@@@....@@..@@.@.@...@@.@@@@..@@@..@@@.@@@@@@..@@@@.@@@@@..@@....@.@@@@@.@@...@@@@@@.@@....@@@@@.@@@..@..@@.
+.@@.@@.@....@@.@@@...@@@@@@..@@@@@..@@@..@..@..@@@.@@@..@@.@@@@@@@.@@@...@@@.@@..@.@@@@@.@@@@...@.@@@@@@.@@@@@...@..@@@@@..@.@@@@@@@...@..
+@..@@@.@.@@@@@@@@@.@@@@@@..@@..@.@@@@@.@..@@@..@@@@.@.@...@.@@@@.@@..@@@@.@...@@@..@.@@@@.@@@@@@@.@.@@@@.@.@@@@@@@.@.@..@@..@@.@@.@@@@...@
+@@.@@.@.@@.@.....@@@@.@@@@@....@@.@@@@.@.@.@@..@..@@@@@@@@.@@@.@@..@@@@@@@@@@@@@...@.@@@..@@.@@@....@@@...@@..@..@..@@....@.@@@@@@@@..@.@.
+.@@@@@@@@@@.@@@@..@@@.@@@.@..@....@.@@@@@@@@..@@@@@@@@@@@.@.....@@@@..@@@..@@@@@..@.@@@@@@.@..@.@..@@.@.@@.@@@@@@@.@@@@@@...@@@@@.@@.@.@.@
+.@.@@@..@@@....@..@.@@@.@@@@.@@@@@....@.@.@@@..@@..@.@@.@@.@@@.@.@.@@@@.@.@@@...@@.@@@...@.....@@@@@.@@@.@@@@.@@..@..@@.@@@.@@.@..@@@@@@@@
+...@.@...@...@@@.@.@@.@.@@.@.@.....@.....@@@@@@.@@@.....@@@@.@@@@..@@..@@@@@@@@@@@@@..@@@@.@@@@.@..@@@@@@@..@@.@@@.@@@@@@@@@.@@..@@@@@@@.@
+..@@@@@@@@@@..@@.@@@.@..@@@@@@@@@@...@@.@@.@@@@@@@@@@.@@.@.@@@@@@@.@.@..@@..@@@@@.@@.@@@@@@@@..@@@@@@.@@@@@@@@@@@.@.@@@@@.@@.@.@@@.@@.@...
+.@@@.@@@.@.@@.@@@@@@@.@...@@@@.@@@.@@.@@..@..@@@@@@..@@.@@@.@.@@@@..@@@@@@@@@@@@.@@@@@.@@.@@@@@.@@@.@@@@@@@.@@@.@@@@@.@..@@.@@@.@@.@@@@@@@
+.@@@@.@@@@@@@@@@@@@@...@@..@@.@@@.@@.@.@@@..@.@..@@@.@@@.@.@@@@@@@@@.@@@@.@..@@..@@@@@@@@.@..@@@....@.@@@@@@@.@.@@.@@..@@@@.@@@..@@.@@@.@@
+...@@@@@...@@@@@@.@...@@.@@@@@..@@@@@@@.@@@@@@@@@@...@@@.@..@..@@@..@@@@@..@@@..@@@@.@@@@@@@@@.@.@@@.@@@.@@@@......@@@.@..@@.@.@..@@..@...
+@@@.@@@.@@@@..@@.@..@.@@.@@@.@@@@@@@@@.@@.@@@.@@@@@@@@.@..@@@.@@@@.@@@..@@.@@@.@@.@..@@@@@.@.@.@.@@@..@@..@@...@..@@..@@@@@.@@@@@.@@@@..@@
+@@@.@...@@.@@@.@@@@.@@@@@...@.@@.@.@@@@.@@@@.@@@..@@.@.@.@@@@.@@.@@..@@@@..@@@.@@@.@.@@@@.@.@@@.@@@@@@@@.@..@.@@@@.@@.@.@@@.@...@@@@@.@@@@
+@.@@@.@.@.@@@@@@...@@@.@@@@@.@@@@@@@@..@@@@@@@@@@@@@@.@@.@@.@@@.@@@.@..@@@@.@...@@.@@@@@....@@.@.@@.@@@@@@...@@..@@@.@@.@@.@.@@@@..@..@@@.
+.@@.@@...@@@.@@@@.@@@.@@@@@@@@@.@.@.@...@@...@@@@@@@@@@@@@@@@@@@.@..@.@@@..@..@@@..@@@@@.@@@@@@.@@@.@@@.@.@.......@@.@@....@@@@@@@.@@.@@.@
+@.@.@@.@@@@.@@.@@@.@@..@@@@.@@.@.@@....@@@.@@.@@.@@..@@@.@@.@.@@.@.@@@@.@@@.@@@.@@@.@@.@@...@.@@@@@..@.@@@@@.@@.@.@..@@@@@@.@...@.@@@@...@
+.@@@.@@@@@.@@@.@...@.@@@@@.@..@.@@@@@@@@@@@.@@@@@@@@@@.@.@@.@@@@.@@@@@..@@..@@.@@@@@.@@..@@@@@@@@...@@..@.@@@@.@@@.@.@@..@..@@.@@@..@@@@@.
+.@.@@..@@.@.@...@@@.@@@@@@@@@....@.@@.....@@@...@@@@@@.@@.@....@@.@.@.@@@@@.@......@.@@@@@.@@@@.@@@@.@.@@@@@@@.@@.@@@@@@@..@@@@@@@.@@.@.@.
+@@@.@@@.@@.@@@@.@@@@@..@@@.@.@@.@@@@@@@.@@@@@@.@@@@@.@@@@.@@...@@@.@@.@@@@.@@@@...@@@.@.@@@@@@.@@@@@@@@@@@@@.@@@@@@@...@@@@@@.@@@.@@.@@.@@
+.@.@.@.@@@..@@.@@.@.@@@@@.@.@@@@.@..@@..@@@@.@@@@@..@.@.@@@@....@@...@.@@@@@..@@@.@.@@@@@..@.@.@@...@.@.@.@..@.@..@@@@@@@@@.@@@..@@@@@@@@@
+@@@@@@@.@..@@@.@@@@@@.@@.@..@@@@@@@.@@.@.@@@.@@@....@@@@.@.@@@@@@..@.@@@.@.@.@@@@@@@@@@.@.@..@.@@@.@.@.@.@@..@.@.@@@@@@@@@.@@@@@@@.@@.@..@
+@@@@..@...@@@@.@@@...@@@@@@@@@@@@.@@@.@.@@@@@..@@..@@@@.@...@@.@@@@.@..@....@@@@.@@...@..@..@@@@@@@...@.@@.@@@.@@.@.@.@@@@@.@@.@..@.@.@..@
+..@.@.@@@..@..@@@@@@@@@.@@.@@@@@@@@@..@@@@@@@.@@@.......@.@.@@@.@@@@@@@@@@.@@..@@.@.@@.@.@.@@..@@.@@.@@@..@@.@@@@.@@@.@@@@@@@.....@...@.@@
+@..@@..@..@@@.@@..@@@@@@.@@@@..@@@@.@@...@@@.@@@..@@@..@.@.@.@@@@@@@..@..@@@@@@@@@@@.@@@@....@@@..@.@@.@.@@@@.@@@@....@@.@.@@..@.@.@@@@.@@
+.@.@..@..@@@@@@..@@@@@@@.@@@@@@@.@..@.@@@.@.@@.@..@@@@@.@.@@@@@@.....@.@@..@@@@.@.@@@@@@@@@@.@@@..@@@@@.@...@@@@@@@.@.@...@@@@@@@@.@@.@..@
+@@@@.@@@@@.@@@.@.....@..@@..@@@@@@@@.@@......@...@@.@..@@@@.@.@@.@.@@@@.@@@...@@@.@@..@@...@@..@..@@@@.@@@@@@@@.@@@...@@@@@@@@.@..@@@..@@@
+@.@..@.@.@@@.@..@@.@@@..@@@.@@....@.@@@@@..@.@.@....@@@.@@@..@..@@@@@@..@.@.@..@@.@..@@@.@@@@@@@@@@...@@@@@.@@.@@.@@@@@@@@@@.@..@@@@@@@..@
+@@.@@.@@@.@@@.@@.@..@@@..@@.@@@@.@.@.@@@@@@.@@@@@@@@@......@.@@@.@.@@.@@@@.@@@....@@@.@@.@@..@@@..@.@@@@@@.@@@..@@@@@@@..@..@@@@..@@.@.@.@
+.@@..@..@.@@@.@@@@@.@...@@@@@@@@.@...@@.@@@.@.@@@@.@@@@@.@@@@@@....@.@@@@@@@@@@@@..@@@@.@@@.@@.@.@@...@@.@.@...@@.@...@@@..@.@@.@.@@.@@@@@
+@.@@.@@@@@@@@@@@@@@@@.@@.@@.@.@@..@@.@.@.@.@@@..@@@@@.@@@@..@@.@@@@@@@@@.@@@.@@@@@.@@@@@@.@@@@@@@.@@@@.@@@@@@@@..@@@@..@.@..@.@@.@@@@....@
+@@.@.@.@@@@..@@@@@....@@@@@@@.@@@@.@@.@@@.@.@@.@@@..@@.@@@@.@..@.@@@@..@@@.@..@@@@@@..@.@@...@.@@.@.@.@@@@.@@.@@@.@....@...@.@@..@...@@.@@
+@...@.@@.@@@@.@.@.@@.@@@..@@.@@.@@@...@....@@@.@@.@@.@.@@@@..@@@.@.@@@...@@@@@.@.@@.@..@@@...@@.@@.@@.@@@@.@..@@@.@.@.@@@@@@@@@.@@@@.@@@@.
+@@@@@@.@@.@@@..@.@@@@@@..@@@.@@@.@@....@..@.@@.@@@@@@@@@@@@@@...@@@.@.@@@.@..@@.@..@@@@.@@@..@@@@..@.@@@@@..@.@@@@@@.@..@@@...@@@@@@.@@@@.
+.@.@@@.@@.@@@@@.@@@@@@.@@@@@..@@.@.@@@..@..@@..@..@.@..@@..@..@@@.@@..@@@@.@@.....@@@@.@.@.@@.@@.@@@@.@@@@....@@.@@.@..@@.@.@.@.@@@@.@@@@.
+.@@.@@@.@@@@@..@@@.@..@@.@@@@@....@@@@@@.@@@@@@@@@@.@@....@.@.@.@@@.@...@.@@.@@@@@@@.@@@@.@@@@@@@.@@.@@@.@..@@@@@.@.@..@.@..@@.@.@@.@@.@@.
+....@.@@..@.@@..@@.@.@..@.@.@@.@@..@@..@@@..@..@.@.@@.@@@@..@.@@@@@....@@..@@.@.@@..@@....@@.@@..@..@......@@@..@@@@...@@@@@.@@@@@@@@@@@@.
+@@@.@@@@.@@@.@@@@@@@.@.@@@..@@.@.@@@.@@.@@@...@@@@@@@..@.@@..@@.@...@@.@..@@@..@@.@@@..@@@@@@@@.@@@@@@..@@@@@.@@@@@@@@@@@....@@@@@@@@@@@@@
+@..@@@@.@.@.@@@@@@.@.@@@.@@.@.@@@@@..@@.@@.@@@..@@@.@@@..@..@@..@...@...@@@.@.@..@..@@@..@@.@@@.@@@@@@@@@@.@@@@..@@..@..@.@@@@@@@.@@..@.@@
+@@.@.@.@.@.@@@@.....@@.@@@@@@@@@..@.....@..@.@@.@.@.@.@.@@...@@@@@@@@...@....@.@@.@@@@.@@@.@@@@.@@@.@@@@@@@@...@@.@.@@@@@@@@@.@@@@@@.@.@@@
+..@@@.@@@@.@.@@@.@@@.@@@.@@.@..@@@.@@@.@@..@..@@@@@.@@.@@@.@@@@@@@.@@@.@@@@@.@.@@@@@.@@.@.@@@.@.@@@@.@@@@.@@@@@...@@@@@@@.....@@@..@@.@@.@
+.@@...@.@@@@.@@@@..@@@.@..@@@@@...@@.@@@.@.@@.@@@.@@@@@@.@.@@...@@@....@@.@@@@@@.@@@@.@@@..@@@@@.@@.@@.@..@@@@.@@@...@@..@@@@@@.@@@@@.@@@@
+@@@@@@@@@.@.@.@.@......@...@@@@..@..@@..@.@@@.@@@@.@.@@@..@@@...@@@@@...@..@@.@@.@@@@@@.@@..@@.@@.@@@.@.@@.@..@.@.@@.@...@@@@.@@@@@@@@@@@@
+@@.@@@.@@@@@.@@@...@.@@..@@@@@.@..@.@@..@@.@@.@@@.@@@@..@.@.@@@@@.@@.@@@@.@@@@.@.@@@@.@.@@@...@@@@.@.@@.@..@@@@@..@@@.@@@..@@@.@@.@@..@.@@
+.@.@.@.@@@..@.@@@.@@.@@..@@@...@.@...@.@@..@..@.@@@.@@@.@@@@@@.@@@@@@@.@.@.@@.@@@.@@..@@...@@@@@@.@@@@.@..@@@...@@.@@@@@@..@@.@@@@.@@@@...
+@@.@@@@@@@.@@@.@@.@@@...@.@@.@.@@@@@@@@@@.@...@@.@.@@@@@@@@.@@@@@.@.@@@@@@...@@......@@@..@@@@@@.@@@@@@@@@@.@...@.@@@@...@@@@.@@.@@@.@.@@@
+@@@.@.@@.@@@@@@..@@@@@@.@...@....@@.@@@@@@@@@.@@@@@@@@..@..@@@@@@.@@@@@..@.@@.@.@@@.@@@@@@.@...@@..@..@@@..@@@.@....@@@@.@.@.@@@@@@@@.@@@@
+@@@.@@@@@@.@@.@@..@@.@.@.@@@@@.@.@@@@.@@.@.@@@@@.@..@@@.@@@@@@@@.@@..@@@.@@@@@@@@.@@...@.@@@@@@@@@@@@@@@@.@@.@.@@@.@...@@@...@..@.@.@@@@.@
+@.@...@@@.@@@@..@@..@@..@.@@@@..@.@.....@@..@.@@@@.@.@@@@@@@.@@.@.@@@...@.@@@@@.@@@..@@.@@@@@..@@@.@.@@.@@.@@@@@@@@@@@..@.@.@@.@@@.@.@@@.@
+@@@@@@@..@@.@@.@..@@@...@.@.@@@@..@@@@@@.@..@.@.@@@@@..@@@@..@@@.@@@@@@.@@@@.@.@@@..@@@.@@.@@.@@@@@.@.@@.@.@@@@@.@@@@@@..@@@@@@@..@@@.@@@.
+...@@@@@.@@@..@@..@@@@.@.@@@.....@@@@@@.@@@.@@.@@@@.@@...@@@.@@...@.@@@.@@@@@...@.@@@..@.@@.@@@@@@@@@....@.@@@.@@@.@@@@@@..@...@@@.@..@@.@
+@..@@@.@@@@.@.@@@@.@.@@@...@@@@@..@@..@@..@@@.@@.@@@@.@@..@@@@@@@@@@@@@.@.@@@.@@..@@...@@@@@.@@.@@.@@@@@@@@@..@@@.@@.@@.@..@@@@@@.@@@@.@@@
+@@@@@..@@..@@..@...@@@.@..@@@@@.@@....@@@@@@.@.@@@@@@@.@.@..@..@@@@@@@@.@@@@.....@@@@.@@@@@@@@@.@.....@@@@@@..@.@@@@@@@@@@.@@@@@@......@@@
+@.@.@@@....@.@@@@@.@...@.@.@@@@.@@@..@@..@..@@@@@@@@@@@@@@.@.@@.@@@@.@@@@..@@@@.@@@.@@@@..@@@@..@@@..@@@...@..@.@@@@@@@@@@..@@@@@@@@..@@@.
+@@....@@@.@@..@.@@.@..@@@.@.@..@@@.@@.@@.@@@@@@@@@@@@@.@@@.@.@.@@@@....@@.@@@.@@...@.@@@@@..@...@....@@@@@@@.@@..@@...@.@@.@@@.@.@@@.@.@.@
+..@@@.@.@@@@.@.@@....@@...@@.@@@.@.@@.@.@@@@.@.@...@@@@@.@@.@@@@@.@@@@@@..@@.@@@@@@.@..@.@@.@@.@..@@@@@@@@@.@..@.@@.@@..@@@@@...@@@@@@.@.@
+@@.@.@.@@.@@@.@@.@@@@@@.@.@..@.@@@.@@.@..@@@..@@@@@@@.@..@@@@..@@@.@@@.@@.@@@..@....@@@@@@@@@.@@@@@..@.@@@.@..@@@@@...@@@@.@..@.@.@.@...@@
+..@@@@.@@@.@.@@..@.@@@@@.@@.@@@@.@@.@.@.@@@.@@.@..@@@@....@@.@@.@@.@.@.@@@@@...@@.@@@@@@@@@@@@@@@.@.@@@.@@.@..@..@@@@..@.@@..@@.@.@@..@@@@
+@.@@@@@@.@@.@.@...@..@@..@@...@..@@@.@@@@@.@@@.@....@@@@..@@.@@@@@..@@..@@.@@@...@@.@@@@.@@.@.@.@@@@@@@@@@@.@@@@.@@@@.@..@.@@@@.@@.@.@@@@@
+@@@@@.@.@.@@@@@@@@@@@@.@...@@@@@@@@@.@.@.@@@@@@.@.@...@@.@..@.@@@@@.@@.@@@@@.@@@.@@.@@@@@..@@@.@...@@@@..@@.@@.@@@@@@@@@@@@..@..@@.@@@@.@@
+@@@@@.@@.@.@@@...@@.@@@@@@..@@@..@@@.@@.@@@.@@@@@.@@@@@...@..@@@@@@@@@@..@@@@.@@...@..@@@..@@@@@@@.@@@.@@..@.@@@@@@@@@..@@@@.@@.@@@@.@@.@.
+@@@@@@@@@@@@@.@@@@@.@@@@@@@@@..@@@@@.@@.@@@@@@.@@@@@.@@.@.@.@@@@@.@@@@.@.@@.@@...@.@@@@.@@@@@.@@@@@.@@@@..@@@@@@@@@@@@@@.@..@...@.@@@@.@.@
+@...@@@.@..@@@@.@@@@@...@@..@@..@@@@.@.@@..@@@@@@.@@.@@@.@..@@..@@@.@@.@@@@@.@..@.@@.............@@@.@.@@@..@@@@@@@@.@@...@.@@@.@.@@@@@@@.
+.@@..@@@..@@.@..@@@@.@@.@...@..@@@@@@@.@@@@.@@@@@.@....@@@@@.@.@..@@.@.@@@..@...@.@@@@@@@.@@@.@..@@.@.@..@.@@..@@.@@@@@.@.@@.@@@@.@.@@@@@.
+..@@@@@@.@.@.@.@@.@..@@@.@..@@@.@@@@..@@@@....@@@.@.@@@@@..@.@@@.@.@.@....@@.@...@.@@@@@@.@@@.@.@.@@@.@.@.@@@.@.@@@..@@@@@@@@..@@.....@@@@
+.@@.@.@...@@@@@@@...@@@@@@@.@..@@.@@@@.@@@.@@@@...@.@@@@@@@@@...@@@@.@.@@..@@.@@@@@@.....@@@....@.@.@@@@.@@...@...@@@@@.@@.@@@@@.@.@@..@..
+@@.@@@@@.@...@@.@@.@@..@.@@@@...@.@.@@.@@@@.@@.@....@@@.@@@@..@.@@..@@.@.@@.@.@@@@.@@..@@.@@@@@@@@@.@.@.@@.@@...@.@.@..@@@@@.@.@@..@@@.@.@
+.@..@@...@.@@@@....@.@@@@@@@.@.@@@.@.@@.@@.@..@@@@@@.@@.@@.@.@.@@@@@@@@@..@@@@@@.@.@@.@@@@@.@@.@.@.@@@@@@@..@...@@.@@..@..@@@..@@@@@@@.@@.
+.@...@@@@.@@..@...@..@.@@@@@@@@.@@@...@@.@@@@@@@.@@.@.@.@@@@@@@@@.@.@@@..@@.@.@..@.@@@@@.@@@@.@@@.@.@.@@@...@.@..@..@....@@.@@@.@...@.@..@
+@...@@..@.@.@@@@..@.@.@@@..@@@.@@@@@..@@.@@@.@.@@..@@@@@.@@@@@@..@@...@@.@@@.@@@@@.@@..@@.@@@@@@@@@@.@@.@@@@@.@.@..@.@@@@.....@@@@@@@.@@@@
+@.@@@.@..@@@@.@@.@@@@@@.@.@@@@@@.@..@@.@@@@@@@.@..@.@.@@@@@@..@@@.@.@..@@.@@@@.@@@@@@@@@@@...@....@..@..@.@....@@.@@@@@@@.@@@.@@@@@@.@.@@@
+@.@..@@..@@..@....@@.@.@@.@..@@..@@@..@@@.@@.@@@@.@.@@.@.@@@@@@@@@@@.@@@@@@.@@@@@@@..@@.@.@@@@@@@@.....@.@@@.@@@@.@.@.@@..@@@@@.@.@..@@.@@
+@@@@@@@.@@@@..@.@@@@@@.@.@.@@@@@.@.@@@@.@@@.@@@@@@@@@@@@@@.@@.@@@@@@@@@...@.@..@@@......@@@.@@@.@@@.@@..@@.@@@@..@.@.@@@.@@.@@..@@@@.@@.@.
+.....@@@@...@@..@@.@@.@@@@.@@.@@@@.@@.@@@@@@@..@..@@@@@.@@@@@@@..@@.@@..@.@@@.@..@.@.@@@@@@@...@@@..@@@.@.@.@@..@.@.@@@.@....@.@@@@@...@@@
+@..@@@@@.@.@.@@@@@.@@@@@.@@@.@@....@@.@@@@@@@.@.@@@...@@@@@@.@.@@@@.@@@.@@@..@@@@@.@@@@@.@@.@@@@@@@@@@@@@@@@.@@.@@@@.@@@...@@@@@.@@..@.@@.
+.@@.@@.@.@@@@.@.@.@@@@@@@@@@@.@.......@@.@@..@@@@..@@.@@.@@.@@@.@@.@@.@@.@.@@.@..@@@.@.@@.@@@.@@.@@@@.@.@@@@@@..@@@@.@.@..@.@...@@@@@...@.
+@@@.@.@@@@@@@@@@.@@@...@@@.@@@@...@@@@.@@@.@.@.@@@@@@@@@@....@.@..@.@.@@@@@..@@..@@.@@@@@@..@@.@.@@.@..@@@.@@@@.@@@@.@@@@@@@@@...@@.@@@.@.
+@@@@.@@@@@@@.@@@@@@@@@@..@.@@..@@@..@.@@@@.@.@@@@@@..@.@@...@.@@@.@@..@.@..@@...@....@@.@.@@@@@..@@.@@@...@.@@@@@@@@..@@@@@@@@@...@..@..@@
+@@@@.@.@@.@@@@.@@@@@.@@.@@@.@@@.@@@..@@..@@@.@@@.@@.@.@@@@.@@.@@.@..@@@@@.@@@@@@@@@@...@@@.@@.@...@.@@@....@@@@...@..@..@@....@.@.@@...@.@
+@@..@.@@@@..@@@..@@.@@.@.@@@@...@@.@@.@.@@@.@@@....@@@@@.@@@@.@.@@..@@..@.@..@@@@@..@@.@@.@@@@@@@...@@.@@@..@.@@@.@.@@@@.@@..@@@@.@@@.@.@.
+@@.@....@@@@@@@@@@@@@@...@@@.@@@@@@@@.@@.@@.@.@....@@.@.@@@@..@@@@..@@@@@@.@.@@@.@@@..@@@@@@@..@@@@.@@.@@.@...@.@@..@@@..@@@.@.@@@@..@@@@.
+@....@.@@@.@.@@.@.@.@@@@....@@@...@@..@.@...@@@@..@@@.@@@@.@@@@@@.@.@@@@@.@@..@@@@@.@@@@...@@@@..@@@@@@@@@.@@@@@@@..@@.@@@@.@@@...@@@@@@.@
+@@@@@@@@@@@..@@.@@@@.@@.@@.@@@.@@@.@@@...@@@@.@@..@@@@@@@.@@...@@@@@@.@@@@....@.@@@@@@.@@.@@@@.@.@..@@@@@..@@.@@...@@@@@@@.@.@@..@.@@.@@@.
+@@.@@.@@@.@.@@.@..@.@.@@@@@@.@@@.@.@@@.@@@.@@@@..@.....@@@@.@.@@.@..@...@..@@.@@.@@.@@@@@.@..@.@@@@@.@@@..@.@@@.@@@@@@..@.@@@.@@.@@@@.@@@.
+@@@@@@@.@@.@@@@.@@@@.@@@@@@@.@@...@@@@.@.@@..@@@@@.@.@@..@@@.@@@..@@@...@@@@..@@@@@...@@@@@.@@@..@.@@@@@@@@.@@.@@@@@.@@@.@@@.@@@...@@.@@.@
+@@@..@.@@@.@...@..@@..@@@@@@.@@@@@@@@@.@.@@.@@....@.@@..@..@@@@@@@@@@.@@@@@@@@@.@@@.@..@.@@.@@@.@.@....@@....@@@@.@@.@@.@.@@.@@....@..@@@.
+@@@@@@@@@@@@@@.@@@@.@...@.@..@@@.@@@..@@..@@@@@@@@.@..@.@@@..@@..@@..@@.@.@@@.@@@@@@@...@..@@.@@@.@@@@@@.@@@@.@.@@@@..@@@@.@@@..@@.@@@@..@
+@.@@@@@@@.@@@@..@.@@@........@@@@@.@@@@@@@@@@.@@@.@..@@@.@@..@@@@@.@..@.@.@..@@....@.@@.@.@..@...@@@.@@@.@.@.@..@.@@@@@@.@@@..@@.@.@@.@.@@
+@@@@@@@@@@.@@..@.@@@@@@@@@@.@.@@@.@@....@@@@@@..@@@@@@..@@@..@.@@..@@.@..@.@@.@@.@@..@@@@@@@@@.@@@@.@@@@..@.@@@.@.@.@@.@@@@@@@@@@@.@.@@.@.
+@@@@@@@@.@@@@@@@@@.@@@@@@@@@.@..@@@@@@@@@.@@@.@@@@@.@@@@.@@.@@..@.@@@@@@.@@.@@@.@@@@@.@..@@@@..@@@..@@@@@@@@@.@@.@@@.@.@..@@..@@@@@.@.@..@
+@@@@..@.@@..@.@@.@@.@.@@@@@@@@@@@@@@@@@@@@@@.@@@@@.@@@@@@.@@.@@@@..@.@@@@@@.@@..@@..@..@@@@@@.@.@@@.@@@@@@.@..@@@@.@@@@@@@@@@@@@@@@@@.@@@@
+@..@.@@@@@@..@@..@@.@@@@@...@@.@@...@@@..@@.@@..@@@@@@@@@@.@@@@@@.@@@.@@.@@@.@@@@..@.@@@.@.@.@@.@.@@@..@@@@@@@..@@@.@@@@@..@@@@@@@@.@.....
+..@...@@.@...@...@@.@@...@@.@@@@@.@@@@.@.@@.@...@@.@@..@@@@@@.@@@@.@@..@.@@@.@@@@.@@@@@@.@.@..@@@..@@.@.@.@@@@@.@@@@@@@.@.@@@@@@@@.@@.@..@
+..@@@@@@@@@@@@@.@@.@@@...@@@@@@@@@@@@@@@@@@.@.@@@@@@@@@@@@@..@@@@@..@@.@@..@....@.@.@..@.@@@@@.@..@.@@@@@@@@..@@@@@@.@@....@@@..@@@@@.@@@@
+.@@@@..@@@@@@....@@@@@@@@.@@..@.@.@.@@.@@.@@@.@@@..@..@@@.@.@@@@.@..@@.@.@@@@.@.@.@.@.@@.@@.@@@@@@.@@@..@.@@..@@@.@...@.@.@@@@@@@@@.@@.@@@
+@@@...@.@@@@@@.@@@@..@.@@@@@@@@@@@.@@@@.@.@@.@.@@@@@@.@.@@.@@...@@..@.@@@@@@@@@@@.@.@@@.@.@..@@@..@@@.@@@@.@@.@..@.@@@.@.@....@..@.@@@@@@.
+.@.@@@@@@.@@@@@@@@@.@@@@..@.@.@...@.@@@@@@.@@.@@@@@@@..@@@@@@..@.@@@.@.@.@..@@...@@@@@@@@.@.@@@.@.@@@.@..@@@.@@..@.@..@...@.@@@@@@@..@@@@.
+..@.@..@@@.@@@@@..@.@@@@@@.@.@@@@@@....@.@@.@..@@..@@@@@@..@@@.@.@@@@.@@.......@@@@@...@..@@...@.@@..@.@.@.@@@.@@.@@@...@@@@.@.@.@.@@@@.@.
+.@@.@@.@...@..@...@..@.@@.@@.@@@@@@.@@.@.@..@@@@@@@@@@@@@@..@@@@@@.@@@@...@@@@..@.@@@@@.@@@@.@@@@.@@....@@.@..@.@@..@@....@@.@@@@@@@.@..@@
+@.@@..@@@.@.@@@@@.@@@@@..@@@.@@@@@@.@.@.@@.@@@......@@@.@..@@@.@@@@@@@@@@@.@.@@@@@@@.@@.@.@...@@...@..@@@@@.@..@@@@@@.@.@@@@@.@....@..@.@.
+@@.@@@@.@@@.@@..@@@@@.@..@@.@@@@@@.@.@..@.@@@@@.@@.@.@@..@@@..@..@@.@@@..@@@.@@@..@@..@@......@@@.@@.@@.@@@@@@@..@@@.@@@@@@@@.@.@@@@.@@@@@
+.@.@@@@@@...@.@..@@...@@@@@.@..@.@..@@@@@@@@@@.@@@@@@.@@@@.@@.@@.@....@@.@@@@@.@@..@@..@@@.@@@.@@@..@.@.@@@@@@.@@@..@@@@.@.@@.@.@@.@@@.@.@
+@@@@@...@@..@.@@@..@@.@@@@@@.@@@@@@.@@@..@@@.@@@@.@@@.@.@.@@@@@@.@@@..@@@.@@.@@@@....@.@.@@@@@@@.@.@@@@@.@@@@@@@....@@@....@..@@@..@@.@@@@
+@@.@@@@@@.@..@.@.@.@@...@..@@@@@@@.@@.@@@@..@@...@@..@....@@@..@.@@....@@@@@.@@@@@.@.@@.@..@..@@@@@@@@@@@@..@@@...@..@..@@@..@@.@@@@@@@.@.
+.@@..@@@.@.@.@@@@.@...@@@@.@@@@@@.@.@@@@@@@@..@.@@@@@.@@.@@@.@@...@@...@@@.@@@@@@.@@@@@.@..@@@@@@@@@..@.@@..@.@.@..@@..@@@@...@@@..@@@@@@@
+@...@...@@@@.@@@@.@.@@@@@.@@.@@..@@@.@.@..@@.@..@@@@@@@..@@..@@@@@@.@..@..@@@@@@@.@.@.@..@@@@@..@@@.@@@..@.@.@@@@@@@@@@.@@.@..@@@@@@@@@...
+...@@.@@@@.@@.....@@@.@@@@@@@..@...@....@...@@.@@@@@@.@..@.@@.@..@.@......@@@@...@@@.@..@@@@.@@..@.@@@.@@....@@..@...@.@@..@@@..@@@@@@@.@.
+@@.@@@@@@@@@@.@@..@..@@@@.@@@@@@.@..@@@.@@.@..@@@.@@@@..@.@@.@.@@@@@@@..@.@@@@@.@@.@.@.@@@.@.@..@@@..@@.@@@@@@@@@@@@..@@.@.@@..@..@@.@@.@.
+@@@.@@@.@@@@@.@.@@@@@@..@@@@@@@...@..@@@@...@.@.@.@@.@..@@@.@@@..@@@@..@@.@@@@@@...@@.@.@@@@@...@@...@@@..@@@.@@@@@@.@@@@@@...@@@@@@.@.@.@
+...@...@@@@@..@@.@.@.@@....@@@@@.@@@@@@..@@@@@.@.@.@@@...@..@@.@..@@@@@@..@@@.@@.@@.@.@@..@@@@@@.@..@@..@.@@.@..@@@@..@@@@@@@@@@@.@.@@@@.@
+@@.@@@@@@.@@.@@@.@@@....@.@.@@@.@@@.@.@@@@@.@@..@.@@@@.@@@.@.@@.@..@....@@@@@@.@@.@@@@@@@.@@@.@@@@@.@.@@@.@@@.@@@@@..@@.@@@..@@@.@@@@.@...
+@@.@@@.@@..@..@.@@.@.@...@.@@.@@@@@@@@@@.@.@@@.@.@..@@@....@@@@@@..@@..@@.@@.@@@@@@.@@@@@@@@.@@..@.@@@..@.@@@@.@@.@...@@@.@@@@@.@.@@@@.@@@
+...@@@..@@@..@@.@@.@@@@@@..@@@@@@.@...@@@@.@@@@@@@@.@.@@@@@@@@@.@@@.@@@..@@@.@.@@@@@.@@.@@@@.@@@@@@@@.@.@.@@@...@.......@.@@.@...@@@@@@...
+@@@@@@@...@.@@..@....@@@@@..@@@@.@.@@@@@..@@@@..@.@.@@@.@..@.@...@@.@..@@@.@@@.@@@.@@@@@.@.@@@@.@.@..@@.@@..@..@.@@@@@@.@...@.@@@..@@@.@@@
+@.@.@@..@@.@@@@@@@@@@@..@@@.@@@..@..@@@@@@@@..@.@@@@@@@@@@.@@.@.@@..@@@.@....@@@.@..@.@@@@@.@.@@@@.@@@@@@@@.@@.@.@@.@.@.@.@@..@@@@@@@.@@..
+.@@@@.@.@.@@@..@@@@...@@..@@.@@@@@...@@@@..@.@@@@@..@@.@@...@@@@..@@.@@@@@@.@.@.@@@@@@@@.@..@@@.@@@@.@.@.@@@@@@.@.@@@.@@@.@@@.@@.@@@@@@.@.
+..@...@@@..@@@..@@@@@@@@..@.@@@@@..@@....@.@.@@@@@@@@.@@@..@....@@@@@@@@.@@.@..@.@@@..@.@@@.@@@@.@@@....@@@.@@.@.@@@@@.@.@@..@@@@@@..@@@@@
+@@@@@@@@@..@@@..@@@@.@.@@@@@@@@@@@@@@@.@@.@..@.@..@@.@...@@@.@@@@.@..@@.@@@@.@@@@..@..@@.@@@@@@@@..@@@@@.@@..@@..@.@@@@.@@@@..@@.@..@@.@@@
+@@.@@@@@.@@@@@@@@@.@.@.@.@.@@@@.@@@..@@.@@@@@@.@.@@@@@@@@@@@@@.@@@@.@@@@@.@@@.@@@.@.@@...@@@@.@@@@@.@.@@.@@@@.@@.@..@@@@...@@..@@@@@...@@@
+@...@.@.@@@@.@.@..@@@@@.@..@@@.@..@.@.@@.@@@@@@@.@@.@@@@.@@@@@@@@.@@.@.@.@@@@.@@@..@@@@@@.@.@@.@.@@@@.@@.@@@.......@.@@@@@@.@@@.@.@..@@@@.
+@@..@@.@@.@@@@..@..@@@@.@@..@@@.@.@.@@@@@@@@....@@.@.@@.@@.@@@.@@.@@@@@.@.@@@.@@@@@.@.@@@@@@@.@@@@@@@.@@@.@.@@.@.@@@.@@@.@.@@@@@@.@.....@@
+@@@.@@@.@.@.@..@@@.@@@@@....@@.@@@..@@@@@@@.@@@@..@@@@.@.@.@.@.@@@@..@@.@@...@@...@.@.@.@....@@..@@@@@@@@@@@@@.@@.@@....@@@.@@@@.@...@..@@
+..@@@@....@.@@.@.@.@@@@..@....@@@@@@@@@@.@@.@@@@@..@.@@@...@@@@@@..@..@@@@@@.@@@..@@@@@@.@.@@..@@@@@@@@@@.@@@.@@@@.@@@.@...@...@...@.@@@@.
+@..@.@.@.@@.@@.@.@.@@...@@...@...@@@..@@@@@..@@@@@@@@.@@.@@@@.@..@@@..@..@@@@@..@..@@@..@@@.@..@.@@.@@@...@@@..@@.@..@..@@.@@@@@@@@@@@@.@@
+@..@.@@.@@...@@@@@@@@.@..@@@..@@.@@@..@@@@@.@@@@@.@.@@@@@@@@@..@@.@..@@..@@.@@....@.@.@@.@.@@@@@...@.@..@@@.@...@.@.@@@@.@@.@@.@.@@@@@@.@@
+.@.@..@...@@.@@...@..@@.@.@@@.@.@.@@.@@@.@.@@@@.@@...@@..@..@@@.@@@.@@@@@.@.@.@@@.@.@.@@@@@@..@@...@.@.@@.@@@.@@@@@..@.@.@.@@@.@.@.@@.@@@@
+@@...@.@.@..@@@@..@..@@...@.@@@.....@.@@.@@@@@@@@@@@@.@@.@.@@@@@@@..@.@@@@@.@@.@@@@@.@@@.@@.@@@.@@@@@@@.@@@.@@@@..@.@@.@@@.@@@@@@@@@@@@.@@
+@..@..@@.@@@@@.@@..@.@@.@@..@@.@@@@@.@..@@@@@@@.@@...@@@@@@.@.@.@@@...@.@.@..@@@..@@@@@.@...@.@.@.....@.@@.@..@@.@@@.@@..@@.@@.@@..@..@...
+.@@.@.@@@@@@@@@@.@..@@@.@@@@....@@.@@@@@@@.@@.@.@@@@@@@.@..@.@@@@@@@...@@@...@@@...@@@@@@@@...@@@@.....@@@@@@@..@...@@.@@@@@@@@@@@..@@.@@@
+..@@@@..@@@@...@@..@@@@@@@.@..@@@@@@@@@@@.....@@...@.@.@@@@.......@.@@@.@.@@@@@@@@@@.@@@@@@@@.@@.@..@.@.@@@.@@.@@@@.@.@@@@@@@@.....@@@@@.@
+.....@@@...@@@.@@@@@.@@..@.@@...@...@.@@@@....@@..@@@@@.......@@...@.@@@..@@@@@.@@.@@@@@@@.@@@@@..@@@@..@@@@@@.@.@@@.@@@.@@@@@@..@@.@@@@@.
+.@@.@@@@.@.@@.@@@@@@@..@@.@.@.@@@@.@.@@..@.@..@.@@@..@.@@@@@@@@@.......@@@@@..@.@.@@@@@@@@@@@@@..@@.@.@@@@@.@@.@@@@@@.@...@@.@@@.@.@.@..@@
diff --git a/src/language.c b/src/language.c
index 9d16d75..f124ea0 100644
--- a/src/language.c
+++ b/src/language.c
@@ -4,6 +4,7 @@
#include "language_aoc20251.c"
#include "language_aoc20252.c"
#include "language_aoc20253.c"
+#include "language_aoc20254.c"
#include "language_generic.c"
typedef enum languages {
@@ -12,6 +13,7 @@ typedef enum languages {
Language_AOC20251,
Language_AOC20252,
Language_AOC20253,
+ Language_AOC20254,
Language_Generic
} Language;
@@ -21,6 +23,7 @@ Language language_from_string(String name) {
if (string_eqc(name, "aoc20251")) { return Language_AOC20251; }
if (string_eqc(name, "aoc20252")) { return Language_AOC20252; }
if (string_eqc(name, "aoc20253")) { return Language_AOC20253; }
+ if (string_eqc(name, "aoc20254")) { return Language_AOC20254; }
return Language_Generic;
}
@@ -30,5 +33,6 @@ static MetaParseFunction LANGUAGE_HIGHLIGHERS[] = {
language_aoc20251_rule_main,
language_aoc20252_rule_main,
language_aoc20253_rule_main,
+ language_aoc20254_rule_main,
language_generic_rule_main,
};
commit 9880a3b1995fbab750c7f964eea7ad9c7dee1d72
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Sat Dec 6 17:34:02 2025 +0100
Clean up
diff --git a/src/examples/aoc20253/aoc20253.meta b/src/examples/aoc20253/aoc20253.meta
index 78591fb..52729d9 100644
--- a/src/examples/aoc20253/aoc20253.meta
+++ b/src/examples/aoc20253/aoc20253.meta
@@ -1,14 +1,16 @@
#id = aoc20253
-main = bank*:xs !. -> {
+main = bank12*:xs !. -> {
"#include <stdio.h>\n"
"int main(void) {\n" >
- "printf(\"Part 1: %ld\\n\", 0 " xs ");\n"
+ "printf(\"Part 1: %ld\\n\", (long int)(0" xs "));\n"
"return 0;\n"
< "}\n"
};
-bank = joltage12:x number* '\n' -> { " + " x };
+bank2 = joltage2:x number* '\n' -> { " + " x };
+
+bank12 = joltage12:x number* '\n' -> { " + " x };
joltage12 =
| nine:x joltage11:y -> { x y }
commit e6b65eb6c161a064f48aa3de7a146b75f6acad05
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Sat Dec 6 17:32:03 2025 +0100
Clean up
diff --git a/src/examples/aoc20253/aoc20253.meta b/src/examples/aoc20253/aoc20253.meta
index 405c5aa..78591fb 100644
--- a/src/examples/aoc20253/aoc20253.meta
+++ b/src/examples/aoc20253/aoc20253.meta
@@ -8,141 +8,141 @@ main = bank*:xs !. -> {
< "}\n"
};
-bank = number1:x number* '\n' -> { " + " x };
-
-number1 =
- | nine:x number2:y -> { x y }
- | eight:x number2:y -> { x y }
- | seven:x number2:y -> { x y }
- | six:x number2:y -> { x y }
- | five:x number2:y -> { x y }
- | four:x number2:y -> { x y }
- | three:x number2:y -> { x y }
- | two:x number2:y -> { x y }
- | one:x number2:y -> { x y }
+bank = joltage12:x number* '\n' -> { " + " x };
+
+joltage12 =
+ | nine:x joltage11:y -> { x y }
+ | eight:x joltage11:y -> { x y }
+ | seven:x joltage11:y -> { x y }
+ | six:x joltage11:y -> { x y }
+ | five:x joltage11:y -> { x y }
+ | four:x joltage11:y -> { x y }
+ | three:x joltage11:y -> { x y }
+ | two:x joltage11:y -> { x y }
+ | one:x joltage11:y -> { x y }
;
-number2 =
- | nine:x number3:y -> { x y }
- | eight:x number3:y -> { x y }
- | seven:x number3:y -> { x y }
- | six:x number3:y -> { x y }
- | five:x number3:y -> { x y }
- | four:x number3:y -> { x y }
- | three:x number3:y -> { x y }
- | two:x number3:y -> { x y }
- | one:x number3:y -> { x y }
+joltage11 =
+ | nine:x joltage10:y -> { x y }
+ | eight:x joltage10:y -> { x y }
+ | seven:x joltage10:y -> { x y }
+ | six:x joltage10:y -> { x y }
+ | five:x joltage10:y -> { x y }
+ | four:x joltage10:y -> { x y }
+ | three:x joltage10:y -> { x y }
+ | two:x joltage10:y -> { x y }
+ | one:x joltage10:y -> { x y }
;
-number3 =
- | nine:x number4:y -> { x y }
- | eight:x number4:y -> { x y }
- | seven:x number4:y -> { x y }
- | six:x number4:y -> { x y }
- | five:x number4:y -> { x y }
- | four:x number4:y -> { x y }
- | three:x number4:y -> { x y }
- | two:x number4:y -> { x y }
- | one:x number4:y -> { x y }
+joltage10 =
+ | nine:x joltage9:y -> { x y }
+ | eight:x joltage9:y -> { x y }
+ | seven:x joltage9:y -> { x y }
+ | six:x joltage9:y -> { x y }
+ | five:x joltage9:y -> { x y }
+ | four:x joltage9:y -> { x y }
+ | three:x joltage9:y -> { x y }
+ | two:x joltage9:y -> { x y }
+ | one:x joltage9:y -> { x y }
;
-number4 =
- | nine:x number5:y -> { x y }
- | eight:x number5:y -> { x y }
- | seven:x number5:y -> { x y }
- | six:x number5:y -> { x y }
- | five:x number5:y -> { x y }
- | four:x number5:y -> { x y }
- | three:x number5:y -> { x y }
- | two:x number5:y -> { x y }
- | one:x number5:y -> { x y }
+joltage9 =
+ | nine:x joltage8:y -> { x y }
+ | eight:x joltage8:y -> { x y }
+ | seven:x joltage8:y -> { x y }
+ | six:x joltage8:y -> { x y }
+ | five:x joltage8:y -> { x y }
+ | four:x joltage8:y -> { x y }
+ | three:x joltage8:y -> { x y }
+ | two:x joltage8:y -> { x y }
+ | one:x joltage8:y -> { x y }
;
-number5 =
- | nine:x number6:y -> { x y }
- | eight:x number6:y -> { x y }
- | seven:x number6:y -> { x y }
- | six:x number6:y -> { x y }
- | five:x number6:y -> { x y }
- | four:x number6:y -> { x y }
- | three:x number6:y -> { x y }
- | two:x number6:y -> { x y }
- | one:x number6:y -> { x y }
+joltage8 =
+ | nine:x joltage7:y -> { x y }
+ | eight:x joltage7:y -> { x y }
+ | seven:x joltage7:y -> { x y }
+ | six:x joltage7:y -> { x y }
+ | five:x joltage7:y -> { x y }
+ | four:x joltage7:y -> { x y }
+ | three:x joltage7:y -> { x y }
+ | two:x joltage7:y -> { x y }
+ | one:x joltage7:y -> { x y }
;
-number6 =
- | nine:x number7:y -> { x y }
- | eight:x number7:y -> { x y }
- | seven:x number7:y -> { x y }
- | six:x number7:y -> { x y }
- | five:x number7:y -> { x y }
- | four:x number7:y -> { x y }
- | three:x number7:y -> { x y }
- | two:x number7:y -> { x y }
- | one:x number7:y -> { x y }
+joltage7 =
+ | nine:x joltage6:y -> { x y }
+ | eight:x joltage6:y -> { x y }
+ | seven:x joltage6:y -> { x y }
+ | six:x joltage6:y -> { x y }
+ | five:x joltage6:y -> { x y }
+ | four:x joltage6:y -> { x y }
+ | three:x joltage6:y -> { x y }
+ | two:x joltage6:y -> { x y }
+ | one:x joltage6:y -> { x y }
;
-number7 =
- | nine:x number8:y -> { x y }
- | eight:x number8:y -> { x y }
- | seven:x number8:y -> { x y }
- | six:x number8:y -> { x y }
- | five:x number8:y -> { x y }
- | four:x number8:y -> { x y }
- | three:x number8:y -> { x y }
- | two:x number8:y -> { x y }
- | one:x number8:y -> { x y }
+joltage6 =
+ | nine:x joltage5:y -> { x y }
+ | eight:x joltage5:y -> { x y }
+ | seven:x joltage5:y -> { x y }
+ | six:x joltage5:y -> { x y }
+ | five:x joltage5:y -> { x y }
+ | four:x joltage5:y -> { x y }
+ | three:x joltage5:y -> { x y }
+ | two:x joltage5:y -> { x y }
+ | one:x joltage5:y -> { x y }
;
-number8 =
- | nine:x number9:y -> { x y }
- | eight:x number9:y -> { x y }
- | seven:x number9:y -> { x y }
- | six:x number9:y -> { x y }
- | five:x number9:y -> { x y }
- | four:x number9:y -> { x y }
- | three:x number9:y -> { x y }
- | two:x number9:y -> { x y }
- | one:x number9:y -> { x y }
+joltage5 =
+ | nine:x joltage4:y -> { x y }
+ | eight:x joltage4:y -> { x y }
+ | seven:x joltage4:y -> { x y }
+ | six:x joltage4:y -> { x y }
+ | five:x joltage4:y -> { x y }
+ | four:x joltage4:y -> { x y }
+ | three:x joltage4:y -> { x y }
+ | two:x joltage4:y -> { x y }
+ | one:x joltage4:y -> { x y }
;
-number9 =
- | nine:x number10:y -> { x y }
- | eight:x number10:y -> { x y }
- | seven:x number10:y -> { x y }
- | six:x number10:y -> { x y }
- | five:x number10:y -> { x y }
- | four:x number10:y -> { x y }
- | three:x number10:y -> { x y }
- | two:x number10:y -> { x y }
- | one:x number10:y -> { x y }
+joltage4 =
+ | nine:x joltage3:y -> { x y }
+ | eight:x joltage3:y -> { x y }
+ | seven:x joltage3:y -> { x y }
+ | six:x joltage3:y -> { x y }
+ | five:x joltage3:y -> { x y }
+ | four:x joltage3:y -> { x y }
+ | three:x joltage3:y -> { x y }
+ | two:x joltage3:y -> { x y }
+ | one:x joltage3:y -> { x y }
;
-number10 =
- | nine:x number11:y -> { x y }
- | eight:x number11:y -> { x y }
- | seven:x number11:y -> { x y }
- | six:x number11:y -> { x y }
- | five:x number11:y -> { x y }
- | four:x number11:y -> { x y }
- | three:x number11:y -> { x y }
- | two:x number11:y -> { x y }
- | one:x number11:y -> { x y }
+joltage3 =
+ | nine:x joltage2:y -> { x y }
+ | eight:x joltage2:y -> { x y }
+ | seven:x joltage2:y -> { x y }
+ | six:x joltage2:y -> { x y }
+ | five:x joltage2:y -> { x y }
+ | four:x joltage2:y -> { x y }
+ | three:x joltage2:y -> { x y }
+ | two:x joltage2:y -> { x y }
+ | one:x joltage2:y -> { x y }
;
-number11 =
- | nine:x number12:y -> { x y }
- | eight:x number12:y -> { x y }
- | seven:x number12:y -> { x y }
- | six:x number12:y -> { x y }
- | five:x number12:y -> { x y }
- | four:x number12:y -> { x y }
- | three:x number12:y -> { x y }
- | two:x number12:y -> { x y }
- | one:x number12:y -> { x y }
+joltage2 =
+ | nine:x joltage1:y -> { x y }
+ | eight:x joltage1:y -> { x y }
+ | seven:x joltage1:y -> { x y }
+ | six:x joltage1:y -> { x y }
+ | five:x joltage1:y -> { x y }
+ | four:x joltage1:y -> { x y }
+ | three:x joltage1:y -> { x y }
+ | two:x joltage1:y -> { x y }
+ | one:x joltage1:y -> { x y }
;
-number12 =
+joltage1 =
| nine:x -> { x }
| eight:x -> { x }
| seven:x -> { x }
commit fe7bd415aa519c384e2f2aa3275979cb8156d484
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Sat Dec 6 17:27:50 2025 +0100
Part 2
diff --git a/src/examples/aoc20253/aoc20253.meta b/src/examples/aoc20253/aoc20253.meta
index 292705a..405c5aa 100644
--- a/src/examples/aoc20253/aoc20253.meta
+++ b/src/examples/aoc20253/aoc20253.meta
@@ -3,7 +3,7 @@
main = bank*:xs !. -> {
"#include <stdio.h>\n"
"int main(void) {\n" >
- "printf(\"Part 1: %d\\n\", 0 " xs ");\n"
+ "printf(\"Part 1: %ld\\n\", 0 " xs ");\n"
"return 0;\n"
< "}\n"
};
@@ -23,6 +23,126 @@ number1 =
;
number2 =
+ | nine:x number3:y -> { x y }
+ | eight:x number3:y -> { x y }
+ | seven:x number3:y -> { x y }
+ | six:x number3:y -> { x y }
+ | five:x number3:y -> { x y }
+ | four:x number3:y -> { x y }
+ | three:x number3:y -> { x y }
+ | two:x number3:y -> { x y }
+ | one:x number3:y -> { x y }
+ ;
+
+number3 =
+ | nine:x number4:y -> { x y }
+ | eight:x number4:y -> { x y }
+ | seven:x number4:y -> { x y }
+ | six:x number4:y -> { x y }
+ | five:x number4:y -> { x y }
+ | four:x number4:y -> { x y }
+ | three:x number4:y -> { x y }
+ | two:x number4:y -> { x y }
+ | one:x number4:y -> { x y }
+ ;
+
+number4 =
+ | nine:x number5:y -> { x y }
+ | eight:x number5:y -> { x y }
+ | seven:x number5:y -> { x y }
+ | six:x number5:y -> { x y }
+ | five:x number5:y -> { x y }
+ | four:x number5:y -> { x y }
+ | three:x number5:y -> { x y }
+ | two:x number5:y -> { x y }
+ | one:x number5:y -> { x y }
+ ;
+
+number5 =
+ | nine:x number6:y -> { x y }
+ | eight:x number6:y -> { x y }
+ | seven:x number6:y -> { x y }
+ | six:x number6:y -> { x y }
+ | five:x number6:y -> { x y }
+ | four:x number6:y -> { x y }
+ | three:x number6:y -> { x y }
+ | two:x number6:y -> { x y }
+ | one:x number6:y -> { x y }
+ ;
+
+number6 =
+ | nine:x number7:y -> { x y }
+ | eight:x number7:y -> { x y }
+ | seven:x number7:y -> { x y }
+ | six:x number7:y -> { x y }
+ | five:x number7:y -> { x y }
+ | four:x number7:y -> { x y }
+ | three:x number7:y -> { x y }
+ | two:x number7:y -> { x y }
+ | one:x number7:y -> { x y }
+ ;
+
+number7 =
+ | nine:x number8:y -> { x y }
+ | eight:x number8:y -> { x y }
+ | seven:x number8:y -> { x y }
+ | six:x number8:y -> { x y }
+ | five:x number8:y -> { x y }
+ | four:x number8:y -> { x y }
+ | three:x number8:y -> { x y }
+ | two:x number8:y -> { x y }
+ | one:x number8:y -> { x y }
+ ;
+
+number8 =
+ | nine:x number9:y -> { x y }
+ | eight:x number9:y -> { x y }
+ | seven:x number9:y -> { x y }
+ | six:x number9:y -> { x y }
+ | five:x number9:y -> { x y }
+ | four:x number9:y -> { x y }
+ | three:x number9:y -> { x y }
+ | two:x number9:y -> { x y }
+ | one:x number9:y -> { x y }
+ ;
+
+number9 =
+ | nine:x number10:y -> { x y }
+ | eight:x number10:y -> { x y }
+ | seven:x number10:y -> { x y }
+ | six:x number10:y -> { x y }
+ | five:x number10:y -> { x y }
+ | four:x number10:y -> { x y }
+ | three:x number10:y -> { x y }
+ | two:x number10:y -> { x y }
+ | one:x number10:y -> { x y }
+ ;
+
+number10 =
+ | nine:x number11:y -> { x y }
+ | eight:x number11:y -> { x y }
+ | seven:x number11:y -> { x y }
+ | six:x number11:y -> { x y }
+ | five:x number11:y -> { x y }
+ | four:x number11:y -> { x y }
+ | three:x number11:y -> { x y }
+ | two:x number11:y -> { x y }
+ | one:x number11:y -> { x y }
+ ;
+
+number11 =
+ | nine:x number12:y -> { x y }
+ | eight:x number12:y -> { x y }
+ | seven:x number12:y -> { x y }
+ | six:x number12:y -> { x y }
+ | five:x number12:y -> { x y }
+ | four:x number12:y -> { x y }
+ | three:x number12:y -> { x y }
+ | two:x number12:y -> { x y }
+ | one:x number12:y -> { x y }
+ ;
+
+number12 =
| nine:x -> { x }
| eight:x -> { x }
| seven:x -> { x }
commit ddbba44513c03a8819824b5a3d0edd032508ceb0
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Sat Dec 6 17:23:02 2025 +0100
Clean up
diff --git a/src/examples/aoc20253/aoc20253.meta b/src/examples/aoc20253/aoc20253.meta
index d46aecf..292705a 100644
--- a/src/examples/aoc20253/aoc20253.meta
+++ b/src/examples/aoc20253/aoc20253.meta
@@ -2,26 +2,27 @@
main = bank*:xs !. -> {
"#include <stdio.h>\n"
- "int main(void) { printf(\"Part 1: %d\\n\", 0 " xs "); return 0; }\n"
+ "int main(void) {\n" >
+ "printf(\"Part 1: %d\\n\", 0 " xs ");\n"
+ "return 0;\n"
+ < "}\n"
};
-bank = highest:x number* '\n' -> {
- " + " x
-};
+bank = number1:x number* '\n' -> { " + " x };
-highest =
- | nine:x low:y -> { x y }
- | eight:x low:y -> { x y }
- | seven:x low:y -> { x y }
- | six:x low:y -> { x y }
- | five:x low:y -> { x y }
- | four:x low:y -> { x y }
- | three:x low:y -> { x y }
- | two:x low:y -> { x y }
- | one:x low:y -> { x y }
+number1 =
+ | nine:x number2:y -> { x y }
+ | eight:x number2:y -> { x y }
+ | seven:x number2:y -> { x y }
+ | six:x number2:y -> { x y }
+ | five:x number2:y -> { x y }
+ | four:x number2:y -> { x y }
+ | three:x number2:y -> { x y }
+ | two:x number2:y -> { x y }
+ | one:x number2:y -> { x y }
;
-low =
+number2 =
| nine:x -> { x }
| eight:x -> { x }
| seven:x -> { x }
commit f939b99a0d9392ad35ec24a6ee3dc2b27a0dccbe
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Sat Dec 6 17:16:20 2025 +0100
Clean up
diff --git a/src/examples/aoc20253/aoc20253.meta b/src/examples/aoc20253/aoc20253.meta
index 997b536..d46aecf 100644
--- a/src/examples/aoc20253/aoc20253.meta
+++ b/src/examples/aoc20253/aoc20253.meta
@@ -43,6 +43,6 @@ three = &'3' hit:x -> { x } | number three:x -> { x };
two = &'2' hit:x -> { x } | number two:x -> { x };
one = &'1' hit:x -> { x } | number one:x -> { x };
-hit[VariableName] = .;
+hit[Escape] = number;
-number[Escape] = '1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9';
+number = '1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9';
commit c299a28b338f0446adbbcd41801de0b87e563282
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Sat Dec 6 14:10:51 2025 +0100
Part 2
diff --git a/src/examples/aoc20253/aoc20253.meta b/src/examples/aoc20253/aoc20253.meta
index 8e91ace..997b536 100644
--- a/src/examples/aoc20253/aoc20253.meta
+++ b/src/examples/aoc20253/aoc20253.meta
@@ -1,13 +1,48 @@
#id = aoc20253
-main = bank* !. -> {
- "int main(void) { return 0; }"
+main = bank*:xs !. -> {
+ "#include <stdio.h>\n"
+ "int main(void) { printf(\"Part 1: %d\\n\", 0 " xs "); return 0; }\n"
};
-bank = battery* '\n';
+bank = highest:x number* '\n' -> {
+ " + " x
+};
+
+highest =
+ | nine:x low:y -> { x y }
+ | eight:x low:y -> { x y }
+ | seven:x low:y -> { x y }
+ | six:x low:y -> { x y }
+ | five:x low:y -> { x y }
+ | four:x low:y -> { x y }
+ | three:x low:y -> { x y }
+ | two:x low:y -> { x y }
+ | one:x low:y -> { x y }
+ ;
+
+low =
+ | nine:x -> { x }
+ | eight:x -> { x }
+ | seven:x -> { x }
+ | six:x -> { x }
+ | five:x -> { x }
+ | four:x -> { x }
+ | three:x -> { x }
+ | two:x -> { x }
+ | one:x -> { x }
+ ;
+
+nine = &'9' hit:x -> { x } | number nine:x -> { x };
+eight = &'8' hit:x -> { x } | number eight:x -> { x };
+seven = &'7' hit:x -> { x } | number seven:x -> { x };
+six = &'6' hit:x -> { x } | number six:x -> { x };
+five = &'5' hit:x -> { x } | number five:x -> { x };
+four = &'4' hit:x -> { x } | number four:x -> { x };
+three = &'3' hit:x -> { x } | number three:x -> { x };
+two = &'2' hit:x -> { x } | number two:x -> { x };
+one = &'1' hit:x -> { x } | number one:x -> { x };
-battery = high | medium | low;
+hit[VariableName] = .;
-high[Reserved] = '9' | '8';
-medium = '4' | '5' | '6' | '7';
-low[RuleName] = '3' | '2' | '1';
+number[Escape] = '1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9';
commit e8d75af547d58d4acdac3c32bcdd54f3ae7d2fbb
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Sat Dec 6 09:03:05 2025 +0100
Parse aoc 2025 day 3
diff --git a/make.sh b/make.sh
index 563845d..1299e50 100755
--- a/make.sh
+++ b/make.sh
@@ -13,6 +13,7 @@ main() {
workbench_sdl
example_aoc20251
example_aoc20252
+ example_aoc20253
}
dotall() {
@@ -76,6 +77,16 @@ example_aoc20252() {
out/rl
}
+example_aoc20253() {
+ example aoc20253
+ out/aoc20253 <src/examples/aoc20253/example.aoc20253 >out/example.c
+ c_compile out/example.c out/example
+ out/example
+ out/aoc20253 <src/examples/aoc20253/rl.aoc20253 >out/rl.c
+ c_compile out/rl.c out/rl
+ out/rl
+}
+
example() {
banner "Example: $1"
meta_compile src/examples/$1/$1.meta out/$1.c
@@ -109,6 +120,7 @@ languages() {
meta_compile src/generic.meta out/language_generic.c
meta_compile src/examples/aoc20251/aoc20251.meta out/language_aoc20251.c
meta_compile src/examples/aoc20252/aoc20252.meta out/language_aoc20252.c
+ meta_compile src/examples/aoc20253/aoc20253.meta out/language_aoc20253.c
}
banner() {
diff --git a/src/examples/aoc20253/aoc20253.meta b/src/examples/aoc20253/aoc20253.meta
new file mode 100644
index 0000000..8e91ace
--- /dev/null
+++ b/src/examples/aoc20253/aoc20253.meta
@@ -0,0 +1,13 @@
+#id = aoc20253
+
+main = bank* !. -> {
+ "int main(void) { return 0; }"
+};
+
+bank = battery* '\n';
+
+battery = high | medium | low;
+
+high[Reserved] = '9' | '8';
+medium = '4' | '5' | '6' | '7';
+low[RuleName] = '3' | '2' | '1';
diff --git a/src/examples/aoc20253/example.aoc20253 b/src/examples/aoc20253/example.aoc20253
new file mode 100644
index 0000000..7255fca
--- /dev/null
+++ b/src/examples/aoc20253/example.aoc20253
@@ -0,0 +1,4 @@
+987654321111111
+811111111111119
+234234234234278
+818181911112111
diff --git a/src/examples/aoc20253/rl.aoc20253 b/src/examples/aoc20253/rl.aoc20253
new file mode 100644
index 0000000..da1e67f
--- /dev/null
+++ b/src/examples/aoc20253/rl.aoc20253
@@ -0,0 +1,200 @@
+1122328377227565294573525668246252925164246287987784122693983869922222576473238222367725229292476776
+3439534344443341434449413434544546443313443434337243446444273233229964474333524343343263333397462332
+6446534656654345665545756845652445664554567453344355533455445732365554785365556466544424657625334454
+5764366546346565433173426656673446256755342552276356475358736554561768323235448436642626716668436552
+2432245322434343223312234234145234422422151425334232333434465223124422432123313313144223245434213122
+6373269138466626334224232272352251726573428236361362251272335335353545412626366252362443323122568732
+5673357339533533557574944447475576653565555474357764385574312376575243553954836367339357555551434444
+3232332132231233321122322231333232213233313332432312143232132213233232233243131223222222233422123252
+2532332134274262221121535425342131732342222326625224242334335132442252434322423352213461259334224487
+7565667856454556567454551653458944467437678656453544834356545556463354463263379773577656253433555445
+1376533544556457252934534268532349354424919842725952222763551835834557316545232355343561434353534372
+2523224493232433232232455126224252263322422141222233724236541332332735342832245213233463352313233144
+2125433524432544443453442442415232314454515362344343344431423442473342513223323343242354443455412243
+2223253513531336231535341344345453334337333533533361233323412322433143663333333373465253335734633327
+4222443232236314324237231323222882275222733343331312832133839321228313232237135332232232382344322422
+2531231222624224222222221242321222233212232242324222212221311445532222222224121224222222221252222524
+1282322243523323214433323343353334144321323323232732322223331131423423332423323326142343424314333343
+2233222322332112322233213222336221232222222214321225322213222122222352112222251322233152122421233222
+2133332225122552132443253453123412221223124644261212221552222235242211223223252155412122322122223222
+2342322335344224245235521242242243244442442432343445366241334834335442144222344342324144436322223252
+2255222226226744212232452222211222226644152224654642222241212623263422212222222123625471252525231222
+5253225434222243232256531212424522455213211226332242213164222254163325125452125461243424432232521451
+4288524434546485223254522441625265492255546828544443435345215657285553533178244452552176455574652293
+3235223132313212332222313343333222533331243421222333232232242221233321253222222311122211231321322323
+4123522222232222222222212221222312422443212311122224412242222422224221222222222421211512213232212222
+3322373222222242321232243243233223232232512214323122273433454631213413261244431323333233422222231333
+2436942332444453225144242332328323644174461313334813734323432222643133233737233352242843536483323424
+6623144536217362257362532276645667275225345632247317547264542717622752322512614462233614623212714313
+7643456556435262153535522356454446472226533567512621825444284454542422642342465553247415548425143345
+4232122253524333334533233324453222123233355235433223215572332412412135421543333225525442333542135342
+4323634634112252442592132533345314252129523914383352446365752563854222222135312255213224324234346522
+4353236333333443555453153222447234744855224242235222342821423544314432335143463324453212425243526253
+4534533361674341342373533433515133733463337326382435134633116532215664264731353346325231336324543442
+2441442233421553345123135143544543514414123543133232143423433134342241153555343533344332141124526789
+2212132232223312224121332321533433233231422432232322122242112121722221232232333333243232232321421332
+8276778647457225634262651262236665334746366328315345666276362545653426736648663235942674241466416645
+6757738683896779756978663273677647866865646763676539757557937794766886638666596578695866568667655479
+3235324533378448433335274942743645133375734577352715333261865358656374737284338777478232537365245343
+4544353485657685546454346442946313765454162559656661655383342671254345353453455264741766557648336668
+4264444443344473336242134323433423332343324333333254454443353213543335532443424243315435135233422373
+1432231244233483432121332254224143463222222243441213141223116223382721445238114213423233232232332221
+2222232322231222124222632512222322213212221522222322622211221322323233231312252122312222125222322125
+5366463442922353342532343315353122223432333452564936553861366438243355223456466376443429233733334342
+3333313233338514434336423444332456333438337336334342944347366333335933448363374642593526334235338432
+4222227222723244622222522625222227222591432114121271213422152232224222226451352886471215497226325622
+1111232241325222223121223534135331234513222224322152124231242425541542225512524325733232352114412425
+2223242372213783432244443234232241344257232234142233121223233244472224342214321145234135323222432222
+7222442251221342522212221263241222371222232252234532724122222223222242224126211222532342223261652272
+4123225523222243223332322233234223232323322421142343312222229252254332222231193233834232232232232342
+2455764672725285657557127457517886446383484443658853833551482862866696188528695445645864389836857824
+2335444449544244436542644344544332333444523525443443443433354544543555542346346934445434844534545545
+5456273732532761553636356321172336466215117763244762713542265616432246521176656227355141144521551389
+2333422422432424443133444224144223341444434246243346423344424236632222442323343342324426234343122243
+3232132222422262223173221122312222152213222216322222322165261222322331222222121213321311112321122223
+3336333635243464343314533547253312547553323635943356434524952334676984593636433632765833434735333295
+4466554446434343493244435644444546434456454446348134436455234534443633474446345344434349465344542534
+2283252222342324222242622432262222323242122472321325124722324133443416344232141342132222553222421221
+4733348213224614422542424524214442636434324322292112134274318423422425123232424143342426622122238342
+2547264446444453762654263745461534446445544246536154444456443634445537415555334834377456344442646345
+3234224523322112535364324435413222325212153235152232455542541542221253231224252442422424254422322212
+4434564642215554435546544343332243535432454423352834136234355653533947223444444433559353348543449567
+2252223221242232222222222222322222135222522222422222212152222212142212232121524124222322322224512122
+6635325243417345346543264825444676456234266553634661542263245335263444345423441364353444546365574427
+7244414324124342461462282831333363334223423253732522331422224422472834422742232252325332625423268222
+2522622422112622217136512442223148422522324324124421413262423456322242411142825222228223214212228222
+3542431852246554422545441526832353454624686525132255542551525344785454952341555431284422845282543531
+6456543746236666493367458482564445566646525647444144454366346513356435534382553243655846351653344585
+4223242121216152122132225135242212122223222322224214222231222243243232242222241122122221122232122545
+3666373263664638165458763666665656467334352246464434543434477354455615261454865224445241343254422436
+2545565568686975346357665466842836222436467776544436712632246471487464342898667553627255465468376526
+8222221224443333523484433432432252335423242323328434425143514452234724343465245447444244224323224222
+2231312223232323222282423422223414222223222212211122131222271221212222132322225122122322122122313322
+2351332722235622221115145344331322225322122522212322121233331363235353126542531252122234332322222632
+2222242222312422212844422121412221224224124242222252422142322325522324223312222232212212221212211423
+2422244322524332312422342135124221236423242242223232314218225183222432432232316163341254323211322422
+7932432222612262562422365343251724436522544235334252356725456232252325344141535346213432274336253556
+9517575495452463285625246622534143448544564729362945322553625244434653552723435775592696432635377248
+3285162422434542545733334242423355222835383224499473445323643214353333757362543467664433552383344345
+2624644522324533575226262424221534652968142565323566422323427228547262322561472973342542424234374363
+4252222322228122522222212224312211422343261243323222142222222223232323122231233212321322212352523231
+6333223322633614336133113463236222231322323361233153422235132233233241222221222633632232623332353323
+2434212432262232444423248513532323352132223343222235343843132342229242656331455524752215233354246225
+2821224223223233412223241321221222321222222132223132222321312242322424223132131232228221623221812221
+2522242314662335523532565226725434225254232633423425643565362345346345325359543433233622333547274127
+2142225142338322332322243224221253323412624233233424332332213311232233333332232242212321243433422222
+5457355948683856656457323863456263474356866754656654653576636656534564565268665746465622445365445614
+2221341212182232121222221241212223211232222322227222232222452221432211221422115225225322222212412223
+3333434443324362261444445643385443327443332324449763243385411335233354943533422338233545444394352393
+2433147245324334441433333313333642232142541344333123332343338463224233333342333343532434433113523383
+5214225313223233254524132672222242143113242231232312312242222244224353533113122132312212131222343213
+2651382833637664484389263776638888223726886234133422477852462545242564244982243246336763492552122385
+3447347335463643563377634477743644335336334244551444337536654736676124685542476435225623446634324664
+6798722675959385959955965473475636478285786397788537344625695675694767865289787789684444365577697799
+4342392334342333343323434242433342443444334332454368444343443444343333316224422333634353433444524243
+1132232222322423222322812312222222211132213222212222223231223222225212222222222222232122232222222242
+6777676475454474963718646644654675646848455656875566677876634666673675765957556849565967666775724657
+9937685975477776554675666685777758757636985565656687448887574884454865669765655445678158564484556665
+2233222122221222222222221222222121231221322322422242321332222222211122222122221222221122511322222222
+5343434464433254367753443233454474354443464536462244254424343346533432454253644316546443536534322563
+4231232232312222222223113211223222125212232132224222122332212223322243121332233232322123232324331322
+3323243333343232234442221332433312233222222241343232223342434132441343322223233243433115233233341142
+2261321222222222221229246925531422323635533332222333422527231332353227222133228352423224227332262223
+5555958875565589677535967847573599996477698587254577575545554589558899538785774458869568857545573977
+5214222222222222222345312246222322237247342225222235222222222242413322222322222222153223442132322472
+3243338152344243429215412527332523242224373343648344241373243332385624742434422444654442336442534422
+1222226123222152934223223122222162221222672222122222122222213232212222222235212212222322222252222222
+5854456249637745756667484452645648695565856545425335866356574555555555676868475555378293465665575479
+3245455545452243862642554833652545413524455331444434334363344434431241365343523434433554332553213535
+2654764623252226452222126726264584214222526925222565934251222228175322722323627475621432222712266228
+2211593522362319922453245223592262143135224173239127386572222172224261212222442582447253172726525722
+1292232247422327232931222122473236332229414132432322226322242422234121254245434124433749432244311222
+2376266634476255566464645552246527646527116472755384536339256364314546223561571544557837662576545225
+4256364466666844987645457666556542666665666585356953545624223376445516665425542276465756445675634233
+3331333333333342254332333333353233333532352323341332433232533353333423443433123224333923333323434533
+3133323315314232333313215512438333233223223344623343221322442854333391333223333321332325333856733144
+2232222221222352222322322222233121222123222321212223222122221323314223224325221232322222212322322242
+3223312325434422333263234122126353314612232211222412424324351423242327324333333214232432252512415321
+4324312443333412313243112123212343331122241334333241341134433343134413422313423234433431244324156789
+4243522334622415411232154541422322533823354423252322454343524624233244321332422341223121253327212442
+2634332652432675331222272824265621332859222925233323632295371137223232376222225232424762243526136227
+1262622222432222213232222211223822221322222123223331323222222236221422512212222223131233122261422232
+2894221243222512212222224123331312229212222125136523212542122321322222222342223223233231221522572623
+2743946428734154148535536567233352844848227254434468132453632673482434344253644422324567623737462358
+7475533242444354536668624624455233655454632655465453454463323345444646265533671445624652646445424353
+2142321233213322114232225223224533224241233623642342221121313233223222219423222211222313433233226332
+3434447434937346434744423322255134514526553464272334633641332232434322443445343343224644244646223345
+2226242226412127622225121242432463313111222132325122221212523113223132231321263325122122122324221112
+2243533353234655333344333313536352333333232343322335123433453333533334333352254222333354553335324334
+2242124281222122144913212222222322222242222442222322228223218223122723422121222222231225222222212521
+6333333233846425213386353453331543224231222232388343243131333732311233327753333353226142471182426927
+4835333534662133342343434444343462583311535233334453433455584323535433641444144234314733352343442243
+6536758559666357457485434644655556854996457444563433954756763433378345587465535696547957436365555476
+3311312223223242222213222223322422221322223222322112254333221212322612352313212444222252312212232233
+5235222121222231324221123333123212122212221222532262222244223423132223241423212211423323221244248244
+2323121223423223324222223322232333233232324222323122223432123232232322222333342323333433332322122223
+5153323234232342222332222226312232113233322222222132233122232211232232322132223222232322222233231332
+4445242122222412252131484252816482332322212742325664246322226222235222222726222422222723148172562332
+5313353552552441443332334323344544346525363544533433453334332452543645345333333145125333435532535545
+2253325121232521322235332544212312312334233333613533544262125333433323242334312213353412313224335323
+3442455225824322325483215225328113822323363525253546424414346444685422225156364832522575532426362223
+1221232215252242322241122222322122232222222232222222221222222312222122524222222322225224232221142222
+1434411514222231342462123235465455646133223251262356536544253133563344423361124424434443451651453789
+5421333333154443254642523234545223143421434524543454242744542212333743422434244174422545424435324354
+2422225221321523422522321223422222221282132222421214132232224212127424222332352213214233722312221224
+8353366333623336363313332333668463335533335157633543646363234266534224738445635343936313336233333233
+4322313323734333233333133324332223361223333223333643133333152343333233334332222431433334232332342333
+4433555432513464345746344453554444945533345446356524754433455232462436463458454945555522134644345462
+1113322363222143322232422212222212112222233722231223321222234222322213321222262213432332223223222322
+4222333453325447341444442235423245335414424246724344234442633222442244424342345526444334443433343311
+2132392234222424334346324322232414433224332241443234442222422333423412332323524464444342261235341532
+2112332342532272232223275313233436223321233437135331262264123523352223532764132713226233262613423352
+4322222423721333283242323831364445738311334244633453347343472243237432374552234437223243212124322625
+1242468252334224755152335722155522422413313344554714234126324454626564243715252472212245243814274254
+7288471218123876835345677886537524525236527146666547752676112542531773366423574584288157326835587569
+7873669783877895986988965879478566639655779488956895968166899989557765975793814875581995987549987493
+1334334411325223943913344532323253464273222224622231241226241385242422514224312467644744674332264744
+1435222224242252225222521223522262223246265253223153233312525272222325424212513524222225183226643257
+3333332333333333333333333233323332333733313223313322432333323553322223334326334383334373323433423332
+2434222434342632322321224344227322233222451243242242322331322422422424223452222341223222524244223224
+2334113333222224331331421225323232452662862632333236231524234433234233233432434234343532393232233332
+4134224234542424342343312344334323334322342434444643233924434333338222243241442324422333425544423233
+3565636644445546545564766358556624446435646236664567636346646356364654647675612752316533743545346563
+2122232321222232134122222263434222142312323322211322222512231121221821122222131125232242232232342322
+5375425527762434248677433758261823212541262432573347762373434443753131295314323323425336274272313675
+3222222222222222246212321331121322212122262252122223122222121222232222222221223222222212222222533232
+2142432532411353333545333513346433433533244333233326433433333566331333335445333143333333323363373533
+3333334214223333334343323343323453434333333333333244343343443343233333334344524233313337434333432322
+2232432224433433313385333321323345333333333223243243334333332252323333233212223342433323353333233223
+3234337223322314472232212314143623424244223434234133321222215136433234223221321442432422424334222224
+4422625214416262624221172625722223459222256245232634254242434722522128225323225713135335221224222111
+1332233222222352233332151322322233222222321233324232332132222233133625322222222323143225333424413222
+1212221233434411242222222232342272261362231222122213233211242123448423412622121212224222245232221231
+5299239242432267722312144753524325235544143326621526223357993233413345372525642521566214321229314226
+4145815259445253437345286245352965222465396946455525666535157576493246439135482348345259474534214895
+4359454935483443642555444253332646423565846452265442345833574549442746543574436733264526894364357572
+4455362612251424257347533535244543123224216453411496584314352529524942421253415255562112225354222522
+1442232342433253322444534281432832532221672244522533352331353433357344632533273418434294521434522442
+4222222215222314232121254322233232222223122634122452442325321222225215221262211462212251222122432225
+5433343433354336555313334535433334646344314443334434323324433351432333233343343453434443354755443144
+7455735614556556475541373865756554446747474542632733338546537454714443436561535533325555442337664366
+3344244343421362432233243522354253434334144424341223843414452442242233253333415322242242421421222344
+6566496645534446467563655546666284568446568656566488652487754568586356364667666343653435344856634686
+3144742294362343433433444152533433333354533454223125636323643244343342222413333242523375333224753333
+3221523222332442343532222237412235442452325221435232234441525512343524244632563143252254222455154221
+3224327652164274373434256367436252531482365553771428333238873236774688169262541264643619643249432147
+4884532535643454176544345559146393647314561543235243325754646564452432255522565243562352226356533255
+2311434244645331433437443324222242222346543444433231311844443214411344612234346424445322444644242422
+2162123222225122221111123222322122322233422452224412222322421212222421237222222225232132222231522142
+4634423245446733424454237456446454376514876546452544686573653263546426444252424446345435263643465462
+3333433236833532333323333332633353333373964224333234334234434235324533133333366333323333233443527332
+2213222322242112532233111222211252231251222334273212372255322233222322521253222127321321121222351322
+3333531243833462333332223231353333233423323335442148233323423433334223232432341332332113321733223323
+1253222412232122142223322252221331232333213442223222222322329232133533222333322223233421612131455332
+2126352214354453312222742413223131233982433261445213341234522712243224286251232222322412242832421233
+6755646362147242536753172684353487842555958732547755226562634346554123245448573341747273467855165235
+2222212222222722222322211223233322242232221125222151222152123226222164222523412311242122125222222212
+3335321234234455143444233435223252532335334336334245233424223444352465523413253533334644323424424432
+3343742454932436532444334343432433343532443425428234452394453474344344383332325454346344412541474253
+2474477763936979663333346343374443344643635572649454475855374386394583444346862733437379465433493339
+3289373373182327263634375433233261632333632233239373343722362254522232326722313742223237132632342532
diff --git a/src/language.c b/src/language.c
index fcfba64..9d16d75 100644
--- a/src/language.c
+++ b/src/language.c
@@ -3,6 +3,7 @@
#include "language_c.c"
#include "language_aoc20251.c"
#include "language_aoc20252.c"
+#include "language_aoc20253.c"
#include "language_generic.c"
typedef enum languages {
@@ -10,6 +11,7 @@ typedef enum languages {
Language_C,
Language_AOC20251,
Language_AOC20252,
+ Language_AOC20253,
Language_Generic
} Language;
@@ -18,6 +20,7 @@ Language language_from_string(String name) {
if (string_eqc(name, "c")) { return Language_C; }
if (string_eqc(name, "aoc20251")) { return Language_AOC20251; }
if (string_eqc(name, "aoc20252")) { return Language_AOC20252; }
+ if (string_eqc(name, "aoc20253")) { return Language_AOC20253; }
return Language_Generic;
}
@@ -26,5 +29,6 @@ static MetaParseFunction LANGUAGE_HIGHLIGHERS[] = {
language_c_rule_main,
language_aoc20251_rule_main,
language_aoc20252_rule_main,
+ language_aoc20253_rule_main,
language_generic_rule_main,
};
commit 77045b0e6f9e794dd457a7927f7c81563aefe416
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Fri Dec 5 15:14:33 2025 +0100
Clean up
diff --git a/src/examples/aoc20252/aoc20252.meta b/src/examples/aoc20252/aoc20252.meta
index d6df777..8df157d 100644
--- a/src/examples/aoc20252/aoc20252.meta
+++ b/src/examples/aoc20252/aoc20252.meta
@@ -37,8 +37,7 @@ main = range*:xs !. -> {
"int is_invalid1(Number value) {\n" >
"char buffer[100];\n"
"size_t buffer_len = sprintf(buffer, \"%ld\", value);\n"
- "return buffer_len % 2 == 0 && repeats(buffer, buffer_len/2, buffer_len);\n"
- "return repeats(buffer, buffer_len/2, buffer_len);\n"
+ "return buffer_len % 2 == 0 && eq(buffer, buffer+buffer_len/2, buffer_len/2);\n"
< "}\n"
"int is_invalid2(Number value) {\n" >
"char buffer[100];\n"
commit 3c30146567d34d95727b01f4682bc38ad6e94c2b
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Fri Dec 5 15:06:04 2025 +0100
Clean up
diff --git a/src/examples/aoc20252/aoc20252.meta b/src/examples/aoc20252/aoc20252.meta
index 2811280..d6df777 100644
--- a/src/examples/aoc20252/aoc20252.meta
+++ b/src/examples/aoc20252/aoc20252.meta
@@ -22,13 +22,13 @@ main = range*:xs !. -> {
< "}\n"
"return 1;\n"
< "}\n"
- "int repeats(char* buffer, int size, int len) {\n" >
+ "int repeats(char* buffer, int repeat_size, int buffer_len) {\n" >
"int i;\n"
- "if (size == 0 || len % size != 0) {\n" >
+ "if (repeat_size == 0 || buffer_len % repeat_size != 0) {\n" >
"return 0;\n"
< "}\n"
- "for (i=1; i<len/size; i++) {\n" >
- "if (!eq(buffer, buffer+i*size, size)) {\n" >
+ "for (i=1; i<buffer_len/repeat_size; i++) {\n" >
+ "if (!eq(buffer, buffer+i*repeat_size, repeat_size)) {\n" >
"return 0;\n"
< "}\n"
< "}\n"
@@ -36,16 +36,16 @@ main = range*:xs !. -> {
< "}\n"
"int is_invalid1(Number value) {\n" >
"char buffer[100];\n"
- "size_t len = sprintf(buffer, \"%ld\", value);\n"
- "return repeats(buffer, len/2, len);\n"
- "return len % 2 == 0 && repeats(buffer, len/2, len);\n"
+ "size_t buffer_len = sprintf(buffer, \"%ld\", value);\n"
+ "return buffer_len % 2 == 0 && repeats(buffer, buffer_len/2, buffer_len);\n"
+ "return repeats(buffer, buffer_len/2, buffer_len);\n"
< "}\n"
"int is_invalid2(Number value) {\n" >
"char buffer[100];\n"
- "size_t len = sprintf(buffer, \"%ld\", value);\n"
- "int i;\n"
- "for (i=1; i<=len/2; i++) {\n" >
- "if (repeats(buffer, i, len)) {\n" >
+ "size_t buffer_len = sprintf(buffer, \"%ld\", value);\n"
+ "int repeat_size;\n"
+ "for (repeat_size=1; repeat_size<=buffer_len/2; repeat_size++) {\n" >
+ "if (repeats(buffer, repeat_size, buffer_len)) {\n" >
"return 1;\n"
< "}\n"
< "}\n"
commit c6ac8b6ea07170110649f4decc75db29b82d3a3c
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Fri Dec 5 14:54:16 2025 +0100
Clean up
diff --git a/src/examples/aoc20252/aoc20252.meta b/src/examples/aoc20252/aoc20252.meta
index 576b672..2811280 100644
--- a/src/examples/aoc20252/aoc20252.meta
+++ b/src/examples/aoc20252/aoc20252.meta
@@ -24,7 +24,7 @@ main = range*:xs !. -> {
< "}\n"
"int repeats(char* buffer, int size, int len) {\n" >
"int i;\n"
- "if (len % size != 0) {\n" >
+ "if (size == 0 || len % size != 0) {\n" >
"return 0;\n"
< "}\n"
"for (i=1; i<len/size; i++) {\n" >
@@ -37,7 +37,8 @@ main = range*:xs !. -> {
"int is_invalid1(Number value) {\n" >
"char buffer[100];\n"
"size_t len = sprintf(buffer, \"%ld\", value);\n"
- "return len % 2 == 0 && eq(buffer, buffer+len/2, len/2);\n"
+ "return repeats(buffer, len/2, len);\n"
+ "return len % 2 == 0 && repeats(buffer, len/2, len);\n"
< "}\n"
"int is_invalid2(Number value) {\n" >
"char buffer[100];\n"
commit ccba3093ffeef8ec8d49b00746527005c81627a9
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Fri Dec 5 14:46:50 2025 +0100
Clean up
diff --git a/src/examples/aoc20252/aoc20252.meta b/src/examples/aoc20252/aoc20252.meta
index 3d0e9ca..576b672 100644
--- a/src/examples/aoc20252/aoc20252.meta
+++ b/src/examples/aoc20252/aoc20252.meta
@@ -19,26 +19,26 @@ main = range*:xs !. -> {
"one++;\n"
"two++;\n"
"len--;\n"
- < "};\n"
+ < "}\n"
"return 1;\n"
< "}\n"
- "int is_invalid1(Number value) {\n" >
- "char buffer[100];\n"
- "size_t len = sprintf(buffer, \"%ld\", value);\n"
- "return len % 2 == 0 && eq(buffer, buffer+len/2, len/2);\n"
- < "}\n"
"int repeats(char* buffer, int size, int len) {\n" >
"int i;\n"
"if (len % size != 0) {\n" >
"return 0;\n"
< "}\n"
- "for (i=0; i<len/size; i++) {\n" >
+ "for (i=1; i<len/size; i++) {\n" >
"if (!eq(buffer, buffer+i*size, size)) {\n" >
"return 0;\n"
< "}\n"
< "}\n"
"return 1;\n"
< "}\n"
+ "int is_invalid1(Number value) {\n" >
+ "char buffer[100];\n"
+ "size_t len = sprintf(buffer, \"%ld\", value);\n"
+ "return len % 2 == 0 && eq(buffer, buffer+len/2, len/2);\n"
+ < "}\n"
"int is_invalid2(Number value) {\n" >
"char buffer[100];\n"
"size_t len = sprintf(buffer, \"%ld\", value);\n"
@@ -53,15 +53,15 @@ main = range*:xs !. -> {
"int main(void) {\n" >
"Number invalid_ids1_sum = 0;\n"
"Number invalid_ids2_sum = 0;\n"
- "Number i;\n"
- "Number j;\n"
- "for (i=0; i<ranges_count; i++) {\n" >
- "for (j=ranges[i].lower; j<=ranges[i].upper; j++) {\n" >
- "if (is_invalid1(j)) {\n" >
- "invalid_ids1_sum += j;\n"
+ "Number range_index;\n"
+ "Number id;\n"
+ "for (range_index=0; range_index<ranges_count; range_index++) {\n" >
+ "for (id=ranges[range_index].lower; id<=ranges[range_index].upper; id++) {\n" >
+ "if (is_invalid1(id)) {\n" >
+ "invalid_ids1_sum += id;\n"
< "}\n"
- "if (is_invalid2(j)) {\n" >
- "invalid_ids2_sum += j;\n"
+ "if (is_invalid2(id)) {\n" >
+ "invalid_ids2_sum += id;\n"
< "}\n"
< "}\n"
< "}\n"
commit 4521e5a6ad1aeb1505dbcf5b46e59e62d7d3a0d8
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Fri Dec 5 14:39:18 2025 +0100
Day 2 part 2
diff --git a/src/examples/aoc20252/aoc20252.meta b/src/examples/aoc20252/aoc20252.meta
index 2154736..3d0e9ca 100644
--- a/src/examples/aoc20252/aoc20252.meta
+++ b/src/examples/aoc20252/aoc20252.meta
@@ -27,7 +27,27 @@ main = range*:xs !. -> {
"size_t len = sprintf(buffer, \"%ld\", value);\n"
"return len % 2 == 0 && eq(buffer, buffer+len/2, len/2);\n"
< "}\n"
+ "int repeats(char* buffer, int size, int len) {\n" >
+ "int i;\n"
+ "if (len % size != 0) {\n" >
+ "return 0;\n"
+ < "}\n"
+ "for (i=0; i<len/size; i++) {\n" >
+ "if (!eq(buffer, buffer+i*size, size)) {\n" >
+ "return 0;\n"
+ < "}\n"
+ < "}\n"
+ "return 1;\n"
+ < "}\n"
"int is_invalid2(Number value) {\n" >
+ "char buffer[100];\n"
+ "size_t len = sprintf(buffer, \"%ld\", value);\n"
+ "int i;\n"
+ "for (i=1; i<=len/2; i++) {\n" >
+ "if (repeats(buffer, i, len)) {\n" >
+ "return 1;\n"
+ < "}\n"
+ < "}\n"
"return 0;\n"
< "}\n"
"int main(void) {\n" >
commit dc6c98b8ea9f3fdae0e9db2e6918acfc32c69eda
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Fri Dec 5 08:12:43 2025 +0100
Prepare for part 2
diff --git a/src/examples/aoc20252/aoc20252.meta b/src/examples/aoc20252/aoc20252.meta
index 48419f8..2154736 100644
--- a/src/examples/aoc20252/aoc20252.meta
+++ b/src/examples/aoc20252/aoc20252.meta
@@ -22,23 +22,31 @@ main = range*:xs !. -> {
< "};\n"
"return 1;\n"
< "}\n"
- "int is_invalid(Number value) {\n" >
+ "int is_invalid1(Number value) {\n" >
"char buffer[100];\n"
"size_t len = sprintf(buffer, \"%ld\", value);\n"
"return len % 2 == 0 && eq(buffer, buffer+len/2, len/2);\n"
< "}\n"
+ "int is_invalid2(Number value) {\n" >
+ "return 0;\n"
+ < "}\n"
"int main(void) {\n" >
- "Number invalid_ids_sum = 0;\n"
+ "Number invalid_ids1_sum = 0;\n"
+ "Number invalid_ids2_sum = 0;\n"
"Number i;\n"
"Number j;\n"
"for (i=0; i<ranges_count; i++) {\n" >
"for (j=ranges[i].lower; j<=ranges[i].upper; j++) {\n" >
- "if (is_invalid(j)) {\n" >
- "invalid_ids_sum += j;\n"
+ "if (is_invalid1(j)) {\n" >
+ "invalid_ids1_sum += j;\n"
+ < "}\n"
+ "if (is_invalid2(j)) {\n" >
+ "invalid_ids2_sum += j;\n"
< "}\n"
< "}\n"
< "}\n"
- "printf(\"Part 1: %ld\\n\", invalid_ids_sum);\n"
+ "printf(\"Part 1: %ld\\n\", invalid_ids1_sum);\n"
+ "printf(\"Part 2: %ld\\n\", invalid_ids2_sum);\n"
"return 0;\n"
< "}\n"
};
commit eea27cc3e6e6e56047d749bb17414c146657b30a
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Fri Dec 5 08:09:36 2025 +0100
Clean up
diff --git a/src/examples/aoc20252/aoc20252.meta b/src/examples/aoc20252/aoc20252.meta
index 04ce081..48419f8 100644
--- a/src/examples/aoc20252/aoc20252.meta
+++ b/src/examples/aoc20252/aoc20252.meta
@@ -2,14 +2,15 @@
main = range*:xs !. -> {
"#include <stdio.h>\n"
+ "typedef unsigned long int Number;\n"
"typedef struct {\n" >
- "unsigned long int lower;\n"
- "unsigned long int upper;\n"
+ "Number lower;\n"
+ "Number upper;\n"
< "} Range;\n"
"static Range ranges[] = {\n" >
xs
< "};\n"
- "static unsigned long int ranges_count = " xs.count ";\n"
+ "static Number ranges_count = " xs.count ";\n"
"int eq(char* one, char* two, size_t len) {\n" >
"while (len > 0) {\n" >
"if (*one != *two) {\n" >
@@ -21,16 +22,15 @@ main = range*:xs !. -> {
< "};\n"
"return 1;\n"
< "}\n"
- "int is_invalid(unsigned long int value) {\n" >
+ "int is_invalid(Number value) {\n" >
"char buffer[100];\n"
"size_t len = sprintf(buffer, \"%ld\", value);\n"
"return len % 2 == 0 && eq(buffer, buffer+len/2, len/2);\n"
- "return 0;\n"
< "}\n"
"int main(void) {\n" >
- "unsigned long int invalid_ids_sum = 0;\n"
- "unsigned long int i;\n"
- "unsigned long int j;\n"
+ "Number invalid_ids_sum = 0;\n"
+ "Number i;\n"
+ "Number j;\n"
"for (i=0; i<ranges_count; i++) {\n" >
"for (j=ranges[i].lower; j<=ranges[i].upper; j++) {\n" >
"if (is_invalid(j)) {\n" >
commit e2609758dd4d5ffed508453db26906e643a96853
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Fri Dec 5 08:03:22 2025 +0100
Adevent of Code 2025 day 2, part 1
diff --git a/make.sh b/make.sh
index ce1aff5..563845d 100755
--- a/make.sh
+++ b/make.sh
@@ -12,6 +12,7 @@ main() {
dotall
workbench_sdl
example_aoc20251
+ example_aoc20252
}
dotall() {
@@ -65,6 +66,16 @@ example_aoc20251() {
out/rl
}
+example_aoc20252() {
+ example aoc20252
+ out/aoc20252 <src/examples/aoc20252/example.aoc20252 >out/example.c
+ c_compile out/example.c out/example
+ out/example
+ out/aoc20252 <src/examples/aoc20252/rl.aoc20252 >out/rl.c
+ c_compile out/rl.c out/rl
+ out/rl
+}
+
example() {
banner "Example: $1"
meta_compile src/examples/$1/$1.meta out/$1.c
@@ -97,6 +108,7 @@ languages() {
meta_compile src/c.meta out/language_c.c
meta_compile src/generic.meta out/language_generic.c
meta_compile src/examples/aoc20251/aoc20251.meta out/language_aoc20251.c
+ meta_compile src/examples/aoc20252/aoc20252.meta out/language_aoc20252.c
}
banner() {
diff --git a/src/examples/aoc20252/aoc20252.meta b/src/examples/aoc20252/aoc20252.meta
new file mode 100644
index 0000000..04ce081
--- /dev/null
+++ b/src/examples/aoc20252/aoc20252.meta
@@ -0,0 +1,56 @@
+#id = aoc20252
+
+main = range*:xs !. -> {
+ "#include <stdio.h>\n"
+ "typedef struct {\n" >
+ "unsigned long int lower;\n"
+ "unsigned long int upper;\n"
+ < "} Range;\n"
+ "static Range ranges[] = {\n" >
+ xs
+ < "};\n"
+ "static unsigned long int ranges_count = " xs.count ";\n"
+ "int eq(char* one, char* two, size_t len) {\n" >
+ "while (len > 0) {\n" >
+ "if (*one != *two) {\n" >
+ "return 0;\n"
+ < "};\n"
+ "one++;\n"
+ "two++;\n"
+ "len--;\n"
+ < "};\n"
+ "return 1;\n"
+ < "}\n"
+ "int is_invalid(unsigned long int value) {\n" >
+ "char buffer[100];\n"
+ "size_t len = sprintf(buffer, \"%ld\", value);\n"
+ "return len % 2 == 0 && eq(buffer, buffer+len/2, len/2);\n"
+ "return 0;\n"
+ < "}\n"
+ "int main(void) {\n" >
+ "unsigned long int invalid_ids_sum = 0;\n"
+ "unsigned long int i;\n"
+ "unsigned long int j;\n"
+ "for (i=0; i<ranges_count; i++) {\n" >
+ "for (j=ranges[i].lower; j<=ranges[i].upper; j++) {\n" >
+ "if (is_invalid(j)) {\n" >
+ "invalid_ids_sum += j;\n"
+ < "}\n"
+ < "}\n"
+ < "}\n"
+ "printf(\"Part 1: %ld\\n\", invalid_ids_sum);\n"
+ "return 0;\n"
+ < "}\n"
+};
+
+range = lower:x '-' upper:y space* -> { "{" x ", " y "},\n" };
+
+lower[Reserved] = number;
+
+upper[RuleName] = number;
+
+number = digit digit*;
+
+digit = '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9';
+
+space = ',' | '\n';
diff --git a/src/examples/aoc20252/example.aoc20252 b/src/examples/aoc20252/example.aoc20252
new file mode 100644
index 0000000..a3f22ef
--- /dev/null
+++ b/src/examples/aoc20252/example.aoc20252
@@ -0,0 +1 @@
+11-22,95-115,998-1012,1188511880-1188511890,222220-222224,1698522-1698528,446443-446449,38593856-38593862,565653-565659,824824821-824824827,2121212118-2121212124
diff --git a/src/examples/aoc20252/rl.aoc20252 b/src/examples/aoc20252/rl.aoc20252
new file mode 100644
index 0000000..43cb5d0
--- /dev/null
+++ b/src/examples/aoc20252/rl.aoc20252
@@ -0,0 +1,2 @@
+132454-182049,42382932-42449104,685933-804865,5330496-5488118,21-41,289741-376488,220191-245907,49-70,6438484-6636872,2-20,6666660113-6666682086,173-267,59559721-59667224,307-390,2672163-2807721,658272-674230,485679-647207,429-552,72678302-72815786,881990-991937,73-111,416063-479542,596-934,32825-52204,97951700-98000873,18335-27985,70203-100692,8470-11844,3687495840-3687599608,4861-8174,67476003-67593626,2492-4717,1442-2129,102962-121710,628612213-628649371,1064602-1138912
+
diff --git a/src/language.c b/src/language.c
index dab442c..fcfba64 100644
--- a/src/language.c
+++ b/src/language.c
@@ -2,12 +2,14 @@
#include "language_meta.c"
#include "language_c.c"
#include "language_aoc20251.c"
+#include "language_aoc20252.c"
#include "language_generic.c"
typedef enum languages {
Language_Meta,
Language_C,
Language_AOC20251,
+ Language_AOC20252,
Language_Generic
} Language;
@@ -15,6 +17,7 @@ Language language_from_string(String name) {
if (string_eqc(name, "meta")) { return Language_Meta; }
if (string_eqc(name, "c")) { return Language_C; }
if (string_eqc(name, "aoc20251")) { return Language_AOC20251; }
+ if (string_eqc(name, "aoc20252")) { return Language_AOC20252; }
return Language_Generic;
}
@@ -22,5 +25,6 @@ static MetaParseFunction LANGUAGE_HIGHLIGHERS[] = {
language_meta_rule_main,
language_c_rule_main,
language_aoc20251_rule_main,
+ language_aoc20252_rule_main,
language_generic_rule_main,
};
commit d23c2be1e11e3a8b34bb6209da0e8f054879b652
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Thu Dec 4 22:07:00 2025 +0100
Clean up
diff --git a/src/examples/aoc20251/aoc20251.meta b/src/examples/aoc20251/aoc20251.meta
index 221d715..c8be432 100644
--- a/src/examples/aoc20251/aoc20251.meta
+++ b/src/examples/aoc20251/aoc20251.meta
@@ -27,10 +27,10 @@ main = instruction*:xs !. -> {
"times_at_zero += 1;\n"
< "}\n"
< "}\n"
- "times_at_zero += turns[turn_index].complete;\n"
"if (dial_position == 0) {\n" >
"times_ended_at_zero += 1;\n"
< "}\n"
+ "times_at_zero += turns[turn_index].complete;\n"
< "}\n"
"printf(\"Part 1: %d\\n\", times_ended_at_zero);\n"
"printf(\"Part 2: %d\\n\", times_at_zero);\n"
commit 471a8926989c8d2344114ed60d06731ecc3332a5
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Thu Dec 4 21:54:25 2025 +0100
Solve day 1 part 2 and clean up
diff --git a/src/examples/aoc20251/aoc20251.meta b/src/examples/aoc20251/aoc20251.meta
index b3bb9ef..221d715 100644
--- a/src/examples/aoc20251/aoc20251.meta
+++ b/src/examples/aoc20251/aoc20251.meta
@@ -1,41 +1,54 @@
#id = aoc20251
main = instruction*:xs !. -> {
+ $dialSize
+ >dialSize { "100" }
"#include <stdio.h>\n"
+ "typedef struct {\n" >
+ "unsigned int positive_offset;\n"
+ "unsigned int partial;\n"
+ "unsigned int complete;\n"
+ < "} Turn;\n"
+ "static Turn turns[] = {\n" >
+ xs
+ < "};\n"
+ "static unsigned int number_of_turns = " xs.count ";\n"
"int main(void) {\n" >
"unsigned int dial_position = 50;\n"
- "unsigned int zero_count = 0;\n"
+ "unsigned int times_ended_at_zero = 0;\n"
"unsigned int times_at_zero = 0;\n"
- xs
- "printf(\"Part 1: %d\\n\", zero_count);\n"
+ "unsigned int turn_index;\n"
+ "unsigned int partial_counter;\n"
+ "for(turn_index=0; turn_index<number_of_turns; turn_index++) {\n" >
+ "for(partial_counter=0; partial_counter<turns[turn_index].partial; partial_counter++) {\n" >
+ "dial_position += turns[turn_index].positive_offset;\n"
+ "dial_position %= " <dialSize ";\n"
+ "if (dial_position == 0) {\n" >
+ "times_at_zero += 1;\n"
+ < "}\n"
+ < "}\n"
+ "times_at_zero += turns[turn_index].complete;\n"
+ "if (dial_position == 0) {\n" >
+ "times_ended_at_zero += 1;\n"
+ < "}\n"
+ < "}\n"
+ "printf(\"Part 1: %d\\n\", times_ended_at_zero);\n"
"printf(\"Part 2: %d\\n\", times_at_zero);\n"
"return 0;\n"
< "}\n"
};
-instruction = turn:x -> {
- x
- "dial_position %= 100;\n"
- "if (dial_position == 0) {\n" >
- "zero_count++;\n"
- < "}\n"
-};
-
-turn =
+instruction =
| left:x -> { x }
| right:x -> { x }
;
left[Reserved] = 'L' number:x '\n' -> {
- "if ((" x " % 100) > dial_position) {\n" >
- "dial_position += 100 - (" x " % 100);\n"
- < "} else {\n" >
- "dial_position -= (" x " % 100);\n"
- < "}\n"
+ "{" <dialSize "-1, " x "%" <dialSize ", " x "/" <dialSize "},\n"
};
right[RuleName] = 'R' number:x '\n' -> {
- "dial_position += " x ";\n"
+ "{1, " x "%" <dialSize ", " x "/" <dialSize "},\n"
};
number = digit digit*;
commit 281e85860145e039e96c18162963a49b9c76c2b2
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Tue Dec 2 21:39:59 2025 +0100
Prepare for part 2
diff --git a/src/examples/aoc20251/aoc20251.meta b/src/examples/aoc20251/aoc20251.meta
index 715a52e..b3bb9ef 100644
--- a/src/examples/aoc20251/aoc20251.meta
+++ b/src/examples/aoc20251/aoc20251.meta
@@ -2,14 +2,13 @@
main = instruction*:xs !. -> {
"#include <stdio.h>\n"
- "unsigned int part1() {\n" >
+ "int main(void) {\n" >
"unsigned int dial_position = 50;\n"
"unsigned int zero_count = 0;\n"
+ "unsigned int times_at_zero = 0;\n"
xs
- "return zero_count;\n"
- < "}\n"
- "int main(void) {;\n" >
- "printf(\"Part 1: %d\\n\", part1());\n"
+ "printf(\"Part 1: %d\\n\", zero_count);\n"
+ "printf(\"Part 2: %d\\n\", times_at_zero);\n"
"return 0;\n"
< "}\n"
};
commit 30179a70589c63f18b07c1904e1a6d3fdebe95c5
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Tue Dec 2 21:10:22 2025 +0100
Run aoc20251 example last
diff --git a/make.sh b/make.sh
index beab6bd..ce1aff5 100755
--- a/make.sh
+++ b/make.sh
@@ -11,6 +11,7 @@ main() {
examples
dotall
workbench_sdl
+ example_aoc20251
}
dotall() {
@@ -52,6 +53,9 @@ examples() {
test_example computerenhance_decoder listing_0038_many_register_mov listing_0038_many_register_mov.asm
test_example computerenhance_decoder listing_0039_more_movs listing_0039_more_movs.asm
test_example computerenhance_decoder listing_0041_add_sub_cmp_jnz listing_0041_add_sub_cmp_jnz.asm
+}
+
+example_aoc20251() {
example aoc20251
out/aoc20251 <src/examples/aoc20251/example.aoc20251 >out/example.c
c_compile out/example.c out/example
commit 8041e78ab8fefe6c588162e6293d48d5a81635a8
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Tue Dec 2 21:09:19 2025 +0100
Generate more C code (no longer loop in C)
diff --git a/src/examples/aoc20251/aoc20251.meta b/src/examples/aoc20251/aoc20251.meta
index 2183985..715a52e 100644
--- a/src/examples/aoc20251/aoc20251.meta
+++ b/src/examples/aoc20251/aoc20251.meta
@@ -2,21 +2,10 @@
main = instruction*:xs !. -> {
"#include <stdio.h>\n"
- "static int turns[] = {\n" >
- xs
- < "};\n"
- "static int number_of_turns = " xs.count ";\n"
"unsigned int part1() {\n" >
- "unsigned int i;\n"
- "int dial_position = 50;\n"
+ "unsigned int dial_position = 50;\n"
"unsigned int zero_count = 0;\n"
- "for (i=0; i<number_of_turns; i++) {\n" >
- "dial_position += turns[i];\n"
- "dial_position %= 100;\n"
- "if (dial_position == 0) {\n" >
- "zero_count++;\n"
- < "}\n"
- < "}\n"
+ xs
"return zero_count;\n"
< "}\n"
"int main(void) {;\n" >
@@ -25,14 +14,30 @@ main = instruction*:xs !. -> {
< "}\n"
};
-instruction =
- | left:x -> { x ",\n" }
- | right:x -> { x ",\n" }
+instruction = turn:x -> {
+ x
+ "dial_position %= 100;\n"
+ "if (dial_position == 0) {\n" >
+ "zero_count++;\n"
+ < "}\n"
+};
+
+turn =
+ | left:x -> { x }
+ | right:x -> { x }
;
-left[Reserved] = 'L' number:x '\n' -> { "-" x };
+left[Reserved] = 'L' number:x '\n' -> {
+ "if ((" x " % 100) > dial_position) {\n" >
+ "dial_position += 100 - (" x " % 100);\n"
+ < "} else {\n" >
+ "dial_position -= (" x " % 100);\n"
+ < "}\n"
+};
-right[RuleName] = 'R' number:x '\n' -> { x };
+right[RuleName] = 'R' number:x '\n' -> {
+ "dial_position += " x ";\n"
+};
number = digit digit*;
diff --git a/src/examples/aoc20251/example.aoc20251 b/src/examples/aoc20251/example.aoc20251
index 679758f..53287c7 100644
--- a/src/examples/aoc20251/example.aoc20251
+++ b/src/examples/aoc20251/example.aoc20251
@@ -1,3 +1,10 @@
-L50
-L50
-L50
+L68
+L30
+R48
+L5
+R60
+L55
+L1
+L99
+R14
+L82
commit 6c7333dfbc8fd6f9def52a4dd81f4be45940f7b8
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Tue Dec 2 20:44:41 2025 +0100
Remove leftover file
diff --git a/src/aoc20251.meta b/src/aoc20251.meta
deleted file mode 100644
index fc2de4c..0000000
--- a/src/aoc20251.meta
+++ /dev/null
@@ -1,21 +0,0 @@
-#id = aoc20251
-
-main = instruction*:xs !. -> {
- "static int numbers[] = {\n" >
- xs
- < "}\n"
- "static int numbers_size = " xs.count ";\n"
-};
-
-instruction =
- | left:x -> { x "," }
- | right:x -> { x "," }
- ;
-
-left[Reserved] = 'L' number:x '\n' -> { "-" x };
-
-right[RuleName] = 'R' number:x '\n' -> { x };
-
-number = digit digit*;
-
-digit = '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9';
commit 5fe3f9ecea3c971a4a2b04dcc269a15152d35ab7
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Mon Dec 1 21:50:15 2025 +0100
Better name
diff --git a/src/examples/aoc20251/aoc20251.meta b/src/examples/aoc20251/aoc20251.meta
index f2c1bb4..2183985 100644
--- a/src/examples/aoc20251/aoc20251.meta
+++ b/src/examples/aoc20251/aoc20251.meta
@@ -2,16 +2,16 @@
main = instruction*:xs !. -> {
"#include <stdio.h>\n"
- "static int numbers[] = {\n" >
+ "static int turns[] = {\n" >
xs
< "};\n"
- "static int numbers_size = " xs.count ";\n"
+ "static int number_of_turns = " xs.count ";\n"
"unsigned int part1() {\n" >
"unsigned int i;\n"
"int dial_position = 50;\n"
"unsigned int zero_count = 0;\n"
- "for (i=0; i<numbers_size; i++) {\n" >
- "dial_position += numbers[i];\n"
+ "for (i=0; i<number_of_turns; i++) {\n" >
+ "dial_position += turns[i];\n"
"dial_position %= 100;\n"
"if (dial_position == 0) {\n" >
"zero_count++;\n"
commit 149befb4c9629cf9e1275b52f5bfa5b871197822
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date: Mon Dec 1 21:34:51 2025 +0100
AoC 2025, day 1, part 1
diff --git a/make.sh b/make.sh
index 181bf8c..beab6bd 100755
--- a/make.sh
+++ b/make.sh
@@ -52,6 +52,13 @@ examples() {
test_example computerenhance_decoder listing_0038_many_register_mov listing_0038_many_register_mov.asm
test_example computerenhance_decoder listing_0039_more_movs listing_0039_more_movs.asm
test_example computerenhance_decoder listing_0041_add_sub_cmp_jnz listing_0041_add_sub_cmp_jnz.asm
+ example aoc20251
+ out/aoc20251 <src/examples/aoc20251/example.aoc20251 >out/example.c
+ c_compile out/example.c out/example
+ out/example
+ out/aoc20251 <src/examples/aoc20251/rl.aoc20251 >out/rl.c
+ c_compile out/rl.c out/rl
+ out/rl
}
example() {
@@ -85,6 +92,7 @@ languages() {
banner "Languages"
meta_compile src/c.meta out/language_c.c
meta_compile src/generic.meta out/language_generic.c
+ meta_compile src/examples/aoc20251/aoc20251.meta out/language_aoc20251.c
}
banner() {
diff --git a/src/aoc20251.meta b/src/aoc20251.meta
new file mode 100644
index 0000000..fc2de4c
--- /dev/null
+++ b/src/aoc20251.meta
@@ -0,0 +1,21 @@
+#id = aoc20251
+
+main = instruction*:xs !. -> {
+ "static int numbers[] = {\n" >
+ xs
+ < "}\n"
+ "static int numbers_size = " xs.count ";\n"
+};
+
+instruction =
+ | left:x -> { x "," }
+ | right:x -> { x "," }
+ ;
+
+left[Reserved] = 'L' number:x '\n' -> { "-" x };
+
+right[RuleName] = 'R' number:x '\n' -> { x };
+
+number = digit digit*;
+
+digit = '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9';
diff --git a/src/examples/aoc20251/aoc20251.meta b/src/examples/aoc20251/aoc20251.meta
new file mode 100644
index 0000000..f2c1bb4
--- /dev/null
+++ b/src/examples/aoc20251/aoc20251.meta
@@ -0,0 +1,39 @@
+#id = aoc20251
+
+main = instruction*:xs !. -> {
+ "#include <stdio.h>\n"
+ "static int numbers[] = {\n" >
+ xs
+ < "};\n"
+ "static int numbers_size = " xs.count ";\n"
+ "unsigned int part1() {\n" >
+ "unsigned int i;\n"
+ "int dial_position = 50;\n"
+ "unsigned int zero_count = 0;\n"
+ "for (i=0; i<numbers_size; i++) {\n" >
+ "dial_position += numbers[i];\n"
+ "dial_position %= 100;\n"
+ "if (dial_position == 0) {\n" >
+ "zero_count++;\n"
+ < "}\n"
+ < "}\n"
+ "return zero_count;\n"
+ < "}\n"
+ "int main(void) {;\n" >
+ "printf(\"Part 1: %d\\n\", part1());\n"
+ "return 0;\n"
+ < "}\n"
+};
+
+instruction =
+ | left:x -> { x ",\n" }
+ | right:x -> { x ",\n" }
+ ;
+
+left[Reserved] = 'L' number:x '\n' -> { "-" x };
+
+right[RuleName] = 'R' number:x '\n' -> { x };
+
+number = digit digit*;
+
+digit = '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9';
diff --git a/src/examples/aoc20251/example.aoc20251 b/src/examples/aoc20251/example.aoc20251
new file mode 100644
index 0000000..679758f
--- /dev/null
+++ b/src/examples/aoc20251/example.aoc20251
@@ -0,0 +1,3 @@
+L50
+L50
+L50
diff --git a/src/examples/aoc20251/rl.aoc20251 b/src/examples/aoc20251/rl.aoc20251
new file mode 100644
index 0000000..776d310
--- /dev/null
+++ b/src/examples/aoc20251/rl.aoc20251
@@ -0,0 +1,4768 @@
+R6
+R18
+L39
+L36
+L11
+L24
+R3
+L47
+L11
+R5
+L49
+L12
+L7
+R39
+L9
+R50
+R4
+L30
+L19
+L44
+R43
+R16
+L40
+L19
+L3
+R27
+R10
+R5
+R7
+R41
+R16
+L12
+R27
+R22
+R4
+R28
+R46
+L42
+R29
+R17
+L31
+L12
+R34
+R43
+R32
+L16
+R44
+L37
+R31
+L21
+R74
+L56
+L47
+L97
+L43
+L45
+L12
+R48
+R10
+L58
+L70
+L30
+R45
+L45
+L10
+L18
+L72
+R14
+R97
+L55
+L56
+L99
+L5
+L73
+L36
+R13
+L75
+L25
+L13
+L87
+R59
+R41
+R19
+R4
+R58
+L81
+L97
+L3
+L79
+R26
+L39
+R92
+L13
+L30
+R80
+L17
+R4
+L24
+L66
+R37
+L33
+L38
+R90
+R78
+R32
+R154
+L54
+L11
+L89
+R91
+L829
+L44
+L18
+L759
+R42
+L83
+R93
+R349
+R58
+R859
+L94
+L65
+R1
+L1
+R760
+L68
+L33
+L59
+L97
+L403
+L32
+L868
+L59
+R10
+L13
+L30
+L31
+L90
+R327
+R58
+L88
+L84
+R13
+L32
+L81
+L78
+L22
+L91
+R235
+L87
+R67
+L24
+L4
+R4
+L45
+R88
+L69
+L391
+R87
+L604
+L562
+L204
+L87
+L48
+L79
+L10
+L76
+R89
+R93
+L47
+L35
+R34
+L109
+L461
+L53
+R404
+L15
+R953
+R47
+R47
+L33
+R28
+R22
+R39
+R69
+L872
+R28
+R72
+R950
+R250
+L893
+R51
+L358
+R631
+R327
+R21
+R63
+R34
+L76
+R96
+L63
+R67
+L92
+R46
+R46
+R88
+R95
+L96
+R56
+R57
+R187
+R52
+L795
+L44
+R68
+L12
+R96
+R81
+L33
+R83
+L19
+R39
+L41
+L36
+L924
+R89
+L6
+R26
+L11
+L377
+R77
+R59
+L67
+L88
+L83
+L38
+L843
+L140
+L297
+L34
+L90
+R60
+L2
+L52
+R15
+R54
+L45
+L81
+R45
+L73
+L9
+R2
+L127
+L386
+L61
+R81
+R82
+R18
+L24
+R24
+L44
+R644
+R39
+L65
+L74
+R80
+L80
+L62
+L38
+R598
+R52
+R561
+R31
+R1
+R502
+L63
+L9
+L52
+R79
+L5
+L92
+R598
+L1
+R63
+R12
+L38
+R80
+L73
+R91
+R56
+L24
+L90
+L90
+L56
+R31
+L66
+R4
+L33
+R70
+L96
+R59
+L205
+R5
+L89
+L77
+L44
+L985
+L44
+L450
+L11
+R36
+L48
+R58
+R54
+L18
+L810
+R70
+R22
+R168
+L32
+R70
+L70
+R33
+L13
+L56
+R631
+L27
+L94
+L74
+R54
+R63
+L17
+L10
+L790
+R13
+R53
+L442
+L24
+R55
+R45
+R78
+L69
+L9
+L175
+R30
+L86
+R631
+L17
+R87
+R79
+R51
+L19
+R19
+L9
+R9
+R9
+R33
+L41
+R499
+L57
+L33
+L37
+R73
+R48
+L27
+R62
+R371
+L79
+L59
+R44
+R298
+R85
+R824
+R66
+L79
+R70
+R29
+L96
+L68
+R89
+L54
+L470
+R78
+R39
+R4
+L555
+R634
+L68
+R42
+L74
+R87
+L39
+R52
+L55
+R80
+R75
+R1
+L1
+R62
+L49
+L17
+L96
+L21
+R130
+R91
+R92
+R76
+R32
+R69
+R731
+R4
+R89
+L82
+R73
+R16
+L44
+L56
+L280
+L96
+L412
+R988
+L28
+R928
+L435
+R55
+R844
+L90
+L50
+L224
+R47
+R53
+L23
+R617
+R43
+R72
+L77
+L32
+R412
+R288
+L46
+L53
+R99
+R76
+R59
+L35
+L239
+L55
+R494
+L16
+L624
+L14
+R54
+L45
+L42
+R87
+L62
+L404
+L26
+R86
+L80
+R479
+L15
+L778
+R52
+L552
+L44
+L56
+L1
+L81
+L18
+R98
+R54
+R9
+L61
+L72
+L728
+R82
+L99
+R96
+L974
+R95
+L18
+R18
+R78
+L3
+L76
+R1
+L24
+L76
+L223
+R54
+L94
+L85
+L98
+R62
+L16
+R30
+L55
+R25
+L17
+L99
+L784
+L778
+R88
+R83
+R7
+R59
+R15
+R29
+R58
+R39
+R221
+R79
+R82
+R18
+R58
+R42
+R5
+R95
+R33
+L33
+L81
+L99
+R54
+L74
+R976
+R12
+R160
+L216
+L615
+L17
+L798
+L288
+R49
+L63
+L65
+L602
+R67
+L59
+L24
+L17
+R30
+L56
+R31
+L5
+R111
+L158
+L53
+L664
+R64
+L53
+R79
+R743
+L671
+L98
+L70
+R70
+R19
+L89
+R670
+L83
+L57
+L44
+L45
+L71
+L63
+L37
+R96
+L82
+R40
+L86
+L405
+R76
+L39
+R56
+L277
+R2
+L550
+L31
+L544
+L563
+R51
+R769
+R91
+L72
+L635
+L896
+R12
+L97
+R956
+L385
+L87
+L94
+R94
+R55
+L90
+L65
+R79
+L79
+R83
+R517
+L227
+L81
+L109
+L8
+R30
+L5
+L93
+L1
+R94
+R59
+L26
+L72
+L61
+R77
+R67
+L29
+R85
+R95
+L98
+L97
+R20
+L32
+R591
+L275
+L38
+L18
+L2
+R32
+R82
+R40
+L69
+L9
+L16
+L6
+L46
+L12
+L42
+R59
+R59
+L18
+R890
+L89
+L27
+L55
+L979
+L40
+R230
+L30
+L3
+L79
+R82
+L29
+L719
+L52
+L41
+L59
+L80
+R81
+R549
+R64
+L61
+L794
+L959
+R80
+L154
+R25
+L79
+R84
+R94
+L50
+R17
+L48
+L11
+R189
+L1
+L5
+R28
+R31
+R96
+R804
+R909
+L431
+R22
+L68
+L32
+R907
+L7
+L713
+L67
+L69
+L535
+R73
+L3
+L24
+L77
+L96
+R14
+R1
+R96
+R87
+R13
+L16
+R42
+L26
+R38
+R62
+L298
+R98
+R19
+L446
+R80
+R62
+R82
+R12
+L14
+R31
+L99
+R73
+R424
+R76
+R76
+R276
+L54
+L698
+R20
+R15
+L11
+L138
+R28
+R586
+R39
+L39
+L31
+L69
+R65
+R56
+R79
+R86
+R71
+R32
+R11
+R31
+R69
+R97
+R284
+R19
+L44
+L756
+L49
+R49
+R208
+L97
+R389
+L725
+R748
+R47
+R20
+L90
+L8
+R33
+L25
+R9
+L58
+L51
+L68
+L28
+L41
+R37
+L51
+L49
+R14
+L14
+L569
+L86
+R55
+L73
+L33
+L36
+R53
+R89
+L11
+R8
+L94
+L3
+L8
+L52
+R27
+L67
+R689
+L89
+L290
+R30
+R60
+R85
+L85
+R86
+R14
+R45
+L49
+R4
+R29
+R9
+R441
+L685
+L746
+L18
+L37
+L47
+R54
+L58
+L242
+R27
+R67
+L22
+R1
+R27
+R21
+L43
+L78
+R40
+L14
+R74
+L3
+L53
+R75
+L19
+R82
+L82
+R38
+R93
+R94
+L14
+R88
+L99
+R65
+R35
+L88
+R12
+L4
+L20
+R25
+R13
+R62
+L39
+L62
+L13
+L606
+L227
+R47
+R47
+R53
+L31
+R58
+R73
+R91
+L16
+L73
+R47
+R51
+R21
+L721
+R90
+R27
+R24
+R19
+R24
+L16
+R32
+L208
+R13
+L222
+L332
+L51
+L35
+L29
+R949
+L684
+R99
+R38
+L38
+R662
+L45
+L49
+R732
+R29
+L83
+R51
+R59
+L821
+L735
+L49
+L49
+R75
+L336
+R966
+L350
+R43
+L95
+R77
+R69
+L515
+L98
+R56
+R106
+L101
+L60
+L42
+L3
+L94
+R437
+R63
+L84
+R84
+L54
+L46
+R93
+R7
+L581
+R181
+R854
+L686
+L88
+R33
+R87
+R83
+R48
+L231
+L63
+R63
+R7
+R93
+R885
+R15
+R47
+L70
+L54
+R1
+L93
+L31
+L90
+L110
+L7
+R27
+R73
+R365
+L58
+L65
+L525
+L10
+R30
+R9
+L429
+R90
+L39
+L28
+L33
+L3
+L597
+L69
+L108
+L54
+L63
+R98
+L5
+R215
+L282
+L32
+R946
+R45
+R48
+L39
+L154
+R484
+L29
+R442
+L11
+R80
+L12
+L68
+R168
+R20
+R98
+R78
+L96
+L27
+R23
+R80
+L376
+R598
+R88
+R26
+L89
+R294
+R85
+L102
+L82
+L18
+R44
+R41
+R56
+L91
+R50
+L60
+R60
+R471
+R529
+R60
+L60
+R66
+L62
+L346
+L94
+L64
+L57
+L2
+R97
+L73
+R235
+R96
+L15
+R619
+R14
+R80
+L67
+R73
+L45
+L55
+L37
+R37
+R4
+R96
+R790
+L13
+R23
+L43
+L57
+R77
+L77
+R87
+L787
+L2
+L598
+R59
+L24
+R65
+L644
+L47
+L51
+R586
+R34
+L21
+L45
+L24
+R33
+L5
+R84
+L731
+L69
+R52
+R48
+R30
+L48
+L582
+R16
+L310
+R94
+R10
+L19
+L91
+R4
+L14
+R510
+R11
+R71
+L482
+R47
+L47
+L10
+L56
+L24
+L74
+R64
+R80
+R87
+R16
+R229
+R94
+R29
+R25
+L5
+L55
+L1
+L536
+L63
+L6
+L933
+L66
+R18
+R56
+R31
+L28
+R28
+R70
+R30
+L83
+R183
+L378
+R878
+R93
+R50
+L8
+R60
+R705
+L25
+L33
+L42
+L99
+R62
+R37
+R911
+R50
+R94
+L55
+L106
+R52
+R40
+L86
+R87
+R437
+L49
+L35
+L13
+L88
+R45
+R46
+L62
+L68
+L55
+L67
+L94
+R19
+L3
+L25
+R45
+R80
+L67
+L806
+R76
+L86
+L27
+R55
+L76
+R31
+L45
+L10
+L45
+R312
+R88
+R93
+L2
+L91
+R827
+L27
+L291
+R33
+R78
+L42
+L78
+L786
+L680
+R53
+R15
+L50
+L37
+R75
+L60
+L81
+R51
+L74
+L26
+R34
+R66
+L82
+L18
+R67
+L925
+L49
+R150
+L1
+L18
+L59
+L65
+L48
+L78
+L60
+L82
+R68
+L78
+L5
+R83
+R7
+L7
+L96
+R96
+R64
+L664
+L42
+R42
+R83
+L49
+R92
+R94
+L20
+R38
+L74
+L447
+R99
+R784
+L11
+R854
+L43
+L3
+L64
+R7
+R38
+R74
+R51
+L3
+L41
+L14
+R55
+R64
+L464
+L977
+L313
+L6
+R92
+R4
+L34
+R34
+R542
+R61
+L90
+L60
+L53
+L93
+R94
+R137
+R78
+R42
+L19
+R94
+L833
+R967
+R333
+R80
+L80
+L87
+R21
+R756
+R17
+R72
+R1
+L219
+R75
+R35
+L60
+R94
+L10
+R105
+L50
+L421
+L29
+R47
+L11
+L36
+L74
+L338
+L93
+L26
+L69
+L723
+L77
+L83
+L17
+L82
+R41
+R61
+R7
+L80
+R8
+R58
+R87
+R34
+L36
+R2
+L18
+R24
+L63
+L48
+L35
+R44
+R96
+L84
+L73
+L43
+L88
+L12
+L48
+L889
+L63
+L65
+L80
+L23
+L32
+R397
+R616
+L36
+R76
+L35
+L18
+L16
+R409
+R196
+R11
+L926
+R62
+L867
+L47
+L94
+L56
+L94
+R22
+R827
+R73
+L87
+R71
+L87
+R44
+L37
+L3
+R403
+R27
+R69
+R45
+L45
+R41
+R1
+L443
+R701
+R15
+R8
+R77
+L73
+L27
+L70
+L9
+L436
+L61
+L8
+L68
+R63
+L71
+R8
+L48
+L306
+R87
+L68
+L68
+R83
+L97
+R45
+L64
+R88
+R259
+R894
+L53
+R695
+L95
+L43
+L57
+R16
+R36
+R49
+R736
+R50
+L70
+L479
+R11
+R16
+L134
+L49
+R21
+L387
+L16
+R63
+R37
+L73
+L81
+R554
+L17
+R36
+R451
+R30
+R31
+R51
+L42
+L140
+L82
+L18
+L11
+L5
+L84
+R929
+R71
+L715
+L33
+R848
+L91
+L82
+L27
+R227
+L12
+R82
+R77
+R26
+L45
+R45
+R757
+R43
+R97
+R3
+R901
+L1
+R11
+L10
+L831
+L26
+R56
+R55
+R36
+L85
+L77
+R38
+L45
+L22
+L271
+L933
+R63
+L97
+R55
+L65
+L80
+L265
+R13
+L15
+L78
+L27
+L77
+R90
+L68
+R85
+R70
+L64
+R64
+L44
+L26
+L90
+R60
+L70
+R70
+L15
+R21
+L39
+L46
+L24
+L43
+L66
+L5
+R17
+R43
+R657
+L92
+R40
+R63
+R88
+L99
+R78
+L88
+L13
+R81
+R90
+L738
+R13
+R52
+R215
+R59
+R13
+L695
+R63
+R70
+L61
+L20
+R68
+L287
+L80
+R24
+R556
+L226
+R426
+R67
+L291
+R24
+L594
+L6
+L41
+L38
+L21
+R386
+L10
+R1
+R35
+L39
+R23
+R72
+R32
+R57
+L598
+L8
+L51
+L753
+R53
+L3
+R58
+L529
+R95
+L93
+L95
+R93
+L826
+R52
+R54
+R94
+R23
+R82
+R95
+R489
+R29
+L18
+R28
+R72
+R435
+R743
+L78
+R59
+L669
+L42
+R58
+R87
+L93
+R94
+R72
+R34
+R35
+R65
+R77
+R83
+R940
+L35
+R35
+R78
+L978
+R49
+R29
+L80
+L43
+R45
+L18
+R3
+R15
+R331
+L180
+R16
+R210
+R27
+R196
+L891
+L9
+L52
+L85
+L34
+R91
+R821
+R59
+R84
+L8
+R62
+R8
+L46
+L7
+R77
+L70
+L136
+L860
+R1
+R709
+R40
+L96
+L58
+R613
+L10
+L68
+L51
+R159
+L43
+L176
+R42
+L843
+R77
+R988
+L788
+L82
+R82
+L191
+R91
+L898
+R98
+L31
+L69
+R97
+R3
+R24
+L61
+L16
+L84
+R37
+R63
+L79
+R16
+L613
+L10
+R23
+R96
+L91
+L31
+L92
+L23
+L459
+R39
+L522
+L577
+R87
+R73
+R57
+R90
+R92
+L14
+L25
+R38
+R86
+L24
+R77
+L178
+L99
+L98
+L94
+R43
+L69
+L82
+L80
+L42
+R6
+L28
+L56
+L16
+L761
+L23
+L98
+R98
+R38
+R94
+L532
+R28
+R90
+L18
+L62
+R548
+L8
+L87
+L83
+L34
+R87
+L97
+L86
+R443
+R79
+L501
+R1
+R13
+R52
+R33
+L98
+R46
+L466
+R96
+L76
+L582
+R82
+R47
+R53
+R8
+R18
+L57
+R31
+R865
+L65
+L70
+L94
+R59
+L43
+R48
+L19
+L54
+L13
+L6
+R72
+L855
+R75
+R784
+L29
+L66
+R478
+L613
+L51
+L18
+R4
+R68
+R85
+R13
+L44
+L711
+R531
+R51
+R36
+R87
+R19
+L24
+R97
+R76
+R30
+R28
+R69
+R1
+R99
+R34
+L68
+L51
+R629
+L95
+R811
+R140
+L94
+R77
+L47
+R95
+R169
+L90
+L10
+L77
+L45
+R87
+L65
+R77
+L99
+R78
+L73
+L83
+L93
+L7
+L89
+L92
+L1
+R58
+L76
+R67
+L67
+L68
+L48
+R16
+L174
+L84
+R58
+L51
+R51
+R845
+R25
+L487
+R628
+R19
+R470
+R35
+L45
+R910
+L7
+L31
+R738
+R789
+R24
+L6
+L81
+R2
+L57
+R75
+R48
+L160
+R30
+L29
+R81
+R584
+L36
+R736
+L77
+R61
+L84
+L665
+R34
+R31
+L687
+L113
+L47
+L41
+L76
+L76
+L241
+R354
+R45
+R14
+L32
+L47
+L253
+L28
+R28
+L60
+L40
+R923
+L60
+L163
+R399
+L16
+R17
+R72
+L72
+L6
+L60
+R66
+R96
+L23
+R28
+L1
+R81
+L1
+R68
+L67
+L32
+L20
+R213
+R25
+R33
+R270
+L70
+R425
+L48
+L377
+L25
+L42
+L33
+R104
+L85
+L19
+R669
+R331
+R57
+L40
+L217
+L63
+R15
+L98
+L18
+L55
+L384
+L69
+L85
+L72
+R429
+R45
+L45
+L52
+L62
+R44
+R56
+R414
+L876
+L224
+R641
+R9
+R11
+R78
+R1
+R496
+R98
+R17
+R49
+L506
+R590
+L862
+R93
+R39
+L5
+R51
+R238
+L38
+L644
+R999
+L61
+L94
+R691
+R4
+L55
+L60
+L780
+L481
+R33
+R65
+R83
+R22
+L22
+L430
+R1
+R29
+R83
+R817
+R93
+L14
+L76
+L903
+R39
+R94
+L3
+L43
+L729
+R65
+R12
+R237
+R28
+L12
+L37
+R30
+R65
+R43
+L31
+R42
+L68
+L8
+R72
+R13
+L9
+R73
+L97
+L176
+L584
+L15
+R950
+L629
+R98
+L59
+L61
+R2
+R519
+L227
+L4
+L80
+R90
+R85
+R89
+L767
+R45
+L34
+R65
+R617
+R371
+R29
+L48
+L52
+L214
+R293
+L7
+R28
+L39
+L61
+L56
+L63
+R590
+L6
+R35
+L73
+L327
+R99
+L399
+R827
+R30
+L21
+L636
+R88
+R5
+L70
+R680
+L111
+R8
+L35
+R40
+L5
+L70
+R38
+R46
+L90
+L88
+R19
+R71
+R14
+R60
+R51
+R30
+R319
+L97
+L49
+R46
+L44
+L556
+L90
+L10
+R88
+R12
+R86
+R13
+L88
+R89
+R926
+L26
+R57
+L492
+L65
+R623
+L46
+L72
+R1
+L46
+L60
+L80
+L20
+L40
+L46
+R914
+R361
+R94
+R11
+R33
+L51
+R86
+R692
+L754
+L74
+R174
+R683
+R17
+R91
+L45
+R54
+L55
+R55
+L84
+R98
+R86
+L154
+R62
+L535
+L73
+L354
+L38
+L8
+R97
+L69
+R72
+L30
+R330
+R57
+L81
+L59
+L96
+R24
+R37
+L51
+L31
+R71
+R80
+L24
+R373
+R485
+L85
+R19
+L150
+R31
+L660
+R760
+L63
+R23
+L279
+R63
+R56
+L988
+R2
+L35
+R70
+R91
+L440
+R49
+R13
+R34
+R19
+R31
+L387
+L478
+L81
+R73
+R27
+R38
+R12
+R36
+L86
+R55
+L160
+R5
+R51
+R45
+R59
+R96
+L49
+R98
+R95
+R694
+R11
+L10
+L14
+L839
+R97
+R98
+L532
+R75
+R16
+R71
+L88
+L49
+R75
+L55
+R55
+R53
+R21
+L55
+L19
+L48
+R20
+L68
+L5
+R1
+L35
+L48
+R83
+R61
+R439
+R35
+R65
+L65
+R25
+R957
+L871
+R54
+L37
+R42
+L14
+R65
+R44
+L54
+L19
+R96
+R177
+L98
+R98
+R51
+L75
+L76
+R9
+L3
+R628
+R24
+L43
+R67
+R189
+L189
+R43
+R270
+R80
+R20
+R62
+L49
+R94
+R19
+R579
+R3
+R97
+L625
+L32
+L578
+R90
+L55
+R10
+L83
+L33
+R61
+L98
+R74
+L90
+L41
+R534
+L84
+R305
+R45
+R21
+L621
+L1
+R29
+R72
+R44
+L44
+R65
+L41
+R76
+L256
+L44
+R33
+R67
+R37
+R63
+R95
+L95
+R8
+L208
+R85
+R867
+R48
+L95
+R36
+R556
+L47
+R8
+L58
+L84
+L116
+L56
+R56
+L93
+R43
+L15
+R31
+L26
+L40
+R10
+L10
+R19
+L63
+L656
+R57
+L91
+L57
+L87
+R13
+R85
+R171
+R57
+L68
+R20
+L22
+R264
+L31
+L11
+L38
+L50
+L12
+R947
+R53
+R203
+R86
+L17
+R17
+L89
+L41
+R89
+L6
+R58
+R46
+R54
+L26
+L308
+R76
+L42
+L58
+L27
+L37
+R22
+L789
+R64
+R86
+R809
+L30
+L291
+L12
+R363
+L61
+L39
+R65
+R98
+R26
+L45
+R56
+L748
+R22
+L20
+R50
+L4
+L76
+R76
+R685
+R29
+L68
+L64
+L82
+L49
+L71
+L190
+L290
+R887
+R49
+R85
+R16
+R11
+R12
+L62
+R2
+R91
+L880
+R30
+L64
+L677
+L12
+L84
+R82
+L24
+R48
+R65
+R33
+R92
+L27
+L472
+R712
+R87
+L26
+R26
+R19
+R81
+L82
+R94
+R36
+L48
+R77
+L287
+R78
+R421
+L176
+L86
+L27
+L98
+R586
+R79
+L67
+R20
+R74
+R33
+L78
+R17
+L43
+L815
+L827
+R19
+L488
+L95
+L17
+R176
+R24
+R51
+L451
+L72
+R71
+L41
+R42
+R32
+R67
+L99
+L49
+R154
+R54
+R96
+R45
+R11
+R89
+R363
+L646
+R83
+R95
+R69
+R375
+R61
+L53
+R91
+L13
+L66
+L959
+L9
+R46
+R13
+L66
+R12
+L66
+R70
+R96
+L496
+L647
+R47
+L60
+L63
+R23
+L94
+L6
+L4
+L96
+L74
+R74
+L1
+L99
+R2
+R86
+L47
+R84
+L17
+L8
+L78
+L670
+L52
+R6
+R94
+L95
+L36
+L3
+R50
+R16
+R68
+R28
+L99
+L34
+R5
+L49
+L82
+L57
+R81
+L18
+L49
+R74
+R32
+L32
+R579
+R34
+R62
+R51
+R99
+L62
+L79
+R6
+R30
+L920
+L23
+L26
+L49
+L602
+L52
+L70
+L78
+R70
+R12
+L52
+L90
+R73
+R4
+L33
+L76
+R470
+L78
+L56
+R56
+L29
+R94
+R97
+L81
+L81
+L272
+L76
+L72
+L344
+R864
+L76
+R53
+L77
+L43
+R43
+L9
+L5
+L52
+L88
+R35
+R42
+L75
+R794
+R58
+R180
+R51
+R469
+L41
+L29
+L430
+L449
+L77
+L74
+R89
+R55
+R56
+R680
+R99
+R21
+R2
+L402
+R218
+L6
+R99
+R989
+L10
+L577
+R56
+L69
+L1
+R701
+R191
+L1
+R510
+R7
+R93
+L14
+R14
+R42
+L124
+R776
+R44
+L67
+R29
+L753
+R53
+L92
+R71
+R83
+R315
+R95
+L23
+L70
+R47
+R307
+R46
+L17
+L862
+R95
+L34
+L61
+L14
+L467
+R81
+R4
+R38
+R58
+L92
+L18
+L790
+L5
+L83
+R488
+L369
+R529
+L75
+R43
+R72
+R57
+L457
+L65
+R67
+L659
+R81
+L824
+L540
+R40
+R7
+L19
+L88
+L57
+L68
+L75
+L60
+L725
+L15
+L550
+L59
+R902
+R190
+L1
+L4
+L78
+L35
+L190
+L75
+R71
+L70
+R370
+L78
+R233
+L22
+R96
+R42
+R258
+R58
+L82
+R24
+L740
+R613
+R7
+R81
+L66
+L95
+L79
+L17
+L25
+L79
+R83
+L49
+R36
+L34
+R764
+R99
+L99
+R61
+R858
+R81
+L82
+R7
+L25
+R40
+R55
+R53
+L30
+R86
+R96
+L94
+L6
+R12
+L82
+L68
+L62
+L33
+L96
+L71
+R79
+L97
+R18
+R73
+L62
+R588
+R18
+L17
+R99
+R63
+R938
+L70
+R8
+R62
+R9
+L71
+R6
+R256
+R24
+R83
+L22
+R4
+L99
+R99
+R15
+L56
+L44
+L90
+L14
+L105
+L95
+R2
+R99
+R32
+R25
+L77
+R19
+L80
+R88
+R92
+R19
+R25
+L92
+R41
+R6
+L63
+R30
+L66
+R52
+R624
+L985
+L30
+R694
+L88
+R333
+R52
+L52
+L62
+L38
+R83
+R7
+L90
+R94
+L63
+R66
+L197
+L776
+L33
+L52
+L39
+L68
+L935
+R31
+R49
+L69
+R992
+L43
+L12
+R194
+R25
+R16
+R320
+L228
+R26
+R826
+R29
+L52
+L2
+R34
+R67
+R34
+R53
+R213
+R78
+L298
+R20
+R20
+L96
+R91
+R85
+L61
+L39
+R988
+L72
+L16
+L69
+L507
+R76
+L280
+L25
+L33
+L62
+R8
+L8
+R42
+L42
+R98
+L7
+L4
+R97
+R6
+R410
+R54
+R63
+R683
+L28
+L72
+R70
+R30
+R31
+R69
+L66
+L34
+R45
+R555
+L71
+L24
+L36
+L481
+L139
+L31
+L18
+R50
+L50
+L96
+L968
+L659
+L68
+R15
+L82
+L764
+L96
+R18
+R16
+R11
+R73
+L8
+R14
+L506
+R136
+L22
+L31
+R70
+R11
+R21
+L785
+L15
+L785
+R61
+R39
+L68
+R68
+R39
+R69
+R92
+R99
+R41
+L50
+R89
+L79
+L88
+R88
+L25
+R63
+R26
+R48
+L471
+R620
+L59
+R12
+R54
+L30
+L2
+R64
+L97
+R97
+R939
+L24
+L815
+R392
+R69
+L61
+R67
+R86
+L53
+R81
+L81
+L841
+R8
+R133
+L105
+L26
+R14
+R47
+R70
+L149
+R28
+R25
+R96
+L95
+R84
+R760
+R51
+R60
+L33
+R408
+R69
+L94
+R90
+L646
+R46
+L61
+R27
+R24
+R16
+L5
+L301
+R718
+R5
+R77
+L305
+L95
+L92
+L8
+L5
+L87
+R75
+L20
+L334
+L5
+L24
+L5
+R5
+R858
+L38
+L20
+L68
+R67
+L31
+L99
+R70
+L39
+R36
+L336
+R92
+R8
+L51
+R51
+R25
+L525
+L88
+L12
+L35
+L31
+L58
+L2
+R26
+R54
+R52
+L32
+R20
+R992
+L1
+R15
+R30
+R76
+R12
+L31
+L828
+L67
+R8
+L239
+R39
+L13
+R13
+L39
+L61
+R88
+L15
+L73
+L98
+R277
+R121
+L553
+L22
+R50
+R29
+L66
+R662
+R83
+R18
+L42
+R41
+R38
+L71
+R55
+L22
+L94
+L659
+L52
+R5
+L543
+R48
+L9
+R10
+R12
+L95
+L201
+R178
+R921
+R86
+L7
+L22
+L724
+R46
+L49
+L68
+R17
+L67
+L992
+R42
+R17
+R92
+L27
+R35
+L76
+R13
+L61
+L41
+R79
+L17
+R73
+R112
+R73
+R779
+L88
+L193
+R252
+L35
+R57
+L27
+R862
+R38
+L70
+R69
+L45
+L14
+R46
+R14
+L33
+R273
+R94
+L14
+R17
+R63
+L74
+R857
+L127
+R44
+L79
+R714
+L35
+R470
+R72
+L72
+L877
+R2
+R90
+R434
+L74
+R373
+R29
+R53
+L250
+R24
+R26
+R285
+L85
+L55
+L3
+L70
+L975
+R819
+L16
+R19
+R11
+R340
+L70
+R87
+L78
+R64
+R27
+R20
+R80
+R72
+R69
+R43
+L84
+R949
+L149
+R390
+R12
+R5
+R12
+R281
+R61
+L70
+L91
+L53
+R76
+R54
+L25
+L47
+L25
+R54
+R77
+R8
+R5
+R78
+R17
+R55
+L82
+R40
+L432
+L17
+L481
+R16
+L90
+L76
+L52
+R30
+R4
+L35
+L25
+R326
+R83
+L73
+L10
+R49
+L21
+R972
+L15
+L49
+L336
+L4
+R64
+R440
+L28
+R128
+L3
+L97
+L82
+R23
+R59
+R53
+R36
+L608
+L26
+L93
+R281
+L317
+R74
+L99
+L13
+L27
+R481
+R58
+L49
+R49
+R74
+R26
+R913
+L15
+R19
+L72
+L89
+R90
+R922
+L23
+R50
+L48
+R682
+R74
+L20
+R98
+L381
+R704
+L152
+L652
+L21
+L11
+R13
+R6
+R5
+R90
+R28
+L36
+L63
+R672
+R91
+R326
+L84
+R477
+R56
+L49
+R839
+R85
+R76
+R23
+L26
+L10
+L66
+L21
+R40
+R64
+L95
+R89
+R59
+L57
+R70
+L513
+R43
+L32
+L93
+L36
+R37
+R360
+L60
+L68
+L80
+R32
+R64
+L10
+L14
+L1
+R73
+L69
+L77
+L549
+R2
+R73
+R48
+L532
+R32
+L472
+L628
+R99
+R855
+L54
+L67
+R10
+L865
+L89
+R962
+L66
+R98
+L983
+L91
+R42
+L752
+R96
+R66
+L61
+L42
+R32
+R12
+L39
+R83
+L46
+L80
+L50
+R30
+R42
+L42
+L33
+R33
+R48
+R52
+R44
+R56
+R33
+R79
+R88
+L81
+L396
+R77
+L94
+L27
+L20
+L59
+R42
+L77
+L963
+L2
+L85
+R24
+R276
+L5
+L10
+R93
+R7
+R37
+R937
+L37
+L37
+L31
+L69
+R921
+L21
+L14
+L919
+R933
+R62
+R35
+L90
+R670
+R23
+R78
+R22
+R54
+L74
+R782
+L324
+R62
+L16
+R4
+L88
+R23
+R577
+R528
+L35
+L53
+R360
+L8
+L89
+R97
+L5
+R5
+L33
+L879
+L188
+R29
+L93
+L9
+L61
+R53
+R81
+R82
+L937
+R76
+R79
+R78
+R20
+R502
+L19
+R19
+R29
+R71
+R57
+L28
+R38
+R262
+L34
+L46
+L49
+L27
+R27
+R320
+L8
+L78
+R66
+L80
+L20
+L35
+L18
+L536
+L11
+L4
+R65
+L61
+L33
+R862
+R92
+R76
+R3
+L21
+L79
+L139
+R45
+R694
+R94
+R671
+R130
+R34
+L29
+R22
+L22
+R94
+L94
+L37
+L23
+L69
+R4
+R62
+L44
+R7
+R65
+L84
+L12
+L97
+L43
+R71
+L13
+R15
+L38
+R43
+R44
+L26
+L25
+L31
+L69
+L451
+R409
+R41
+L69
+R57
+L87
+L65
+R65
+L631
+R831
+R59
+L86
+R3
+L81
+L46
+L478
+L171
+R60
+L960
+L51
+R151
+L597
+L3
+L48
+R50
+L30
+L68
+R523
+L66
+R37
+R216
+L14
+L20
+R90
+L70
+R58
+L22
+R116
+L166
+L80
+L83
+R77
+R226
+L98
+R72
+R14
+L63
+L92
+R54
+L25
+R2
+R10
+L94
+R670
+L44
+R68
+L82
+R363
+R293
+R29
+L60
+L11
+R41
+R2
+L87
+R40
+R96
+R280
+L92
+R888
+R434
+L34
+R26
+L726
+L58
+L73
+R131
+R319
+L93
+L74
+R85
+R29
+R34
+R38
+R62
+L97
+R97
+R36
+R171
+L91
+L765
+R179
+R70
+L21
+R93
+L27
+L345
+R48
+L208
+L17
+R16
+R3
+R16
+L98
+R4
+L235
+L29
+R48
+R885
+L1
+L20
+L12
+R40
+R49
+R511
+L5
+L25
+L70
+R80
+L73
+L64
+L78
+R933
+L4
+L94
+L23
+R45
+L12
+L38
+R28
+R803
+L6
+R3
+L65
+R2
+R73
+R17
+L1
+L26
+R20
+L20
+R79
+L64
+L17
+L98
+R95
+R87
+L82
+L6
+R30
+R39
+R62
+L11
+L32
+R51
+L90
+L65
+R22
+L66
+L34
+L68
+R90
+R26
+L137
+L73
+R519
+R43
+L49
+R81
+L60
+L1
+R96
+L48
+L22
+L56
+L11
+R70
+R96
+L78
+L2
+L40
+L247
+R69
+R81
+R37
+L16
+L199
+R192
+R52
+R55
+L87
+R55
+R32
+R64
+R36
+R326
+R66
+R17
+L9
+L88
+L89
+L23
+L3
+R3
+R56
+L856
+R71
+R29
+R23
+R52
+L270
+R7
+L75
+L37
+R95
+L26
+R10
+R58
+L29
+L52
+L218
+L38
+R4
+L47
+R943
+R75
+R44
+L23
+R55
+R49
+L8
+R56
+L48
+L51
+R37
+R81
+R33
+L49
+R47
+L98
+L14
+R14
+R57
+R432
+R25
+R418
+L32
+R71
+L25
+R54
+R53
+L353
+R56
+L5
+R14
+L65
+L46
+R23
+R723
+L87
+L69
+L44
+L39
+L61
+L72
+L58
+L86
+L484
+L71
+L84
+L145
+L74
+R48
+L174
+L929
+R93
+R642
+R56
+R938
+L95
+R42
+R45
+R14
+R49
+R34
+L89
+L66
+R20
+L54
+L550
+R454
+L474
+R70
+L83
+R93
+L46
+R36
+L46
+L54
+L4
+R42
+L804
+L237
+R488
+L885
+L569
+R85
+L182
+L12
+R48
+L70
+L748
+L52
+L69
+L31
+R826
+L35
+L71
+L886
+R66
+R43
+R9
+R48
+L977
+R42
+L29
+L97
+R61
+L7
+L90
+R95
+R32
+L13
+R83
+L49
+L95
+R95
+L351
+R7
+R50
+R66
+L3
+L20
+R162
+L62
+L87
+L13
+R52
+R48
+L658
+R63
+L5
+L24
+R32
+L40
+R32
+L11
+R13
+R97
+L30
+R31
+L21
+R68
+R49
+R560
+L89
+L55
+L60
+L52
+R625
+R751
+L54
+R95
+L94
+R677
+L88
+R45
+R565
+R25
+L3
+L170
+L98
+L13
+R37
+R56
+R9
+L451
+R86
+R85
+R30
+L15
+L96
+L118
+L5
+R869
+L92
+R49
+L7
+L131
+L44
+R75
+R58
+R63
+R279
+R75
+L80
+L95
+L25
+R37
+L68
+R156
+R116
+R24
+L190
+R51
+R193
+L47
+R30
+R78
+L590
+R87
+L52
+L92
+R192
+L43
+L14
+L943
+L6
+R6
+L91
+L9
+L271
+L56
+R27
+L977
+L74
+R96
+R55
+R57
+L89
+L78
+L90
+L57
+L57
+R14
+L26
+R93
+L66
+L1
+R27
+R62
+R11
+R72
+R28
+L60
+R52
+R821
+L96
+R83
+L634
+R34
+L48
+R705
+R95
+R48
+L951
+L85
+L81
+R202
+L85
+L718
+R57
+L28
+L777
+L40
+R45
+R61
+R29
+L29
+L809
+L44
+R54
+R16
+L20
+R103
+L78
+L59
+R37
+R95
+R71
+R72
+R25
+R37
+R896
+R37
+L33
+R58
+R42
+L93
+L941
+L92
+R41
+L74
+L73
+R68
+R64
+R82
+L70
+R88
+L973
+L772
+L82
+R33
+R636
+L42
+R8
+L27
+L43
+L81
+L57
+L43
+L28
+L22
+R56
+L735
+R10
+L38
+R60
+L30
+R79
+L294
+R85
+R275
+L15
+R34
+R6
+L8
+R8
+L726
+L74
+R77
+L88
+R27
+L371
+L30
+L3
+L549
+R10
+L740
+R64
+L97
+R82
+L82
+L131
+R31
+L85
+L4
+R18
+L229
+L55
+R59
+L4
+L337
+L63
+R877
+R567
+R56
+R84
+L243
+L19
+R1
+R777
+R58
+R42
+R21
+L21
+L61
+L39
+L315
+R92
+R23
+R28
+L528
+R13
+R87
+L61
+R4
+L143
+L80
+R80
+R517
+L54
+R37
+R60
+R40
+R96
+L28
+L45
+L79
+L75
+R35
+L68
+L36
+R1
+R99
+R7
+L7
+R76
+L73
+R2
+R17
+R207
+L81
+R15
+R34
+R3
+L16
+L684
+R54
+R960
+R86
+R946
+R69
+R85
+L67
+R773
+R61
+R87
+R32
+R14
+L869
+L855
+L69
+R33
+R85
+L741
+R82
+L34
+R70
+R50
+R48
+L71
+R15
+R56
+R26
+R79
+L16
+L70
+R81
+R794
+L76
+R14
+R83
+L515
+R92
+L69
+L23
+R74
+R1
+L77
+R2
+L62
+L38
+R37
+R63
+L140
+L853
+R493
+R390
+R26
+L16
+R98
+L183
+R85
+R58
+R889
+R53
+L26
+L96
+R33
+R1
+R88
+L23
+L277
+L66
+R507
+R19
+R18
+R977
+R45
+R93
+L684
+L96
+L78
+L35
+R74
+R26
+R39
+L22
+L38
+L79
+R24
+R354
+L78
+L677
+R22
+L56
+L289
+L13
+R14
+L58
+L43
+L503
+R19
+R16
+L32
+R65
+L68
+L99
+L67
+L31
+R460
+L73
+L87
+L2
+L98
+R91
+R9
+L379
+R79
+L68
+R28
+R242
+R66
+L4
+R66
+L33
+L71
+R31
+L57
+L2
+R90
+R69
+L57
+L86
+R71
+L737
+L80
+R232
+R79
+L179
+R52
+L20
+R77
+L67
+L42
+L8
+R97
+R40
+L29
+R4
+L59
+L53
+R16
+L62
+L67
+R21
+L346
+L93
+R48
+L96
+R998
+L45
+L85
+R32
+L23
+R70
+R40
+R51
+R97
+L7
+L41
+R53
+L153
+R474
+L10
+L764
+L36
+L14
+L22
+L152
+R24
+L80
+L23
+R503
+L80
+R11
+L24
+R38
+L813
+L103
+L29
+R70
+R69
+R21
+L202
+R479
+R63
+R125
+L780
+R45
+L790
+L36
+L64
+L48
+L52
+R22
+L432
+L84
+L13
+R70
+R17
+R20
+R4
+L207
+L565
+L85
+R53
+L28
+R11
+R25
+R31
+R61
+L87
+R987
+R60
+L60
+L14
+L75
+R60
+L71
+L780
+R17
+R55
+L92
+L464
+L87
+R28
+L83
+R96
+R610
+R681
+L21
+R50
+L10
+L86
+L88
+R39
+R835
+L32
+L68
+R304
+R14
+L29
+R547
+L89
+R53
+R616
+L16
+L51
+L29
+L56
+R136
+L1
+R301
+R923
+R777
+R813
+L413
+R5
+L791
+R86
+R63
+L19
+L97
+R82
+L29
+L53
+L35
+L645
+R245
+R351
+R2
+L65
+L99
+R35
+L38
+L98
+L9
+L91
+R80
+L94
+R44
+R387
+L73
+L55
+R729
+R63
+L805
+L76
+L306
+L474
+R29
+L422
+R78
+R995
+R248
+R56
+R96
+R2
+R66
+L77
+R71
+L293
+L269
+R24
+L64
+R940
+R48
+R967
+L48
+L65
+L2
+R3
+L78
+R460
+L73
+R62
+L74
+L11
+L76
+L90
+L63
+L61
+R129
+L28
+L797
+L15
+R21
+R6
+L15
+R99
+R1
+L61
+L5
+L8
+L726
+L69
+L703
+R1
+R58
+L721
+L83
+L75
+L83
+R75
+L2
+R64
+R736
+R52
+L30
+R378
+R750
+L85
+R37
+L13
+L224
+R37
+R29
+L55
+R826
+L273
+L51
+R56
+L83
+R51
+R22
+L74
+L48
+L82
+R2
+R80
+R555
+L45
+L10
+R555
+L66
+L88
+L20
+L781
+L609
+R44
+R65
+L575
+L25
+L34
+R31
+L87
+R93
+R97
+R73
+R33
+L5
+R999
+L2
+L16
+L2
+L80
+R66
+R2
+L18
+L28
+R78
+L798
+R798
+L94
+L980
+L22
+R99
+R85
+R77
+R7
+L39
+R67
+R36
+R84
+R80
+L973
+L754
+R27
+L30
+R3
+R7
+L71
+L13
+R4
+L92
+L240
+L80
+R52
+L40
+R96
+L28
+R96
+R19
+R17
+R913
+R387
+R19
+R62
+L36
+L26
+L419
+L34
+L87
+R36
+L703
+R88
+R59
+L59
+R13
+R13
+L26
+R44
+L344
+L98
+L88
+R201
+R50
+R21
+L17
+L20
+L49
+L17
+L83
+R14
+L14
+R169
+R85
+R46
+L7
+R7
+R719
+R5
+R15
+L39
+R640
+R60
+R573
+R592
+L65
+R74
+R26
+R59
+L59
+L4
+R64
+L60
+R370
+R71
+R59
+L30
+R30
+L14
+R414
+R29
+L561
+R32
+L64
+R64
+L42
+R24
+L482
+L89
+L11
+R86
+L69
+R24
+L5
+R76
+R88
+R61
+L61
+L16
+R816
+R56
+L96
+L460
+R60
+L14
+R76
+R49
+R888
+L59
+R71
+R29
+R53
+R347
+L90
+L10
+R35
+R88
+L635
+L5
+L637
+L16
+L30
+R89
+L59
+R70
+R99
+L305
+L22
+R82
+R599
+R33
+L582
+R96
+R931
+L231
+R51
+R78
+R11
+L40
+L42
+R85
+R568
+R618
+R921
+R50
+L68
+R68
+L52
+R52
+R5
+L5
+R8
+L53
+L60
+L27
+L51
+R34
+R53
+L4
+L26
+R72
+R148
+R35
+R68
+R103
+R55
+L14
+R59
+L136
+L54
+L93
+L17
+R64
+L8
+R88
+R556
+R12
+R38
+R50
+L73
+R79
+L824
+R418
+R53
+R761
+R786
+L513
+L87
+L65
+R7
+R1
+R22
+L65
+L17
+L86
+R858
+R12
+R12
+L696
+L2
+L81
+L26
+L74
+R86
+L4
+R18
+L38
+L62
+R94
+R6
+L95
+R56
+L61
+R36
+L94
+L47
+R98
+R7
+R41
+R59
+R30
+R54
+R16
+R69
+R31
+L88
+R11
+R86
+R91
+L30
+R30
+R6
+L6
+L94
+L6
+R93
+R67
+L61
+R1
+L84
+R84
+R81
+R37
+R34
+L87
+L62
+L65
+L30
+L8
+L97
+R15
+L22
+R9
+R28
+L16
+R44
+R30
+L2
+L6
+R1
+R36
+L27
+L28
+R23
+L4
+R39
+L46
+R40
+R13
+L28
+R1
+R45
+L37
+R6
+R18
+R37
+L6
+L41
+L27
+R11
+R13
+L12
+R40
+R18
+R46
+R49
+R46
+L29
+R35
+R48
+L10
+R10
+R16
+R40
+L26
+R42
+R6
+R30
+R19
+L43
diff --git a/src/language.c b/src/language.c
index a7154a8..dab442c 100644
--- a/src/language.c
+++ b/src/language.c
@@ -1,22 +1,26 @@
#define NO_MAIN
#include "language_meta.c"
#include "language_c.c"
+#include "language_aoc20251.c"
#include "language_generic.c"
typedef enum languages {
Language_Meta,
Language_C,
+ Language_AOC20251,
Language_Generic
} Language;
Language language_from_string(String name) {
- if (string_eqc(name, "meta")) { return Language_Meta; }
- if (string_eqc(name, "c")) { return Language_C; }
+ if (string_eqc(name, "meta")) { return Language_Meta; }
+ if (string_eqc(name, "c")) { return Language_C; }
+ if (string_eqc(name, "aoc20251")) { return Language_AOC20251; }
return Language_Generic;
}
static MetaParseFunction LANGUAGE_HIGHLIGHERS[] = {
language_meta_rule_main,
language_c_rule_main,
+ language_aoc20251_rule_main,
language_generic_rule_main,
};
diff --git a/src/meta/language_meta.c b/src/meta/language_meta.c
index 93ba806..73a5ff0 100644
--- a/src/meta/language_meta.c
+++ b/src/meta/language_meta.c
@@ -757,6 +757,7 @@ struct language_meta_Action89Vars {
MetaAction language_meta_rule_variableName(MetaParseState* parse_state);
MetaAction language_meta_rule_name(MetaParseState* parse_state);
MetaAction language_meta_rule_char(MetaParseState* parse_state);
+MetaAction language_meta_rule_nameSecond(MetaParseState* parse_state);
MetaAction language_meta_rule_lower(MetaParseState* parse_state);
MetaAction language_meta_rule_upper(MetaParseState* parse_state);
MetaAction language_meta_rule_number(MetaParseState* parse_state);
@@ -4119,7 +4120,7 @@ MetaAction language_meta_rule_name(MetaParseState* parse_state) {
star_start_pos = parse_state->pos;
while (1) {
star_pos = parse_state->pos;
- _ = language_meta_rule_char(parse_state);
+ _ = language_meta_rule_nameSecond(parse_state);
if (!_.valid) {
meta_parse_state_backtrack(parse_state, star_pos);
break;
@@ -4157,6 +4158,36 @@ MetaAction language_meta_rule_char(MetaParseState* parse_state) {
return meta_action_create_invalid();
}
+MetaAction language_meta_rule_nameSecond(MetaParseState* parse_state) {
+ unsigned int or_backtrack_pos;
+ unsigned int action_start_pos;
+ Highlight highlight = Highlight_None;
+ MetaAction _;
+ or_backtrack_pos = parse_state->pos;
+ meta_parse_state_backtrack(parse_state, or_backtrack_pos);
+ action_start_pos = parse_state->pos;
+ _ = language_meta_rule_lower(parse_state);
+ if (_.valid) {
+ meta_highlight_register(parse_state, action_start_pos, parse_state->pos, highlight);
+ return meta_action_create(NULL, NULL, parse_state->input_buffer, action_start_pos, parse_state->pos);
+ }
+ meta_parse_state_backtrack(parse_state, or_backtrack_pos);
+ action_start_pos = parse_state->pos;
+ _ = language_meta_rule_upper(parse_state);
+ if (_.valid) {
+ meta_highlight_register(parse_state, action_start_pos, parse_state->pos, highlight);
+ return meta_action_create(NULL, NULL, parse_state->input_buffer, action_start_pos, parse_state->pos);
+ }
+ meta_parse_state_backtrack(parse_state, or_backtrack_pos);
+ action_start_pos = parse_state->pos;
+ _ = language_meta_rule_digit(parse_state);
+ if (_.valid) {
+ meta_highlight_register(parse_state, action_start_pos, parse_state->pos, highlight);
+ return meta_action_create(NULL, NULL, parse_state->input_buffer, action_start_pos, parse_state->pos);
+ }
+ return meta_action_create_invalid();
+}
+
MetaAction language_meta_rule_lower(MetaParseState* parse_state) {
unsigned int or_backtrack_pos;
unsigned int action_start_pos;
diff --git a/src/meta/meta.meta b/src/meta/meta.meta
index a1347be..448aefb 100644
--- a/src/meta/meta.meta
+++ b/src/meta/meta.meta
@@ -540,9 +540,10 @@ stringEscape[Escape] = '\\' .;
ruleName[RuleName] = name:x -> { <prefix "rule_" x };
variableName[VariableName] = name;
-name = char char*;
+name = char nameSecond*;
char = lower | upper;
+nameSecond = lower | upper | digit;
lower = 'a'|'b'|'c'|'d'|'e'|'f'|'g'|'h'|'i'|'j'|'k'|'l'|'m'|'n'|'o'|'p'|'q'|'r'|'s'|'t'|'u'|'v'|'w'|'x'|'y'|'z';
upper = 'A'|'B'|'C'|'D'|'E'|'F'|'G'|'H'|'I'|'J'|'K'|'L'|'M'|'N'|'O'|'P'|'Q'|'R'|'S'|'T'|'U'|'V'|'W'|'X'|'Y'|'Z';
fatal: Invalid revision range 8a6fd343f30a8a46adca571e86a89a6e24cd3ce0..498672bc0dd8178cd18a5e4b40691f68063b888b