Skip to content

Commit fc0335c

Browse files
committed
2015-18 done
1 parent 2d9f4c7 commit fc0335c

15 files changed

+342
-56
lines changed

build.zig

+11-47
Original file line numberDiff line numberDiff line change
@@ -46,55 +46,19 @@ pub const Solution = struct {
4646
mode: RunMode = .RUN,
4747
};
4848

49-
pub const logo =
50-
\\
51-
\\ \__ __/
52-
\\ /_/ /\ \_\
53-
\\ __ \ \/ / __
54-
\\ \_\_\/\/_/_/
55-
\\ __/\___\_\/_/___/\__
56-
\\ \/ __/_/\_\__ \/
57-
\\ /_/ /\/\ \_\
58-
\\ __/ /\ \__
59-
\\ \_\ \/ /_/
60-
\\ / \
61-
\\
62-
\\
63-
;
49+
pub const logo = @embedFile("./logos/0000.txt");
6450

6551
pub const logos = [_][]const u8{
66-
\\
67-
\\ *
68-
\\ >o<
69-
\\ >>O<<
70-
\\ >>O<<<<
71-
\\ >@>O<<o<<
72-
\\ >o<<<O<<<@<
73-
\\ >o>>o<*<<o<<<
74-
\\ >>O<<@>>>O<*<o<
75-
\\ >O>>o<<O>>>*>>o<<
76-
\\ >>o<<@<<o>>@>>O>O<<
77-
\\ >>@<<<O<<<O<*>>O<<o<<
78-
\\ >o>o<o>>>o<<<O>>@>*<<<<
79-
\\ >@>@<<<o<<O<<O>>>@>>>*<<<
80-
\\ >O>>O<<@>>O<<@>>>@>o<O<<<*<
81-
\\ >O<o<<<*>>>@>>O>>>*>*>>>*<<<<
82-
\\ >>*>>*<<O<<*>>@<<<*<<<@<O<o<<@<
83-
\\ >>*<<<O>>*<<<*>o<*<<<*>>*<<<*<<O<
84-
\\ >>o>>>*<<o<<*<<O<<<@>>o>>*<@>>>o>@<
85-
\\ >O<o<<<o<O<<<o<<<o<<*<o<<o>>>*<@<<O<<
86-
\\ >o>O<*<<O<O<<@>>@>o>>>*>>*<<@>>*<<<@<<<
87-
\\ >o>>>O<<O<O>O>>>o>>>@<<<O<<<o>>>*<o<<O>o<
88-
\\ >>O>>@<<<o>>*>>*>>o<O>>>o<<<*>o>>>*>>@<*<<<
89-
\\ >>*<<<*<<o>o<<o<<<o>>>@>@>>@<@<o<O<<o>@<<@<<<
90-
\\ >>O<@>>@>>>O<<@<O<<<@<<<@>>@<*>>o<<<O<<<*>O>*<<
91-
\\ >o>@<<@<<O<<o>>>o<<O>>@>>@<<@<<*>>*>>o<O>>O>*<<@<
92-
\\ | |
93-
\\ | |
94-
\\ _ _ __ ___|___|___ __ _ _
95-
\\
96-
\\
97-
,
52+
@embedFile("./logos/2015.txt"),
53+
@embedFile("./logos/2016.txt"),
54+
@embedFile("./logos/2017.txt"),
55+
@embedFile("./logos/2018.txt"),
56+
@embedFile("./logos/2019.txt"),
57+
@embedFile("./logos/2020.txt"),
58+
@embedFile("./logos/2021.txt"),
59+
@embedFile("./logos/2022.txt"),
60+
@embedFile("./logos/2023.txt"),
61+
@embedFile("./logos/2024.txt"),
9862
};
9963

10064
pub fn build(b: *Build) !void {

logos/0000.txt

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
\__ __/
2+
/_/ /\ \_\
3+
__ \ \/ / __
4+
\_\_\/\/_/_/
5+
__/\___\_\/_/___/\__
6+
\/ __/_/\_\__ \/
7+
/_/ /\/\ \_\
8+
__/ /\ \__
9+
\_\ \/ /_/
10+
/ \

logos/2015.txt

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
*
2+
>o<
3+
>>O<<
4+
>>O<<<<
5+
>@>O<<o<<
6+
>o<<<O<<<@<
7+
>o>>o<*<<o<<<
8+
>>O<<@>>>O<*<o<
9+
>O>>o<<O>>>*>>o<<
10+
>>o<<@<<o>>@>>O>O<<
11+
>>@<<<O<<<O<*>>O<<o<<
12+
>o>o<o>>>o<<<O>>@>*<<<<
13+
>@>@<<<o<<O<<O>>>@>>>*<<<
14+
>O>>O<<@>>O<<@>>>@>o<O<<<*<
15+
>O<o<<<*>>>@>>O>>>*>*>>>*<<<<
16+
>>*>>*<<O<<*>>@<<<*<<<@<O<o<<@<
17+
>>*<<<O>>*<<<*>o<*<<<*>>*<<<*<<O<
18+
>>o>>>*<<o<<*<<O<<<@>>o>>*<@>>>o>@<
19+
>O<o<<<o<O<<<o<<<o<<*<o<<o>>>*<@<<O<<
20+
>o>O<*<<O<O<<@>>@>o>>>*>>*<<@>>*<<<@<<<
21+
>o>>>O<<O<O>O>>>o>>>@<<<O<<<o>>>*<o<<O>o<
22+
>>O>>@<<<o>>*>>*>>o<O>>>o<<<*>o>>>*>>@<*<<<
23+
>>*<<<*<<o>o<<o<<<o>>>@>@>>@<@<o<O<<o>@<<@<<<
24+
>>O<@>>@>>>O<<@<O<<<@<<<@>>@<*>>o<<<O<<<*>O>*<<
25+
>o>@<<@<<O<<o>>>o<<O>>@>>@<<@<<*>>*>>o<O>>O>*<<@<
26+
| |
27+
| |
28+
_ _ __ ___|___|___ __ _ _

logos/2016.txt

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
*
2+
|
3+
+-|---+
4+
/ | /|
5+
+-----+ |
6+
|:::::| |
7+
+----+ |:::::| |---+ +-----------+
8+
/ / \ |:::::| | /| / \\\\\\ [] /|
9+
/ / / \|:::::| | / | / \\\\\\ [] / |
10+
/ / / / \:::::|/ / | +-----------+ |
11+
+----+ / / / \------+ ------|:::::::::::| |
12+
|-----\ / / / \=====| ------|:::::::::::| |
13+
|------\ / / / \====| | |:::::::::::| |
14+
|-------\ / / / +===| | |:::::::::::| |
15+
|--------\ / / /|===| | |:::::::::::| |
16+
|---------\ / / |===| | /|:::::::::::| |
17+
|----------\ / |===| / //|:::::::::::| /
18+
+-----------+ |===| / //||:::::::::::|/
19+
|:::::::::::| |===|/__//___________________
20+
|:::::::::::| |______//|_____...._________
21+
|:::::::::::| | //| ____/ /_/___
22+
---|:::::::::::| |--------|[][]|_|[][]_\------
23+
----|:::::::::::| |---------------------------
24+
|| |:::::::::::| | //| || / / / || ||
25+
|| |:::::::::::| | //| || / / || ||
26+
|:::::::::::| |//| / / /
27+
|:::::::::::| //| / / ____________
28+
|:::::::::::| //| / / /___/ /#/ /#/#/ /
29+
|:::::::::::| //| / ___ /
30+
|:::::::::::|//| / / / /_/_/_/#/#/#/
31+
==============//======+...+====================
32+
- - - - - - -// - - -/ / - - - - - - - - - -
33+
==============//|==============================
34+
//|

logos/2017.txt

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.-----------------------------------------------.
2+
| o───────────┤|├────*───────────┐┌─∧∧∧────┬──o |
3+
| *──────────[─]─────┘V┌┬───────o│├───────o└──┐ |
4+
| └┬───────────*┌─────┴┘└───┬────┘=┌─────oTo──┤ |
5+
| V├o┌────┬┴┴┴┴┴┤┌─────────*└────┬─┘o────────┐│ |
6+
| └┤V└────┤ ├┴────────o└─┐o──┘┌┴┴┴┴┬───*V├┘ |
7+
| V└┴─────┤ ├*─┬┴┴┴┴┴┬─┐┌┘┌───┤ S├───┘└┴┐ |
8+
| └───────┤ ├└─┤ ├*│└─┴──o┤ R├────┬o│ |
9+
| *───────┤ i386├──┤ ├┘└─────┐┤ A├─┐┌─┘┌┘ |
10+
| ├─┬┴┴┴┴┬┴┬┬┬┬┬┴──┤ v17 ├─────*o┴┤ M├─┘└──┴o |
11+
| └─┤ ├─o┌──────┴┬┬┬┬┬┴┬────┘┌─┤ ├──────* |
12+
| ┌─┤ ├─┐└───────────┐o┘┌───┐│o┴┬┬┬┬┤*─────┘ |
13+
| └─┤ x├─┘*───────┐┌─┐└──┴──o└┴──────┘└─────┐ |
14+
| *─┤ 6├─┐└─────┐┌┘└┐└───┬┴┴┴┬──────────────┤ |
15+
| └─┤ 4├─┘┌─────┘├──┘┌───┤ 8├────*o────┬───┘ |
16+
| ┌─┴┬┬┬┬┤o─┴───┐┌o│┌──┘┌──┤ 0├───o└────┐=┌──* |
17+
| ├┐o────┴──────┘├─┘│o──┴──┤ 8├┐*──────┐└─┴o┌┤ |
18+
| =└──┬┴┴┴┬─┐┌┐o─┴─o│┌─────┤ 8├┘└────*V└────┘│ |
19+
| ┌───┤ we├─┼┴┴┴┬───┘└─────┴┬┬┬┤*─────┘└─┬───o│ |
20+
| └───┤ h(├─┤ ├───∧∧∧────────┤└─────*┌─┘┌──┐│ |
21+
| *───┤ i1├─┤ ├┌────────────┐│o┐┌───┘└──┴─o└┘ |
22+
| ├───┤ l)├o┤ ├┘o──┬────o┌──┘└─┘└──┐┌──|(───* |
23+
| │o─┬┴┬┬┬┴─┴┬┬┬┴─┬─┐└─────┴─────────┘└┐*─────┘ |
24+
| └──┘o┴─┴o*─────┐└o└──────────────────┘└─────┐ |
25+
| *────────┘o────┴─∧∧∧─┤[]├────────┐┌─────────┤ |
26+
| └──────[─]─┤[]├┤[]├───*o─────────┴┘o────────┘ |
27+
'-----------------------------------------------'

logos/2018.txt

Whitespace-only changes.

logos/2019.txt

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
. . . ''.. ':. .'.
2+
....... ''. '. :
3+
. '''''... ''. '. '
4+
. ''.. . '. '.
5+
...... ''. '. '. . .
6+
''''... '. '. :
7+
. ''... '. '. '. .
8+
..... . ''.. '. '. '. . .
9+
. . ''''... '. .'. ': '.
10+
. '.. '. '. : :
11+
. '. '. '. : :
12+
'''''... . '. .'. '. : . '..
13+
. ''.. '. '. '. . '. :
14+
''''... '. '. '. '. : :
15+
''. '. : . '. : '. :
16+
'''''.. '. '. : : '. : '.
17+
'. '. '. .'. : : : :
18+
: '. . : : : : : :
19+
'''. : : : :. . : : : :
20+
: : : .: : . : : . .: . :
21+
...' . : : : : : : : :
22+
. : .' : :. . : : . : :
23+
. .' .' .' .' : : : :
24+
.....'' .' .'.. : . : .' : .'
25+
..' .' : . .' : .' :.

logos/2020.txt

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
..........|..........
2+
.....'''''' .' - - - .''~ ~ ''''''.....
3+
''' ~ ~ ~ ~ ~ '.'. - - -'': ~ ~ ~ ~ '''
4+
~ ~ ~ ~ ~ ~ ''..'''. .' ~ ~ ~ ~ ~
5+
~ ~ ~ .'. ~ ~ ~ ~ '' ~ ~ ~ ~ ~ ~
6+
~ ~ '' .. ~ ~ ~ ~ ~ _ ~ _ O>
7+
~ ~ ~ ~ : '. ~ ~ ~ \ / \ / \ / ~
8+
~ '.' ~ ~ ~ ~ ~ ~ ~
9+
~ ~ ~ ~ ~ ~ ~ ~
10+
~ ~ .''''.. ~ ~ .
11+
~ ~ ~ .'^ , .' ~ ~ ..''
12+
... ~ ~ :^ , : ~ :'' , ^
13+
###: ... ~ ~ '..' ~ '. ,
14+
.'' .'##'. ~ ~ ~ : , ^
15+
'...'#####'. ~ ~ ~ .'' , ^ ^
16+
##### ,###.' . ~ '. , ^
17+
#, , '. ~ .'',: ~ '.. , ^
18+
~ ~ , ,'. ~ :, ..' ~ ''...
19+
~ ~ ~ ~ , : '' ~
20+
~ ~ ~ ~ ~ , ,: ~ ~ ~ ~
21+
~ ~ ~ ~ ~ , .'
22+
~ ~ ~ ..' ~ ~ ~ ~
23+
.....''' ~ ~
24+
'' ~ .'.. .''.. ~
25+
~ ~ ~ '.' : .' ~

logos/2021.txt

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2+
. . ' . ~ . . ' ..''''
3+
. . . . . :
4+
. . '... .' ....'
5+
.. . . .. ' . . . ..|\..''
6+
. .' . .. ~ :
7+
. .~ .' ' . . :'
8+
. .' . . '''''..... ....
9+
~ . :'.. .. '' ':
10+
. .. .. . . '... ' : '' ''''.. '.
11+
. .. : '..'. :
12+
~ . . . . : :'''.. ..' :
13+
.' .. . . .' ..'' ''' ...:
14+
. . ' : ...'' ..': ....'
15+
. . . . :' ...''' '''
16+
'.'. . . :'. ....'
17+
: . ' . . : '
18+
: . ..'
19+
'. :
20+
'. :
21+
: .. :
22+
'. :
23+
: .'
24+
: .'
25+
:..:

logos/2022.txt

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
- /\ - - - - - - -
2+
- / \/\ - - - - - - /\ - -
3+
#@@@#@#@@@@##@@##@@@@@@@@@@@@@@#@@@@@@@@@@###@@@#
4+
@|@@@|@@@@@#@@@@@@@@#@@@#@@###@##@@@@@@@@@@@#@@@@
5+
@@@@@@@@@##@##@@@@@@@@@@@@@@###@#@##@@@@@@@@@@@@@
6+
@@@@##@@@##@@#@@@@@@#@#@@##@@@@@#@@##@@@#@#@@@##@
7+
@@@##@##@@@#@@##@#@#@#@#@@##@#@@#@@#@#@@@@@@@@@##
8+
@#@##@@@##@@@@@##@@@@#@@#@@###@@#@@@@##@##@#@@###
9+
@@#@@#@##@#@#@@@@#@@@@##@@@@#@#@@#@###@@@#@@@@@@@
10+
@#@#@@#@@@@@@##@@@@@@@#@@@@#@#@#@#@@@@@#@###@##@@
11+
@@@##@#@##@@@##@@@@@@@@@@#@@@@#@@@#@@#@#@@@#@@@@@
12+
@#@#@@@##@@#@@@@@@#@@@@##@##@@@@##@#@@@#@@@##@@@#
13+
####@@@##@@@@####@@@#@@@@#@#@@@##@@@@##@@@#@@@@#@
14+
@@@@@@@@@#@@#@#@@@@@@@##@@##@@#@|##@@@@##@@@@#@@#
15+
@#@@#@@@@#@#@@@####@@@@@#@#@@@#@@@@@@@@@@@@@#@@@@
16+
@@@##@@@@@@@@@#@@@@###@@@@##|#@@@##@@#@@@@@##@#@@
17+
@##@#@@#@@@@@@@#@@@@#@@@#@##@#@#@@@@##@#@@@@@@@##
18+
#@@@@@@#@#@@###@@@@#@@@@##@@###@@@@#@@@@@#@@@@@@@
19+
#@@#@@@@#@@@@####@@@#@@#@###@@@@@#@##@@@#@@#@###@
20+
@#@@@@#@@#@#@#@#@@@@#@@@#@#@@@@@@###@@@@@#@#@#@@#
21+
@@@##@@#@@@@@@@#@##@#@@@@@@##@@##@@@#@@@@#@#@@##@
22+
#@#@@@##@@#@#@#@##@@@@@#@#@@@#@@##@#@#@##@@@#@@@#
23+
@@@#@@@@@@#@##@#@@#@@@@@@@@@#@@@@@@@#@@#@@@@@@###
24+
@#@@@@@@@@@@@#@####@@###@@@@@##@@@@@#@#@#@@@@@@@@
25+
@@@@@@@@@##@@@#@@@###@@@@@@@#@#@@@#@@@####@@#@@@@
26+
##@@#@#@@@@@@@#@@@#@@##@@#@@##@##@##@#|@@@@@@@@@@
27+
#@@@@@#@##@@#@##@##@@@#@@#@@#@@@@@#@@#@@@@@#@@@@#

logos/2023.txt

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
...'''''''''...
2+
.'' ~/\* . '
3+
.' /\/\ .' . * '
4+
... : '. . . ' /\ *
5+
.''....' '..'. './\*/\ ~
6+
'.ZZ * '.. /\
7+
.'''' ZZ* .'''. ''''.... .. . '
8+
'.... '...' * ....'
9+
.'* '.
10+
'..''''.*.''''..'' ''...
11+
.'''~ ~ ~ ~ * ### ''.
12+
.' ~ ,* ~ ~ ~ ~ ##### '.
13+
: ~ '(~), ~ * ~ ~ ~ ### :
14+
'. ~ " ' ~ ~ ~ * ##### .'
15+
'.. ~ ~ * ~ ##### ..'.'''''''''...
16+
'''.........'''' ~ .'*. ~ .. ''.
17+
.' ~ '...' ~'* '.~ '.
18+
: ~ '. *'.~ :
19+
...'''''. * .''.~ '..' .'
20+
.'' '.. ~..'* '. ~ ..'
21+
.' * '''../......'''
22+
: * /\ -/ :
23+
'. * - - / .'
24+
'.. - - *..'
25+
----@ '''..*......'''
26+
* ! /^\

logos/2024.txt

Whitespace-only changes.

readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# AoC Solution Archive in Zig
1+
# aoc.zig
22

33
## Requirements
44

solutions/2015/17.zig

+8-8
Original file line numberDiff line numberDiff line change
@@ -71,28 +71,28 @@ fn make_dp(dp: [][EGGNOG_QTY + 1]Aaaaa, containers: std.ArrayList(u8), idx: usiz
7171
var jj: usize = 0;
7272

7373
while (ii < len0 and jj < len1) {
74-
const aa = dp[idx + 1][en].items[ii];
75-
const bb = dp[idx + 1][en + containers.items[idx]].items[jj];
76-
switch (order(aa[0], bb[0] + 1)) {
74+
const combinations_without_this_container = dp[idx + 1][en].items[ii];
75+
const possibilities_with_this_container = dp[idx + 1][en + containers.items[idx]].items[jj];
76+
switch (order(combinations_without_this_container[0], possibilities_with_this_container[0] + 1)) {
7777
.lt => {
78-
try dp[idx][en].append(aa);
78+
try dp[idx][en].append(combinations_without_this_container);
7979
ii += 1;
8080
},
8181
.gt => {
82-
try dp[idx][en].append(.{ bb[0] + 1, bb[1] });
82+
try dp[idx][en].append(.{ possibilities_with_this_container[0] + 1, possibilities_with_this_container[1] });
8383
jj += 1;
8484
},
8585
.eq => {
86-
try dp[idx][en].append(.{ aa[0], aa[1] + bb[1] });
86+
try dp[idx][en].append(.{ combinations_without_this_container[0], combinations_without_this_container[1] + possibilities_with_this_container[1] });
8787
ii += 1;
8888
jj += 1;
8989
},
9090
}
9191
}
9292
while (ii < len0) : (ii += 1) try dp[idx][en].append(dp[idx + 1][en].items[ii]);
9393
while (jj < len1) : (jj += 1) {
94-
const aa = dp[idx + 1][en + containers.items[idx]].items[jj];
95-
try dp[idx][en].append(.{ aa[0] + 1, aa[1] });
94+
const possibilities_with_this_container = dp[idx + 1][en + containers.items[idx]].items[jj];
95+
try dp[idx][en].append(.{ possibilities_with_this_container[0] + 1, possibilities_with_this_container[1] });
9696
}
9797

9898
return dp[idx][en].items.len != 0;

0 commit comments

Comments
 (0)