This commit is contained in:
Zack Buhman 2025-12-07 14:53:57 -06:00
commit 4edb4a3449
23 changed files with 13331 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*.o
*.d
main

150
Makefile Normal file
View File

@ -0,0 +1,150 @@
.SUFFIXES:
.INTERMEDIATE:
.SECONDARY:
.PHONY: all clean
MAKEFILE_PATH := $(patsubst %/,%,$(dir $(abspath $(firstword $(MAKEFILE_LIST)))))
DEBUG = -g
CSTD += -std=gnu23
CXXSTD += -std=gnu++23
CFLAGS += -Wall -Werror -Wfatal-errors
CFLAGS += -Wno-error=unused-function
CFLAGS += -Wno-error=unused-const-variable
CFLAGS += -Wno-error=unused-but-set-variable
CFLAGS += -Wno-error=unused-variable
CFLAGS += -I$(MAKEFILE_PATH)/include
CFLAGS += -I$(MAKEFILE_PATH)/puzzle
CXXFLAGS += -fno-exceptions
#CFLAGS += -DDEBUG_BUTTONS
#CFLAGS += -DDEBUG_AXES
LDFLAGS += -nostdlib++ -lm -static-libgcc
ifeq ($(OS),Windows_NT)
LDFLAGS += -Wl,--subsystem,windows -mwindows
endif
ifndef GLFW
$(error GLFW undefined)
endif
ifdef I386
ARCH='-m32'
endif
ifeq ($(shell uname),Linux)
LDFLAGS += -z noexecstack
ifdef I386
OBJARCH = -O elf32-i386 -B i386
else
OBJARCH = -O elf64-x86-64 -B i386:x86-64
endif
else
ifdef I386
OBJARCH += -O pe-i386 -B i386
else
OBJARCH += -O pe-x86-64 -B i386:x86-64
endif
endif # ifeq ($(shell uname),Linux)
DEPFLAGS = -MMD -MP
OPT = -Og
all: main
define BUILD_BINARY_O
objcopy \
-I binary $(OBJARCH) \
--rename-section .data=.data.$(basename $@) \
$< $@
endef
makefile_path := $(dir $(abspath $(firstword $(MAKEFILE_LIST))))
makefile_relative = $(shell realpath --relative-to $(makefile_path) $(1))
as_obj_binary = $(subst -,_,$(subst .,_,$(subst /,_,$(subst .h,,$(call makefile_relative,$(1))))))
as_obj_binary_p = _binary_$(call as_obj_binary,$(1))
define BUILD_BINARY_H
@echo gen $(call makefile_relative,$@)
@echo '#pragma once' > $@
@echo '' >> $@
@echo '#include <stdint.h>' >> $@
@echo '' >> $@
@echo '#ifdef __cplusplus' >> $@
@echo 'extern "C" {' >> $@
@echo '#endif' >> $@
@echo '' >> $@
@echo 'extern uint32_t $(call as_obj_binary_p,$<)_start __asm("$(call as_obj_binary_p,$<)_start");' >> $@
@echo 'extern uint32_t $(call as_obj_binary_p,$<)_end __asm("$(call as_obj_binary_p,$<)_end");' >> $@
@echo 'extern uint32_t $(call as_obj_binary_p,$<)_size __asm("$(call as_obj_binary_p,$<)_size");' >> $@
@echo '' >> $@
@echo '#define $(call as_obj_binary,$<)_start ((const char *)&$(call as_obj_binary_p,$<)_start)' >> $@
@echo '#define $(call as_obj_binary,$<)_end ((const char *)&$(call as_obj_binary_p,$<)_end)' >> $@
@echo '#define $(call as_obj_binary,$<)_size ($(call as_obj_binary,$<)_end - $(call as_obj_binary,$<)_start)' >> $@
@echo '' >> $@
@echo '#ifdef __cplusplus' >> $@
@echo '}' >> $@
@echo '#endif' >> $@
endef
%.glsl.o: %.glsl
$(BUILD_BINARY_O)
include/%.glsl.h: src/%.glsl
$(BUILD_BINARY_H)
%.data.o: %.data
$(BUILD_BINARY_O)
include/%.data.h: src/%.data
$(BUILD_BINARY_H)
%.data.pal.o: %.data.pal
$(BUILD_BINARY_O)
include/%.data.pal.h: src/%.data.pal
$(BUILD_BINARY_H)
%/input.o: %/input
$(BUILD_BINARY_O)
%/input.h: %/input
$(BUILD_BINARY_H)
clean:
rm -f *.o *.d *.gch
rm -f main
%.o: %.cpp
$(CXX) $(CXXSTD) $(ARCH) $(CFLAGS) $(OPT) $(DEBUG) $(DEPFLAGS) -MF ${<}.d -c $< -o $@
%.o: %.c
$(CC) $(CSTD) $(ARCH) $(CFLAGS) $(CXXFLAGS) $(OPT) $(DEBUG) $(DEPFLAGS) -MF ${<}.d -c $< -o $@
MAIN_OBJS = \
src/main.o \
src/glad.o \
src/opengl.o \
$(GLFW)
main: $(MAIN_OBJS)
$(CXX) $^ $(CXXFLAGS) $(ARCH) -o $@ $(LDFLAGS)
#-include $(shell find -type f -name 'src/*.d')
.SUFFIXES:
.INTERMEDIATE:
.SECONDARY:
.PHONY: all clean
%: RCS/%,v
%: RCS/%
%: %,v
%: s.%
%: SCCS/s.%

3661
include/glad.h Normal file

File diff suppressed because it is too large Load Diff

25
include/opengl.h Normal file
View File

@ -0,0 +1,25 @@
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
unsigned int compile_shader(const void * vp,
const int vp_length,
const void * fp,
const int fp_length);
int make_buffer(unsigned int target,
const void * data,
size_t size);
int make_texture(const void * data,
int internalformat,
int width,
int height,
int format,
int type);
#ifdef __cplusplus
}
#endif

4147
puzzle/2025/01/input Normal file

File diff suppressed because it is too large Load Diff

19
puzzle/2025/01/input.h Normal file
View File

@ -0,0 +1,19 @@
#pragma once
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
extern uint32_t _binary_puzzle_2025_01_input_start __asm("_binary_puzzle_2025_01_input_start");
extern uint32_t _binary_puzzle_2025_01_input_end __asm("_binary_puzzle_2025_01_input_end");
extern uint32_t _binary_puzzle_2025_01_input_size __asm("_binary_puzzle_2025_01_input_size");
#define puzzle_2025_01_input_start ((const char *)&_binary_puzzle_2025_01_input_start)
#define puzzle_2025_01_input_end ((const char *)&_binary_puzzle_2025_01_input_end)
#define puzzle_2025_01_input_size (puzzle_2025_01_input_end - puzzle_2025_01_input_start)
#ifdef __cplusplus
}
#endif

161
puzzle/2025/01/prompt.html Normal file
View File

@ -0,0 +1,161 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8"/>
<title>Day 1 - Advent of Code 2025</title>
<link rel="stylesheet" type="text/css" href="/static/style.css?32"/>
<link rel="stylesheet alternate" type="text/css" href="/static/highcontrast.css?2" title="High Contrast"/>
<link rel="shortcut icon" href="/favicon.png"/>
<script>window.addEventListener('click', function(e,s,r){if(e.target.nodeName==='CODE'&&e.detail===3){s=window.getSelection();s.removeAllRanges();r=document.createRange();r.selectNodeContents(e.target);s.addRange(r);}});</script>
</head><!--
Oh, hello! Funny seeing you here.
I appreciate your enthusiasm, but you aren't going to find much down here.
There certainly aren't clues to any of the puzzles. The best surprises don't
even appear in the source until you unlock them for real.
Please be careful with automated requests; I'm not a massive company, and I can
only take so much traffic. Please be considerate so that everyone gets to play.
If you're curious about how Advent of Code works, it's running on some custom
Perl code. Other than a few integrations (auth, analytics, social media), I
built the whole thing myself, including the design, animations, prose, and all
of the puzzles.
The puzzles are most of the work; preparing a new calendar and a new set of
puzzles takes all of my free time for months every year. A lot of effort went
into building this thing - I hope you're enjoying playing it as much as I
enjoyed making it for you!
If you'd like to hang out, I'm @was.tl on Bluesky and @ericwastl@hachyderm.io
on Mastodon.
- Eric Wastl
-->
<body>
<header><div><h1 class="title-global"><a href="/">Advent of Code</a></h1><nav><ul><li><a href="/2025/about">[About]</a></li><li><a href="/2025/events">[Events]</a></li><li><a href="/2025/shop">[Shop]</a></li><li><a href="/2025/settings">[Settings]</a></li><li><a href="/2025/auth/logout">[Log Out]</a></li></ul></nav><div class="user">buhman</div></div><div><h1 class="title-event">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">/*</span><a href="/2025">2025</a><span class="title-event-wrap">*/</span></h1><nav><ul><li><a href="/2025">[Calendar]</a></li><li><a href="/2025/support">[AoC++]</a></li><li><a href="/2025/sponsors">[Sponsors]</a></li><li><a href="/2025/leaderboard/private">[Leaderboards]</a></li><li><a href="/2025/stats">[Stats]</a></li></ul></nav></div></header>
<div id="sidebar">
<div id="sponsor"><div class="quiet">Our <a href="/2025/sponsors">sponsors</a> help make Advent of Code possible:</div><div class="sponsor"><a href="/2025/sponsors/redirect?url=https%3A%2F%2Fcoderabbit%2Elink%2Fadventofcode" target="_blank" onclick="if(ga)ga('send','event','sponsor','sidebar',this.href);" rel="noopener">CodeRabbit</a> - Cut Code Review Time and Bugs in Half</div></div>
</div><!--/sidebar-->
<main>
<article class="day-desc"><h2>--- Day 1: Secret Entrance ---</h2><p>The Elves have good news and bad news.</p>
<p>The good news is that they've discovered <a href="https://en.wikipedia.org/wiki/Project_management" target="_blank">project management</a>! This has given them the tools they need to prevent their usual Christmas emergency. For example, they now know that the North Pole decorations need to be finished soon so that other critical tasks can start on time.</p>
<p>The bad news is that they've realized they have a <em>different</em> emergency: according to their resource planning, none of them have any time left to decorate the North Pole!</p>
<p>To save Christmas, the Elves need <em>you</em> to <em>finish decorating the North Pole by December 12th</em>.</p>
<p>Collect stars by solving puzzles. Two puzzles will be made available on each day; the second puzzle is unlocked when you complete the first. Each puzzle grants <em class="star">one star</em>. Good luck!</p>
<p>You arrive at the secret entrance to the North Pole base ready to start decorating. Unfortunately, the <em>password</em> seems to have been changed, so you can't get in. A document taped to the wall helpfully explains:</p>
<p>"Due to new security protocols, the password is locked in the safe below. Please see the attached document for the new combination."</p>
<p>The safe has a dial with only an arrow on it; around the dial are the numbers <code>0</code> through <code>99</code> in order. As you turn the dial, it makes a small <em>click</em> noise as it reaches each number.</p>
<p>The attached document (your puzzle input) contains a sequence of <em>rotations</em>, one per line, which tell you how to open the safe. A rotation starts with an <code>L</code> or <code>R</code> which indicates whether the rotation should be to the <em>left</em> (toward lower numbers) or to the <em>right</em> (toward higher numbers). Then, the rotation has a <em>distance</em> value which indicates how many clicks the dial should be rotated in that direction.</p>
<p>So, if the dial were pointing at <code>11</code>, a rotation of <code>R8</code> would cause the dial to point at <code>19</code>. After that, a rotation of <code>L19</code> would cause it to point at <code>0</code>.</p>
<p>Because the dial is a circle, turning the dial <em>left from <code>0</code></em> one click makes it point at <code>99</code>. Similarly, turning the dial <em>right from <code>99</code></em> one click makes it point at <code>0</code>.</p>
<p>So, if the dial were pointing at <code>5</code>, a rotation of <code>L10</code> would cause it to point at <code>95</code>. After that, a rotation of <code>R5</code> could cause it to point at <code>0</code>.</p>
<p>The dial starts by pointing at <code>50</code>.</p>
<p>You could follow the instructions, but your recent required official North Pole secret entrance security training seminar taught you that the safe is actually a decoy. The actual password is <em>the number of times the dial is left pointing at <code>0</code> after any rotation in the sequence</em>.</p>
<p>For example, suppose the attached document contained the following rotations:</p>
<pre><code>L68
L30
R48
L5
R60
L55
L1
L99
R14
L82
</code></pre>
<p>Following these rotations would cause the dial to move as follows:</p>
<ul>
<li>The dial starts by pointing at <code>50</code>.</li>
<li>The dial is rotated <code>L68</code> to point at <code>82</code>.</li>
<li>The dial is rotated <code>L30</code> to point at <code>52</code>.</li>
<li>The dial is rotated <code>R48</code> to point at <code><em>0</em></code>.</li>
<li>The dial is rotated <code>L5</code> to point at <code>95</code>.</li>
<li>The dial is rotated <code>R60</code> to point at <code>55</code>.</li>
<li>The dial is rotated <code>L55</code> to point at <code><em>0</em></code>.</li>
<li>The dial is rotated <code>L1</code> to point at <code>99</code>.</li>
<li>The dial is rotated <code>L99</code> to point at <code><em>0</em></code>.</li>
<li>The dial is rotated <code>R14</code> to point at <code>14</code>.</li>
<li>The dial is rotated <code>L82</code> to point at <code>32</code>.</li>
</ul>
<p>Because the dial points at <code>0</code> a total of three times during this process, the password in this example is <code><em>3</em></code>.</p>
<p>Analyze the rotations in your attached document. <em>What's the actual password to open the door?</em></p>
</article>
<p>To begin, <a href="1/input" target="_blank">get your puzzle input</a>.</p>
<form method="post" action="1/answer"><input type="hidden" name="level" value="1"/><p>Answer: <input type="text" name="answer" autocomplete="off"/> <input type="submit" value="[Submit]"/></p></form>
<p>You can also <span class="share">[Share<span class="share-content">on
<a href="https://bsky.app/intent/compose?text=%22Secret+Entrance%22+%2D+Day+1+%2D+Advent+of+Code+2025+%23AdventOfCode+https%3A%2F%2Fadventofcode%2Ecom%2F2025%2Fday%2F1" target="_blank">Bluesky</a>
<a href="https://twitter.com/intent/tweet?text=%22Secret+Entrance%22+%2D+Day+1+%2D+Advent+of+Code+2025&amp;url=https%3A%2F%2Fadventofcode%2Ecom%2F2025%2Fday%2F1&amp;related=ericwastl&amp;hashtags=AdventOfCode" target="_blank">Twitter</a>
<a href="javascript:void(0);" onclick="var ms; try{ms=localStorage.getItem('mastodon.server')}finally{} if(typeof ms!=='string')ms=''; ms=prompt('Mastodon Server?',ms); if(typeof ms==='string' && ms.length){this.href='https://'+ms+'/share?text=%22Secret+Entrance%22+%2D+Day+1+%2D+Advent+of+Code+2025+%23AdventOfCode+https%3A%2F%2Fadventofcode%2Ecom%2F2025%2Fday%2F1';try{localStorage.setItem('mastodon.server',ms);}finally{}}else{return false;}" target="_blank">Mastodon</a
></span>]</span> this puzzle.</p>
</main>
<!-- ga -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-69522494-1', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
</script>
<!-- /ga -->
</body>
</html>

1
puzzle/2025/02/input Normal file
View File

@ -0,0 +1 @@
5542145-5582046,243-401,884211-917063,1174-1665,767028-791710,308275-370459,285243789-285316649,3303028-3361832,793080-871112,82187-123398,7788-14096,21-34,33187450-33443224,2750031-2956556,19974-42168,37655953-37738891,1759-2640,55544-75026,9938140738-9938223673,965895186-966026269,502675-625082,11041548-11204207,1-20,3679-7591,8642243-8776142,40-88,2872703083-2872760877,532-998,211488-230593,3088932-3236371,442734-459620,8484829519-8484873271,5859767462-5859911897,9987328-10008767,656641-673714,262248430-262271846

144
puzzle/2025/02/prompt.html Normal file
View File

@ -0,0 +1,144 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8"/>
<title>Day 2 - Advent of Code 2025</title>
<link rel="stylesheet" type="text/css" href="/static/style.css?32"/>
<link rel="stylesheet alternate" type="text/css" href="/static/highcontrast.css?2" title="High Contrast"/>
<link rel="shortcut icon" href="/favicon.png"/>
<script>window.addEventListener('click', function(e,s,r){if(e.target.nodeName==='CODE'&&e.detail===3){s=window.getSelection();s.removeAllRanges();r=document.createRange();r.selectNodeContents(e.target);s.addRange(r);}});</script>
</head><!--
Oh, hello! Funny seeing you here.
I appreciate your enthusiasm, but you aren't going to find much down here.
There certainly aren't clues to any of the puzzles. The best surprises don't
even appear in the source until you unlock them for real.
Please be careful with automated requests; I'm not a massive company, and I can
only take so much traffic. Please be considerate so that everyone gets to play.
If you're curious about how Advent of Code works, it's running on some custom
Perl code. Other than a few integrations (auth, analytics, social media), I
built the whole thing myself, including the design, animations, prose, and all
of the puzzles.
The puzzles are most of the work; preparing a new calendar and a new set of
puzzles takes all of my free time for months every year. A lot of effort went
into building this thing - I hope you're enjoying playing it as much as I
enjoyed making it for you!
If you'd like to hang out, I'm @was.tl on Bluesky and @ericwastl@hachyderm.io
on Mastodon.
- Eric Wastl
-->
<body>
<header><div><h1 class="title-global"><a href="/">Advent of Code</a></h1><nav><ul><li><a href="/2025/about">[About]</a></li><li><a href="/2025/events">[Events]</a></li><li><a href="/2025/shop">[Shop]</a></li><li><a href="/2025/settings">[Settings]</a></li><li><a href="/2025/auth/logout">[Log Out]</a></li></ul></nav><div class="user">buhman</div></div><div><h1 class="title-event">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">/^</span><a href="/2025">2025</a><span class="title-event-wrap">$/</span></h1><nav><ul><li><a href="/2025">[Calendar]</a></li><li><a href="/2025/support">[AoC++]</a></li><li><a href="/2025/sponsors">[Sponsors]</a></li><li><a href="/2025/leaderboard/private">[Leaderboards]</a></li><li><a href="/2025/stats">[Stats]</a></li></ul></nav></div></header>
<div id="sidebar">
<div id="sponsor"><div class="quiet">Our <a href="/2025/sponsors">sponsors</a> help make Advent of Code possible:</div><div class="sponsor"><a href="/2025/sponsors/redirect?url=https%3A%2F%2Fwww%2Edoppler%2Ecom%2Fadvent%2Dof%2Dcode%2D2025%3Fcoupon%3D4xsedlxM" target="_blank" onclick="if(ga)ga('send','event','sponsor','sidebar',this.href);" rel="noopener">Doppler</a> - No more .env headaches. Doppler automates secrets across CI/CD and every environment. Secure secrets. Ship faster. Try for free today!</div></div>
</div><!--/sidebar-->
<main>
<article class="day-desc"><h2>--- Day 2: Gift Shop ---</h2><p>You get inside and take the elevator to its only other stop: the gift shop. "Thank you for visiting the North Pole!" gleefully exclaims a nearby sign. You aren't sure who is even allowed to visit the North Pole, but you know you can access the lobby through here, and from there you can access the rest of the North Pole base.</p>
<p>As you make your way through the <span title="They even sell lunch boxes and blue tents!">surprisingly extensive</span> selection, one of the clerks recognizes you and asks for your help.</p>
<p>As it turns out, one of the younger Elves was playing on a gift shop computer and managed to add a whole bunch of invalid product IDs to their gift shop database! Surely, it would be no trouble for you to identify the invalid product IDs for them, right?</p>
<p>They've even checked most of the product ID ranges already; they only have a few product ID ranges (your puzzle input) that you'll need to check. For example:</p>
<pre><code>11-22,95-115,998-1012,1188511880-1188511890,222220-222224,
1698522-1698528,446443-446449,38593856-38593862,565653-565659,
824824821-824824827,2121212118-2121212124</code></pre>
<p>(The ID ranges are wrapped here for legibility; in your input, they appear on a single long line.)</p>
<p>The ranges are separated by commas (<code>,</code>); each range gives its <em>first ID</em> and <em>last ID</em> separated by a dash (<code>-</code>).</p>
<p>Since the young Elf was just doing silly patterns, you can find the <em>invalid IDs</em> by looking for any ID which is made only of some sequence of digits repeated twice. So, <code>55</code> (<code>5</code> twice), <code>6464</code> (<code>64</code> twice), and <code>123123</code> (<code>123</code> twice) would all be invalid IDs.</p>
<p>None of the numbers have leading zeroes; <code>0101</code> isn't an ID at all. (<code>101</code> is a <em>valid</em> ID that you would ignore.)</p>
<p>Your job is to find all of the invalid IDs that appear in the given ranges. In the above example:</p>
<ul>
<li><code>11-22</code> has two invalid IDs, <code><em>11</em></code> and <code><em>22</em></code>.</li>
<li><code>95-115</code> has one invalid ID, <code><em>99</em></code>.</li>
<li><code>998-1012</code> has one invalid ID, <code><em>1010</em></code>.</li>
<li><code>1188511880-1188511890</code> has one invalid ID, <code><em>1188511885</em></code>.</li>
<li><code>222220-222224</code> has one invalid ID, <code><em>222222</em></code>.</li>
<li><code>1698522-1698528</code> contains no invalid IDs.</li>
<li><code>446443-446449</code> has one invalid ID, <code><em>446446</em></code>.</li>
<li><code>38593856-38593862</code> has one invalid ID, <code><em>38593859</em></code>.</li>
<li>The rest of the ranges contain no invalid IDs.</li>
</ul>
<p>Adding up all the invalid IDs in this example produces <code><em>1227775554</em></code>.</p>
<p><em>What do you get if you add up all of the invalid IDs?</em></p>
</article>
<p>To begin, <a href="2/input" target="_blank">get your puzzle input</a>.</p>
<form method="post" action="2/answer"><input type="hidden" name="level" value="1"/><p>Answer: <input type="text" name="answer" autocomplete="off"/> <input type="submit" value="[Submit]"/></p></form>
<p>You can also <span class="share">[Share<span class="share-content">on
<a href="https://bsky.app/intent/compose?text=%22Gift+Shop%22+%2D+Day+2+%2D+Advent+of+Code+2025+%23AdventOfCode+https%3A%2F%2Fadventofcode%2Ecom%2F2025%2Fday%2F2" target="_blank">Bluesky</a>
<a href="https://twitter.com/intent/tweet?text=%22Gift+Shop%22+%2D+Day+2+%2D+Advent+of+Code+2025&amp;url=https%3A%2F%2Fadventofcode%2Ecom%2F2025%2Fday%2F2&amp;related=ericwastl&amp;hashtags=AdventOfCode" target="_blank">Twitter</a>
<a href="javascript:void(0);" onclick="var ms; try{ms=localStorage.getItem('mastodon.server')}finally{} if(typeof ms!=='string')ms=''; ms=prompt('Mastodon Server?',ms); if(typeof ms==='string' && ms.length){this.href='https://'+ms+'/share?text=%22Gift+Shop%22+%2D+Day+2+%2D+Advent+of+Code+2025+%23AdventOfCode+https%3A%2F%2Fadventofcode%2Ecom%2F2025%2Fday%2F2';try{localStorage.setItem('mastodon.server',ms);}finally{}}else{return false;}" target="_blank">Mastodon</a
></span>]</span> this puzzle.</p>
</main>
<!-- ga -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-69522494-1', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
</script>
<!-- /ga -->
</body>
</html>

200
puzzle/2025/03/input Normal file
View File

@ -0,0 +1,200 @@
6739459674389333459433695375559949344734767926833587823236783998689734978783695374574455875833736627
2373132532343213331342343333323324363713834443362242454554343333223332333335533234623223382233732244
2222441333231342122121622224212212232122222112222122311332222212273223433234222423211112132353251223
2272421512212232712632222221523524213442212223262216623152226212222221225272522223212222532222422323
2217222212362341131525335321122324234324223212742131242212142527224532246323122744833459212221122131
6813346133475314448426121761834648738623643213726761185353582458174121486641462776426112246165435119
2235322222212422321231252252212322241213233213221351223222222622222545214222213222322232422213132241
7648868634667457694727389566453477683138824974478548353762562379434349956786463565646545578448865493
2232322222272322552342542212222432512231313132533323713323222121122925282112215142213222222221221422
7378621536927447566642237444326735875635564782944732267883374679374572291556321372283535258364561428
1334223114253224534122334243242124273114222224322272334943143264254333322328312323224743333223222413
5283934323221234344351874335434342554432424342322757233443633433247254423333534425541235222323429255
6122264424275543533425551322224123443423422244434233542422226242126336524322442444524234552411263232
3443433244333314444224322523243224242332342332231522315233263422237434428222432123142363223243122323
2233352333342262213333232263345434333233236442643232343223622333542433543232553723343472444343144344
1235322122234425513353323233233121313223332222322324126232232333222223222237222333233323333214223323
4325536553242521223435445232395213355134524142322535362352345232535235334532452224141422535244355336
1531221153311234144121313322135341553411453555332543414153122541252131523331312331122441352413256789
2232231112132223322312321422222224211322231122222222222312222325233322325622212332222132322222222221
2271154221775226562431222343772273735324566146362762534541555626247166372734737154373435715644351589
1322321221282223222123242423224522232222222321132212222321512722312232222244311522253532222122221222
5675373654492446328553454633465763638638344343656363366623636255464662661735553323346336465333638336
6222154822345362222322222522826252516222212162122242142222622122427422231223222223423614522215652242
6222632224242211424242122221223142223522122272314221322111422725222212233232111222111221311222122223
7733645442442732531223245525486362495334532522464225353224187425436324512624552272122562562232464133
3122212312222222223262221222241212424214221222222252222212222331144322372726213221422222122222222221
3317564633543532241232338653138233333333364324334323332543322237249336434693237335433133563657333654
2222112144232342525175554221722162744427124325232272237315162252521294737141422751612264275623365412
5233336323444433338634333933257235232354342523921453333345233233432644331633334383243645338643368232
6555744775753685565359587685688568577765366857785355475445486372239447764684674376558464546868574784
3131322312625422313233136243434323233235451234422242642422221233433241342243343332222333122346552351
5545548564544551455444547425574454555985534445454524586545294455554235363458655233939254543595655353
2359665436622224221613324821315324832636221353316524645512225232332321223262434122723638222264123246
1333332423122433422244223222413244221332222222331334124322323329146144322323222422225353223432143332
2252325526527774625423122221535454723322284746512441336421532621335835341737442224474213326432923142
5766753863736644458639676412563282136344433663331635335665536244554854252673336867536454745553535586
5139931557883857995839397424342233394134332434843834938397764484863413686484933823989527723385843673
7286354682444934529442314333841634632432443946348225224943437945312764582252426642212443354433463245
5333223424222352523443254452734543444234454442121354623444212324542542244445314223324234433224341241
2336332233323335432319231323313522133234131534443333333332433123523233523223166334633533319254346322
3333333143332223113333442323223342232243235425354354334356334432335435533321344432432242742523542442
2261454235142314252241242213243143364232222332141662222322248442436223423324264231211282313214412424
3488334264566233754443373333343622327563345364254589363855559833246336332334356352363232364353368336
1232122227141322242221232223224122312242228221224222246224222232213222212222221222222232212222422231
3236763295122212613233243222122225436251538243322312245321313565232523264723325426332723223263241226
1222222232335142362222123254322223622322422223426444223622322223434432433222525212484422336222122133
2322424323244432341252312213322335622323221422345313125352332433421222212431335222342332124312432442
3232821222332422722233212211212324153232331422222222321222323322223622272523212713232321332413272622
3422652314245672235233363232413624422433323321424244162284333425222232322256212251232238721357223148
7774837647487566658756757755755847647655586686578356759987875456786575764558968987878778565587969586
1234223452224271232352455273726233633352227221354347283132212635572422643245234445451363372373482533
5545555754466555455554847555655474545653574744655454656557557545555565555443556555756654565567525555
5553554575554637555471355555154554444754485554555554465523825542545538455434435424455955526476554764
3254522513355333222211324322242533123234124252622229333233422522362352423245261252142252422114324223
2425344423234243432242213333252242333444451414325232234342213224352224134253221152324523223532441142
2582466442443388322624223813222631742479616132436235434553312364912322732234884746223356613144486223
3636223323332312624333322113312432342431432142262253223314236396612381142232422222213122423643323362
7325293432331383666195334723512337573622433434353563239235379451235352335833733463443262233842631543
2232624222332421511175521154321232335222932322461112227222122223213224257225223228222231413222222322
4552958886759955368935997537673735734558749419267255538878465394745752594544365557345558264585655169
2226216222224424524222422122422222224543262772122116426553224212223554631621145422424122825225242116
1222335126326444352764222342426663636441411345223343625343235185633672347245263355582632531664629135
6446446722356324442432213242214223324334335245335452632255422221143347414572397313223584225324331422
5224345323222424434244363345434133334432432442422434334343444345442434433343442433454144443324346244
5336333663337324323323235333336533343334125433374634569233686933546363236465133343459236212383233315
3431212332243413441121331234133441131314434431411433224142211222213143223434341442213344211133456789
5443222683292272324125357143312453332369372333522333233932316972333341214932333824122147432321723342
2367262824212222291672572242672121223153327226222625761267322242612343213625422253225276322142114524
6974563985343496663494433344643427344996686328654636476843646347684276485993646913458343453532176484
2312521543522312123137242323132222221231426242224327114213221222242224322222552327224254122142112333
6223242624251223217243624212512223241767442131244861652377673335441221242314494224319222352132462144
2333332335532332253234215732233323322235422433832233633332422321433233353223223324633524336332332224
2222222254612122222211642121222141234242212212122224252225222222211221224421423222122222532122221124
7421232222222133463122231324223212213131262222222222262223222217223332222242112324223212223323223222
3772242534373521568445363327624535346923343253955164573325436332351227545337435465955345446335669443
5858895152574569257889189996518531539296968776753453347738719235827481499877364362498567754855232996
4342235342363223564433432224563177215352333463431323332332366346334374333222313642241822536513753653
3354323732241336324523344333384638354233345323235333356414435734334356233343815243323232355328535543
3232231323322233322232342342232424122122233213223233212332333242223333133232223335322432333233233222
4222124152125212126225265152124132222832522242612921242522725231324422291234253262251252922212222622
6212552142225252118422223212232132222212722222213122224272253114265212154222226212272212113222621332
4552534756756595545354443365654557336354364737575555533553643535547465544767455573755756641664753655
2511242562394123244232225311322431521234233122422224223242358321213352344333234233713224232844173274
5526573675275646255558956655553398735354554524555427427584565653555545563555555663555386643559595476
4232222322223212512221132222227252235212222222124221221112232212223222453212215322552222422212122213
3323424433432431244433341433443334252333344333423447143363335444343444424424333333334314334534734333
9963543266528685935319932224777827787327354466945986687988877635834976575546746666448364958368484663
6263444224532863343259522662665342226323162222857382232425236267222252462342222824722545227136623635
3613233413353333333733232333232232314323633243331463333723643352333333533333264723363332314333323323
3122425225223233212711545223521542342751432242342216624212233222124622255451462253213221324322312523
4644734133536424434624843436434362694444315342324843447433442362627451364355523726343468233665395334
4423752435257822384423397544537263283356855845353384355467172425447276333227266721254779455411724215
1232222542232223232321322222187293523223312725724724421177222422132522224332622417141822722342212252
1353462356374364544444752374433432367667363527433336443445574733653443133657644213156634465463366664
3192682326222225434218233965252711232242242236626283422252542162524165353222421222322292921262515229
3312233223612332333341332232322333242232223222131312332231232232133322132322233232332333263222412332
3234443454533643613563332542531736363323533332113364323434522333534323225213524556624642433653522553
2356547419343244352723362645244353646442345436343242314441245442452344326474324314552253321131474344
4445493462456534126735454332732865436442644324962445644548387755234434462466476473934635423425734474
3442442214253562342232334243274474423334242283443262663132232234435423322826434324322328667162354334
9222423542321221122258446212213211172721233221222221223272256232642372212224522123332524124143432326
4838673447445676256588638865556356667346668652334584256363964445648566415477386645366466656544567654
4133131233343233241633333254242345323313343244335321522133232321433234243434543352332263632372375333
5828945793549483935858838333432326954645791684532333453883537868337762597642674263434432357934531374
2462313322354323424333646243334253243223325422243531637423233322332433424542344312432533643324436543
2539348544557567255225664845627542364542463624645864444225522842247237721342534922336455362226526365
4313432313333334433332333333722734342333313336332233233233243313333312233323332333333323333334133727
1323322332333334352335343422333333313434243233132333332323433343143341333533143323443344234261233433
4223243421322262122224452325212324411352242723212223222526252232122721211223222332222242215215722252
2122243223224224122252224224652241224312121112242122848123262222222225222222222323223222224122241222
5459575645652678467695654954544755554654556689544674556527565856685345655767347655553755585395765556
4383447444642633635122355334333542442544584433334813341335344332326442333353544332353435434413446234
2423344333433353334546425355243722444635353463435554444333335333343344352563531337322284832853331384
4344441443463433342533145457735744443464345463435763434644743746347434463565745744767446646744313864
3112622325223212232232184172222122311261131225132125212532233125325352242225221233322322254266254222
2421274222332221222313121222321224121244232212223133243213421422123241222122144324214122214425232244
2252234212322333222333523311221223223332432243433311222222311337442363222222245236321222321312511423
2312212222222121212222322222224222222222122222222222221232222241122232322132132222222212232222222122
7262448448421222424318593452122252371672822885228388224822722243224431442228622226178225632277243862
2344523224412264412234421843923324224234342321232125413533424482134222423222714233232222322321642882
1232232212212212121221223233422312211227122221242222222221421521222132222141223222212212313123412222
2421555222443346242342325142532329744622464222455253942465222437421925254433254513524523242264522232
4232364222233223225422625448524281542252232522532734642617212447412431262622232224732414524822558622
2232222122231222222222222121123231223222222223221222222222212222312332222122132222222222231222231222
1693242656125335113327232727222355534235553925255524352364142322551624375266322233222122623649145923
3191622272845397635962226263372437781255371428539472315456786262324541857136172382276663246422552254
2341631463341235353222762222332132322233235534224433242533322672626235543433335824222112122563848222
4243352323393323322412422723421344531443344454133533423332252222525243363335353323442534322434624333
4122122434441322212222232241231253242212423143524122122221222217222331222922224213122242232122112222
8526423444659538534644434443534767654446388646433363374624465623394854334333835689839623378845467864
4313524326322723333653229556672243256457353312433262243536222232243437572346242312182416365263363632
3421432222332125453333232334338344233523333163632322363363515263335412227122266337233332633252733322
2275513536253364556536326359452448225266635634263644244436526674634662244266625636275259662225628464
2222136221237222222112825432222212642741375221233222222212222732324412221253641211214253222228243222
2322321212231213122111233212228222323142251222221222232222462332222222122521122351322522224222232422
7828633443736627726586266432543635144134379442252564462478743746263525583722448333372335374497538124
3222251227311241235422312222323222264311412232322233341221223122222162422212226323422221231211513222
5421435122248223255222326522521252121341244234153622222227423222224612542233443421224122174226163622
4222222222222122113235623133222212322222112232222122252221322321212222222242222332223222321224223122
4233252445312226722225223542226243322454643222228529422542432642233324322422222232232322222413121553
3615624141464526353322824153676424526435724645414624562233359465646754544546524532454445363348642541
3474387467558466355565563784234546623884345559524345534553425662362764666345824956865955463556564644
1222522123722125232431423122312221313222222242227211222212221246224221223122282113232212223221222722
4454441334924563343346322321343234496483913614877527343344493134728782224847974423844453215347431443
4224223212291233225225132212253425261931487567442622576642326112223572438512272224122415569742162525
6445335414254335336633343555235745445554554455535334535356454374324555334533853355353325455547325554
6626581624635444362364651825256666457665474336555556556644435447463645326235256526535444414733534454
5422576923223945122374796322152228884422452328642342753427334326724922222154422242222232232224147344
4223124232132333633123141122222412256142215212333232322372323321121221222222223232322233232323324532
3438133563332253313223323733342334333547565235332563234333513353132433224223733323433153334339332432
2232222222222322552222321413122332322583424323222112232222343122123221632232922421112352212242351221
2144423335464534433412253343495544445443423457247313364443722832342431533337637732644324464447454464
3322412224224232642223433412311245672241314223325221311433242222221421474234544323222122432332342424
3222332324232417422293428432253523184223543221221334231354221534223154231326547412423222932222232423
6454435364652351435243121321513136424162525615464322641241355622412655562155263545644145116561433789
5651549646656564446654548545658544637344446644764426624444646566644356545536335644427954453454845455
1131338231231236463826221222271244933251332426223213122235217233532262423233333232222523523362232232
2534465354338456343753333332343257573256325453237553435457423535435555555343364434344555542935444537
4322212242322122412222273222322242322213244222222612322222214325222212223621321232352231122232222424
5554555422343543534535553555455554872545238244655255353555555535425355545625355635545436646435534944
2423442532223524223122234133414442223441212221427223222232221222222126522422542211125452121224231354
1225222172436272232152224472436378228238344252537321232143222162232422241622442237322439142322224332
2134222222621363445321422363333314221122222223244313241224232522243214274432346243462431342212242424
2121443212224135231222223113432432222232318221222214222213222221232362211212122222447213222412414122
1566355333393336334172656442374316389732383778336895623949463733633559423424688358375253739713963278
2341254222222332212427223222222642221332224111722741226322434121222243214226221723244132622112112222
6644642354573624554464472324223453542555645455422354444343626843445234444444464232522646245432242461
3247436536134438548873464346333532755684353334675455432343435333344342364244863454955333432551323333
1235215233244313532333113423336323344236333333463553332363232223353134733242353532332532433235323331
9222226122322232272232261242721521223265414242325421722226222125122232222231213222672252242812254326
1321222223122222222232223523415321322322222244221222222232233212323122123122223221232542424214322539
3444232433344233344454133423435235333414322363245333434435335434413545373344433431434333433325353439
2212231212222123222222225221229521332221225212351322113133232211222223562322313223231212312212132342
3446665745854144677546554847575954733732467444426485447556754446464596854754334252247464584775744424
4346262565225353555549454323452344542464454435533544545555222345534465553645355534534534542354335354
1335222241344263233453344231323221127323221184223234423232221222322332323423213224332341222223121326
5344331336363574334353641632133233443333323413442443343323633245842438635472374733453364333646334433
9444334434444244644444345323745554354344344442435442435432433266524353434344383446433135455453554445
4533434334344535345534333423444431344333442423245543134433552254344459432435544425422436135444413644
2221322532223525175451345547567432822312232752333534963253638162474322348231743243225235335422414474
5254537535635118228352459323444144421232545422514324214363242754457442221353275325294663252333452344
2413222233253222363233382222333233152212233222212337331353332323322443221324233422332213312322322133
2222353561222523135513522223232521222522222242432335222215412222223212333534452236531127122125221212
2442384334158465433823365235674363435555433458234364573525766645443242362442362654345585533525374685
3333362346234532333524724934541315323533324353333233612233443433323533333394347536227433666337336345
3322344485213336532312332343343333354224833344334424424445333432633913344243324113436484424263233322
3342333423262333433223332234432223332323323233423328434732342233331733323332432433321152213332433334
3333313232317322332533333233335133721333233433822273382244353338333441233242825341253133329383633221
2322243422312132242231323224322324422135322335433593322322522123323251242522132231334321332322335223
5635623236946239558355233633854435593532134143353443243324233533164555442233345444454463345533536943
3544244193244226529332426724342221335632234551423312214452252222623354242453451522223552173531454254
8316113362363225333531324323422213323312453324252323432416222221353339564652322435137224342323323333
7342633555612222253253223233314222132543262332234425246244543534553653523375332342323242224241345132
2426443634943333523434526234444346524431545314136223423324424436344554416413323244144424537235436263
2422345222227262832125222262122535563213221362163123126225342722332424326626434424452442652213242233
2695512227221334661242722252244682332252321214131628211624213412225241322622222125224122222215272282
8352222447535225362515335225152142332257652128665342313311225323322435782254832283123285572331272623
2522423322322452621212352246423223132352222625543322132323122213622223136386123225124222253232522212
6233333553433344335534335441536333444432144432234444434333424533233441434443342335444542211343343443
4353732444512234333345235313431332543323433323223443373336442333335434932835543135333462635233343534

139
puzzle/2025/03/prompt.html Normal file
View File

@ -0,0 +1,139 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8"/>
<title>Day 3 - Advent of Code 2025</title>
<link rel="stylesheet" type="text/css" href="/static/style.css?32"/>
<link rel="stylesheet alternate" type="text/css" href="/static/highcontrast.css?2" title="High Contrast"/>
<link rel="shortcut icon" href="/favicon.png"/>
<script>window.addEventListener('click', function(e,s,r){if(e.target.nodeName==='CODE'&&e.detail===3){s=window.getSelection();s.removeAllRanges();r=document.createRange();r.selectNodeContents(e.target);s.addRange(r);}});</script>
</head><!--
Oh, hello! Funny seeing you here.
I appreciate your enthusiasm, but you aren't going to find much down here.
There certainly aren't clues to any of the puzzles. The best surprises don't
even appear in the source until you unlock them for real.
Please be careful with automated requests; I'm not a massive company, and I can
only take so much traffic. Please be considerate so that everyone gets to play.
If you're curious about how Advent of Code works, it's running on some custom
Perl code. Other than a few integrations (auth, analytics, social media), I
built the whole thing myself, including the design, animations, prose, and all
of the puzzles.
The puzzles are most of the work; preparing a new calendar and a new set of
puzzles takes all of my free time for months every year. A lot of effort went
into building this thing - I hope you're enjoying playing it as much as I
enjoyed making it for you!
If you'd like to hang out, I'm @was.tl on Bluesky and @ericwastl@hachyderm.io
on Mastodon.
- Eric Wastl
-->
<body>
<header><div><h1 class="title-global"><a href="/">Advent of Code</a></h1><nav><ul><li><a href="/2025/about">[About]</a></li><li><a href="/2025/events">[Events]</a></li><li><a href="/2025/shop">[Shop]</a></li><li><a href="/2025/settings">[Settings]</a></li><li><a href="/2025/auth/logout">[Log Out]</a></li></ul></nav><div class="user">buhman</div></div><div><h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">sub y{</span><a href="/2025">2025</a><span class="title-event-wrap">}</span></h1><nav><ul><li><a href="/2025">[Calendar]</a></li><li><a href="/2025/support">[AoC++]</a></li><li><a href="/2025/sponsors">[Sponsors]</a></li><li><a href="/2025/leaderboard/private">[Leaderboards]</a></li><li><a href="/2025/stats">[Stats]</a></li></ul></nav></div></header>
<div id="sidebar">
<div id="sponsor"><div class="quiet">Our <a href="/2025/sponsors">sponsors</a> help make Advent of Code possible:</div><div class="sponsor"><a href="/2025/sponsors/redirect?url=https%3A%2F%2Fcloudsmith%2Ecom%2F%3F%26utm%5Fsource%3Dadvent%5Fof%5Fcode2025%26utm%5Fmedium%3Dpaid%5Fdisplay%26utm%5Fcampaign%3D%26utm%5Fcontent%3Dhomepage" target="_blank" onclick="if(ga)ga('send','event','sponsor','sidebar',this.href);" rel="noopener">Cloudsmith</a> - Cloud-native artifact management that handles enterprise security and scale. Artifacts shouldn&apos;t slow you down. We run the platform that locks down and distributes your software supply chain, no matter the shape or complexity.</div></div>
</div><!--/sidebar-->
<main>
<article class="day-desc"><h2>--- Day 3: Lobby ---</h2><p>You descend a short staircase, enter the surprisingly vast lobby, and are quickly cleared by the security checkpoint. When you get to the main elevators, however, you discover that each one has a red light above it: they're all <em>offline</em>.</p>
<p>"Sorry about that," an Elf apologizes as she tinkers with a nearby control panel. "Some kind of electrical surge seems to have fried them. I'll try to get them online soon."</p>
<p>You explain your need to get further underground. "Well, you could at least take the escalator down to the printing department, not that you'd get much further than that without the elevators working. That is, you could if the escalator weren't also <span title="Escalator temporarily stairs. Sorry for the convenience.">offline</span>."</p>
<p>"But, don't worry! It's not fried; it just needs power. Maybe you can get it running while I keep working on the elevators."</p>
<p>There are batteries nearby that can supply emergency power to the escalator for just such an occasion. The batteries are each labeled with their <a href="/2020/day/10">joltage</a> rating, a value from <code>1</code> to <code>9</code>. You make a note of their joltage ratings (your puzzle input). For example:</p>
<pre><code>987654321111111
811111111111119
234234234234278
818181911112111
</code></pre>
<p>The batteries are arranged into <em>banks</em>; each line of digits in your input corresponds to a single bank of batteries. Within each bank, you need to turn on <em>exactly two</em> batteries; the joltage that the bank produces is equal to the number formed by the digits on the batteries you've turned on. For example, if you have a bank like <code>12345</code> and you turn on batteries <code>2</code> and <code>4</code>, the bank would produce <code>24</code> jolts. (You cannot rearrange batteries.)</p>
<p>You'll need to find the largest possible joltage each bank can produce. In the above example:</p>
<ul>
<li>In <code><em>98</em>7654321111111</code>, you can make the largest joltage possible, <em><code>98</code></em>, by turning on the first two batteries.</li>
<li>In <code><em>8</em>1111111111111<em>9</em></code>, you can make the largest joltage possible by turning on the batteries labeled <code>8</code> and <code>9</code>, producing <em><code>89</code></em> jolts.</li>
<li>In <code>2342342342342<em>78</em></code>, you can make <em><code>78</code></em> by turning on the last two batteries (marked <code>7</code> and <code>8</code>).</li>
<li>In <code>818181<em>9</em>1111<em>2</em>111</code>, the largest joltage you can produce is <em><code>92</code></em>.</li>
</ul>
<p>The total output joltage is the sum of the maximum joltage from each bank, so in this example, the total output joltage is <code>98</code> + <code>89</code> + <code>78</code> + <code>92</code> = <code><em>357</em></code>.</p>
<p>There are many batteries in front of you. Find the maximum joltage possible from each bank; <em>what is the total output joltage?</em></p>
</article>
<p>To begin, <a href="3/input" target="_blank">get your puzzle input</a>.</p>
<form method="post" action="3/answer"><input type="hidden" name="level" value="1"/><p>Answer: <input type="text" name="answer" autocomplete="off"/> <input type="submit" value="[Submit]"/></p></form>
<p>You can also <span class="share">[Share<span class="share-content">on
<a href="https://bsky.app/intent/compose?text=%22Lobby%22+%2D+Day+3+%2D+Advent+of+Code+2025+%23AdventOfCode+https%3A%2F%2Fadventofcode%2Ecom%2F2025%2Fday%2F3" target="_blank">Bluesky</a>
<a href="https://twitter.com/intent/tweet?text=%22Lobby%22+%2D+Day+3+%2D+Advent+of+Code+2025&amp;url=https%3A%2F%2Fadventofcode%2Ecom%2F2025%2Fday%2F3&amp;related=ericwastl&amp;hashtags=AdventOfCode" target="_blank">Twitter</a>
<a href="javascript:void(0);" onclick="var ms; try{ms=localStorage.getItem('mastodon.server')}finally{} if(typeof ms!=='string')ms=''; ms=prompt('Mastodon Server?',ms); if(typeof ms==='string' && ms.length){this.href='https://'+ms+'/share?text=%22Lobby%22+%2D+Day+3+%2D+Advent+of+Code+2025+%23AdventOfCode+https%3A%2F%2Fadventofcode%2Ecom%2F2025%2Fday%2F3';try{localStorage.setItem('mastodon.server',ms);}finally{}}else{return false;}" target="_blank">Mastodon</a
></span>]</span> this puzzle.</p>
</main>
<!-- ga -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-69522494-1', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
</script>
<!-- /ga -->
</body>
</html>

137
puzzle/2025/04/input Normal file
View File

@ -0,0 +1,137 @@
@..@.@.@@@.@@@@@@@...@@@.@.@.@.@@@@@.@.@.@..@..@.@@.@@@@@@@@..@@@.@@@.@@@@@.@....@@.@@@@.@@.@.@..@@@...@@@@.@@@.@.@@@@@...@.@@@.@....@@.@
..@..@.@@..@.@@@..@@@@@@@@.@@@@@@@@@@@@@@@.@..@.@@.@@....@...@@...@@...@@.@@.@@.@@@@...@.@@.@@.@@@@.@@@.@@@@@..@@.@.@@@@@@@@@@@..@.@@.@@.
.....@.@@@@@@@@@.@@@@@@..@@......@...@@@.@@@@@...@.@@.@@@@.@.@.@...@@.@@@.@.@@.@.@..@@@@@...@@@@.@@@@@@@.@.@@.@..@@@@@.@@..@@...@.@@@@@@.
...@@.@.@...@@@..@@.@...@@..@...@@@@@@.@@@@..@@@@@@@@@..@@@.@@@@@@@@@@.@@@.@@@@@@@@.@@@@..@@.@..@.@...@.@.@@.@..@@@@@@@@.@.@@@@.@@@@@@@.@
@@@@@.@@..@@@@@@.@..@.@@@.@@@@@@@@@...@@@@@@.@@@@@@@@@...@@.@.@.@@@@@.@@@.@@.@.@@@@@@.@@.@.@@@@@@.@.@@.@@.@@@@@.@@.@@@@@@@.@@.@@@...@@@@@
.@@.@.@@.@....@.@@@@.@..@@@@@.@@@..@..@.@@@@@@@@...@@@.@@.@@.@@@..@@@....@.@@@@.@@@.@.@.@@..@...@@@@@@@.@@..@.@@@...@@@@@@@@@.@@.@..@@@@@
@..@...@@@..@@.@.@@@@@@.@.@@@@@.@@@@@@@.@@@@@@@.@@@@@...@.@@..@@@@@..@.@@.@@..@.@@@@...@..@@@@@@@@.@@@.@@.@@@.@@...@@@.@@@.@@@.@@.@@@@@@@
.@@.@.@@@@@@.@@@..@.@@..@.@@@.@@@@@.@.@.@.@@.....@@@.@@.@@@.@.@.@..@@@@..@@.@@@@.@@.@@@@@@...@@@@.@.@@@@@@@@..@@@@@..@@@.@@@@@@@@@@@.@@.@
.@.@.@..@@@@@.@.@.@@@@@.@.@..@.....@@@@@@..@@@@.@@@@@@@@@@@.@@@..@@@@.@@.@.@@@@@...@@@@@@.@@@@@@@@@@.@@@.@@@.@@@.@..@@.@@...@..@...@@@@@@
@@@@..@@@...@@@.@..@@@@@.@@.@.@@.@.@@..@@.@@@@@@..@@@.@@@@@@.@@@....@.@@@@@@@.@.@..@..@@.@@.@@@@@@.@.@@@@@.@.@@@..@@..@.@@@@.@@.@@..@.@..
@.@@.@@@@@.@@..@..@@..@...@@.@.....@@@@@..@@@@@.@@@@.@...@@@@..@@.@.@@..@.@@@.@@.@@.@.@@.@@..@..@@@..@..@@@.@.@.@@.@@.@@..@.@@@...@..@@@@
@@@..@.@.@@@@@@@.@..@..@@@@.@@@@@@@..@@..@@@@@@..@@...@@@@@..@..@..@@...@@..@..@@@@.@@.@.@@.@@..@@@...@@@.@.@@@@.@...@@@..@@@@@@@@.@.@@@.
@@..@@@@.@@@@@@..@@.@@@@@@.@@@.@@.@.@@..@@@.@@@.@.@.@@@@..@....@..@@.@.@@.@..@.@@.@@@.@.@@@@@@@@.@@@@..@@@....@@@@@@@@@@@@@.....@@.@@@.@.
@@..@@..@@.@@@.@..@@@.@.@@.@@@@.@@@..@@..@@@@@@@@@@@@...@@..@.@@@@.@@@@@@....@..@.@@.@@@@.@@...@@..@@.@.@@@.@@.@@@@@@@@@@@@@..@.@@..@.@@@
.@.@@@@..@@@@@@.@...@@@@@.@@@@..@@..@@@@..@@@@.@.@.@@.@@..@.@@...@@@@@@@@@@.@.@.@@@@....@..@....@@@@.@@.@.@.@@@...@@@@@@@..@@.@@@@@.@..@@
.@@@@.@@@@@.@@@@.@@@@@@@..@@@@@@@@..@@.@@...@@..@@@@.@@@..@@..@.@@.@.@.@@@.@.@@@.@@.@@@@@@@.@@.@@@@@@.@@.@@....@.@@@..@@@@@@@@@@.@@@.@@@@
@..@.@@@@@@.@.@@..@@@.@@@@.@..@.@@@.@@.@@@@@@@..@...@.@@@..@@@.@@@@@@@@@.@@@.@@.@@....@@@@@@..@.@@@@@.@...@.@..@@@@@@@@...@@@@@@.@@@.@@@.
@.@@@@@.@.@..@@.@@@@@@@.@@@@@@@@.@@.@@@...@.@.@@@@@.@.@@@@@@.@@.@....@@@..@@@..@@@@@.@@@@@@@@@@@@@@.@@@@.@@@.@@@@@@@@..@.@.@@@...@@@@@@.@
..@.@@@@@......@@.@@@.@...@@@@@@@..@@.@..@@@@..@@@@.@.@.@@..@@@..@@@@@....@.@@@@@@@.@...@@.@@@..@...@.@.@@.@@@.@@@@@@@..@.@@@@@@...@@@@..
.@@@.@@@.@..@.@@.@@.@.@@@@...@@@..@@@@.@..@@@.@@@@@..@.@@@@@..@.@..@@@@.@.@@@@@@@@@@@@.@.@@@.@@@@.@@@@@@@..@@@.@..@@@..@@...@@@@..@@@.@.@
@.@@.@..@..@@@@@@@....@..@@@@.@@@@@@@@@@@@.@@@@@@.@@...@@@@.@@@@.@.@..@@.@.@@..@@@.@@@.@@.@@@.@@.@@@@.@@@@@.@@..@@@@@..@..@.@.@@.@@....@@
@@.@...@@@@....@@@.@.@..@@@@.@@@@@@@@@@@@...@@.@@@@@@.@@@..@@@@@@@@.@@.@..@.@.@@@.@@.@@..@..@.@.@@@@.@.@@.@@.@@@.@.@@@@.@.@@........@@@.@
@@@.@.@.@.@@@..@.@@@.@@@@@.@@@@@.@@...@..@@...@@@@@@.@.@@@@@@@@@@@.@@.@@@@@@@@@@@@@@@.@@@@.@@.@@..@@@..@@@@@@.@@..@@..@@..@@....@@@@.@@..
@..@.@@@@.@@@@.@@.@.@@@@@@.@@@@@@@.@.@@..@@@@.@.@@.@@.@@@@@..@@.@@@@.@@@@.@@@@.@..@@@@.@@@.@@@@@@@@@...@@.@@@@@@....@@@.@@@@@.@@@@@@.@@.@
.@@@@@@@.@@@.@@.@.@@..@@@.@@.@@..@.@@.@@..@@.@@@@@.@@@@.@@@@@@..@@@@.@..@@@.@@.@@....@@@..@@@.@@.@.@@.@@@@..@@...@@.@.@@@.@.@.@@@@.@.@.@@
@@@@..@.@...@..@...@..@.@@@@@@.@.@@@@..@@@@@.@..@@.@@@..@@.@.@@@@.@.@.@@@@@.@....@@@@..@.@@.@...@@@@@..@@@@@@@@@.@..@@.@@@@@@..@@@@@@.@.@
.@...@@@@@.@.@@.@@@..@@@@@@@.@@@@@.....@@@@.@@@@@@.@@@@@@@@@.@....@..@@@.....@..@@@@.@.@@......@@..@@..@.@..@@@@@@.@@@@@@..@.@@..@@..@@@@
@@@...@@.@@@..@@..@...@.@@@@.@@@.@@@@@@@@@.@..@@@@@@@@@@@@.@@@@@@@@@@@@....@@@.@.@.@@.@.@.@@@@@@@@@@@.@@@@.@..@@.@...@@@...@@@@@@@@@@@.@@
@....@@.@.@@@@@@@@@@@@.@@@.@.@@@@@@.@@.@@@@.@@@.@.@@@.@@.@@....@@.@.@@@@@@@@.@@.@.@@@@.@.@.@@..@@.@@@@.@@@..@@@.@@@@...@..@@@@@@.@@.@@@@.
.@.@@@.@.@@@@@..@@@@...@@@.@@.@@@..@@@@.@@.@@@@@@@@@.@@@@@@..@.@@.@@.@..@@@@@.@.@..@@..@@@@@@@@.@@.@.@@@.@@@@.@@...@@@@@@.@@..@.@@.@.@.@.
@.@....@..@..@.@@.@..@@@@.@@@@@@@.@.@..@@@@.@@@.@@@@.@@.@@@@...@@@@@@.@@@@..@@@@@@@.@@@.@@@@@@@.@@..@@.@@@.@@@.@@@@@@@..@..@@@@@@@@@@@@@@
@@@@....@@@@@@.@@@@@@.@..@@@@@...@.@@@@@@@@@@@@..@.@.@@@.@@@@@.@@....@@@@@@@@@.@.@@@.@@@@@@.@.@@@@..@..@@@.....@.@.@.@@.@@..@@.@..@@@..@@
.@.@.@@@.@@.@@@@@.@@@@@.@@@.@@....@@@@@@@@.@@@@@..@@@@@...@@@@@@@.@@@@@..@.@@@@@@@@@@..@@....@@.@@@.@.@@@@@@@@@@@.@@@..@@...@@@..@.....@@
@@.@@.@@@..@@@.@@.@@.@@@@@.@@.@@@@@@@@@@.@.@@..@@..@@@@@@...@.@@..@.@@@.@@@@@@@@@.@@@@.@@@.@.@@.......@@.@@..@@@@@@.@@@.@@@@@.@@.@@.@.@.@
.@@@@@@@@@@.@@@..@@@@.@..@@..@@@@...@.@@@....@@@@..@@@@@..@.@@..@@@@@@@.@@@@@@..@@.@@...@..@@@@.@@@.@.....@.@....@@@@@...@@@@@@@@@@@.@@@@
.@@@..@@@@@@@.@@@..@@@@@...@@@.@@@..@@...@.@.@@@.@@.@@.@@@@@..@@@.@@@.@@@..@@@.@@.@@@@@@@@@.@@.@...@@.@@@.@@.@@@@@@..@@@@..@..@@.@@@@..@.
.@.@@@@.@@.@@.@@..@@...@@@@..@@@@...@.@.@@@@@@...@.@@..@@..@.@@@..@@@.@@@@....@@.@@@@.@@@@@@..@@.@@@@.@@.@.@@@@@@@..@@@@@@@@.@..@@@.@..@@
@..@@..@.@.@@.@@@@@..@@@..@@.@@.@@@.@@@..@..@@...@@....@..@@@@@@@@@.@@@@@@...@.@@.@.@@@@..@@@...@..@@.@@.@@@@..@..@.@@..@@@@.@..@@@.@@@.@
@@@@.@@.@@@..@@@@@@@...@.@@@..@@@@.@@.@.@.@@.@@@@@@.@@.@.@@@@@@@@@@.@@..@@@@@@.@@..@..@@@@@@.@@.@@@..@@.@.....@..@@.@.@@.@@..@@@.@@.@@@@@
.@@@@@@@@@@@@.....@.@...@@@.@@@.@@@.@@@.@@@@.@@....@.@..@..@@...@.@@@@@@@@@..@@.@@@@.@.@@.@..@@@.@@.@@@@@.@..@@@@..@@@@@@@.@.@@.@....@.@.
.@@.@@...@@@@@@@@..@.@@@@@@.@@@@@@.@.@@@.@@@.@@@@@.@@@@@..@@.@@@@.@@@@.@@@@...@@@.@@@@@@@@@@@@...@@.@@@@@.@.@.@@@@@@.@@..@@...@@@@@@@@@@@
@@@@@@.@.@.@.@@.@@@@@.@@@@@..@@..@@@.@..@.@@@@.@@@.@@@@@.@@.@@.@@.@..@@@@@@@@@.@@.@@@..@@@...@.@@.@.@@..@@@@@.@.@@@@@..@.@.@....@....@@@.
@@.@@..@@@@@@@.@@@@.@@.@@.@@.@@..@..@..@.@@@@@@.@@..@@.@@@@.@.@@@@@.@@@@.@..@@..@@@@@.@.@@@@@@@@...@.@...@.@@@.@@@.@.....@@@......@.@@..@
@@.@@.@@...@@@@@@@.@..@@@@@@@.@..@@.@..@...@@..@@@@@.@@.@@@@.@@@@...@.@...@..@.@@.@.@@@@@@@@@@..@...@@@@..@@@.@.@.@@.@@.@.@.@@.@@.@@@@@..
@@.@.@.@@@@@.@@@@.@@@@@.@@.@.........@@@.@@@@@@@.@@@@.@@@@@.@@@..@@.@@@@..@@.@..@@...@@@@....@@@@@.@@...@@@@@@@@@@.@@.@@.@.@@.@@.@@...@@@
@@...@..@.@.@@..@..@@..@@@@@@.@.@@@@@.@@@.@.@@@@.@@@@@@.@@@.@@@.@@@.@@@@@@@@.@.@@..@.@@.@@@.@@@@.@.@.@@@.@.@@@@@..@@@@@@@@...@@..@.@..@@@
.@@@@..@@@@.@@@@@@@@.@.@@..@@@...@.@..@@@@@..@@@@@.@@@@@@@.@.@.@@..@@@@@.....@@.@.@@@..@..@..@.@.@@.@@@@@@@@@.@@..@.@..@@@@@..@@@@@..@@..
.@@.@....@..@.@....@....@..@@@..@@@.@@@@@@@@@@@@@@@@@@.@@@@@@@@@@@.@@@@@.@.@@@.@...@.@@.@..@.@@..@.@@.@.@.@@.@.@.@@@.@@@.@@.@@@@@.@@.@@@@
@@...@.@@@@.@@@@@@.@@@.@.@.@@@@.@.@.@@..@@..@.@@@@@.@@@.@@@@@@..@.@@@@.@.@@@@@@@@.@.@@@@.@@...@.@@@.@@@@.@@..@..@@@.@...@.@@..@@@.@.@..@@
.@..@@@..@@@@.@@@@.@@..@@@.@@@.@@@@...@@...@@@@@@.@@@@.@@..@.@...@@@...@@...@.@@@@@.@@@...@.@@@.@@.@@@@.....@.@@@@@@@@@@@@.@@@@@@.@.@@@@.
.@@.@..@@.@@@..@.@..@.@.@.@@.@@@.@@@...@.@@..@@@@.@@..@@@...@.@@....@@@@.@@@@@@@.@..@.@@@@@.@@......@.@..@@@.@@@@..@@@..@@.@@@@@.@.@@@@@@
@@@@.@@@@@@..@@@@@@@@@@...@....@.@@@@@@@..@@...@.@@.@..@@@@@.@.@.@..@@@...@.@@.@@.@@@..@.@@@@@.@....@@.@@@@@@..@@@.@@.@..@@@@@@@.@..@.@@.
@@@.@@@@.@@@@...@.@@.@@@.@@@@@@@@@.@@@@.@@.@.@@.@@..@@.@@..@.@..@@@@@.@@..@@@.@.@..@.@@@.@.@@...@@..@@.@@@.@.@@@.@@.@.@@@@@@@@.@@.@.@@@..
@.@@@@@@.@.@...@@.@..@@@@@@@.@.@@.@.@.@..@@@...@@@@@..@.@..@@@.@@@.@@.@@....@@@@.@@@.@@@@@@..@@.@@@@@..@@@...@.@@..@..@..@@@@@@@.@@@@@.@.
@.@@@@@@@@@@.@.@@......@@.@.@..@@@.@..@@.@.@@@@.@@..@@......@@@@.@.@@@@..@@@@@@@@.@.@@@@.@@@.@@@@@@@@@@@@.@@@.@@@@.@@.@@.@@.....@@@@@@.@@
@..@.@@...@@@@@.@@.@..@@@@.@@@.@@......@.@@@.@.@@@@.@@@@.@@@.@.@...@.@.@@@@.@@@@@.@.@@@@.@@@@@.@@@..@@@@...@.@@..@@@@.@@@.@@@...@@.@@@.@@
....@@.@@.@@@@@.@...@@@@@@@@........@@.@@@.@@..@..@..@.@.@.@@@@@....@.@..@@..@.@.@@@@@@@@@@@..@@@@.@.@@@@@@....@..@@@@@@@..@@@@@@@@@..@.@
@@@@.@@@@@@...@@@.@@@...@.@@.@.@@@@.@@@@@@.@.@.@@.@@@@@.@@@@@@@@.....@@@.@@@.@@@.@.@.@...@@@.@..@@.@@.@..@@@...@@@...@@.@.@.@@@..@@.@.@@@
@.@@.@..@..@.@.@.@@@@@@@...@@.....@@.@....@@@@.@@...@@@@@@@@.@.@@@..@.@@@..@@@@@..@@@.@@.@@@@@@...@@@.@@@@@@..@@@@@.@@@@@.@@@.@@@@.@@@@..
.@@@@.@..@@@@@.@@@@.@@@@@.@@.@@@@@.@@..@@@.@@.@@..@.@@.@..@@@.@@.@@.@@@.@@@.@.@.@@..@@@@.@@@@@@..@.@@@@@@.@@@@..@.@@@.@@.@..@@.@@.@@.@@@@
.@@@@@@@.@@@@@@@.@@@@@.@..@@.@@@@@@.@.@@.@@@@@@...@...@@@..@@.@...@@.@@..@@..@@@@@.@@@...@@.@..@.@.@@@@.@@@@.@@@@@@.@..@@@..@.@....@..@@@
@.@@@@@@@@.@.@@.@.@@@@@@@@@@@@@.@@....@.@@.@@@.@.@..@@@@@@..@.@@@@@@@@.@@.@.@..@.@@@..@@@@@@@@@@@@..@@@.@@@@@@@.@@..@@.@@.@..@@..@@@@.@@@
.@@@@@.@@@@@@.@@@@@@@@@@@@.@@@.@....@@.@..@@..@..@.@@@@.@@@@.@@@@..@@@@.@@@@@@@.@@@.@@@.@@.@@@@@@@@@@@.@.@..@.@@@@@.@@..@@...@@@.@@@@..@@
.@@.@.@@@@@....@@@.@.@@@@@@..@@....@@@....@.@@@@.@@@.@@.@@@@.@@.@@@.@@@.@.@@@..@@@@@.@....@...@@..@@@.@@.@@@@.@.@@@@@.@@.@@@@...@@@..@.@@
@@@@.@@@@@.@@.@.....@..@@.@..@@@@.@@@@@@@@.@@@@@@@.@@@.@@.@@@@@.@@..@@@@@.@..@@..@.@@..@@@@@@@.@@@@@@@@.@@@@..@@.@@@@@@..@@.@@@@@..@@@@..
.@@@@@@.@.....@.@.@@.@@@.@@@..@.@@.@..@@..@@@.@.@@..@@@@.@..@@.@@.@@@@.@@..@@@@...@@@@.@@...@@@@@@@..@.@@@@@@..@@@.@@@...@@.@@@@..@@.@..@
@..@.@@@@.@.@@.@.@@@.@@@.@.@..@.@.@...@@.@@@@@@@@@@@@@@@..@@.@@@@@.@@@@.@@@..@@@.@@@.@@@@...@@@@.@@.@@@@@.......@@@@@@@@@..@.@@@@.@@..@@@
@@...@@@@@@@@.@@@..@@..@@@@@@@.@@@@@@@@.@@@@.@....@@.@.@@@@...@@@@@@@..@@@.@@@.@@@@@@@@@@@.@..@@@@@@@@@@.@@.@@@@.@..@.@@@@@@@@@@@@.@@@@.@
@@..@@@.@@@@@..@..@@@@@....@@.@@@@.@.@@@@@.@.@@.@@@@@@@.@.@@.@@@@@@.@.@@@@.@@.@@@.@@..@@@..@.@@@.@@@@@@@@@@@@@.@@@..@@.@@...@@@@@@@@..@..
@@@@.@@.@@@.@@@@...@...@@@.@@@@@.@@..@@@@...@.@@.@@.@@@..@@.@@.@@@@@@@@@..@@@.@@..@@.@.@@@@@...@@@@@@..@@.@..@@.@.@@@..@@@@@@@.....@@.@@@
@@@@@.@@....@@..@@.@@.@@@@..@@..@@..@@@...@@@...@@@...@@@@@.@@@@.@.@..@@.@@@@...@.@@..@.....@..@@@..@@@@@@.@@..@@.@.@@@@@@..@@@@.@@@@@@..
.@@@.@@..@@.@@@@.@@@.@...@..@@@@@@.@@.@@@@.@@@@.@@.@....@.@.@@.@@..@@@.@@.@.@.@.@@@@@@@..@.@.@@@@.@..@.@@@@.@@@..@..@@@.@.@..@@@@@..@@.@@
@.@.@@@@..@..@@..@....@@@@@.@@.@@@@...@.@....@.@@@@..@@.@.@@@@.@@@.@..@@@...@@@@.@@...@@@@@@.@..@.@@..@.@@@..@@..@@.@.@.....@@@@.@@.@.@@@
@...@@@@@@@.@.@@@@..@@@@@@@@@.@.@.@@.@.@@.@..@@..@@.@....@@@@...@.@@@@@@@@@@@@@@@@@@...@..@@@@.@...@@....@.@..@@.@.@@@..@@@@@..@.@....@@.
@@...@.@.@@.@@@.@@.@.@..@@@@@@@@@@@@.@@@.@@.@.@@@@@..@@..@@.@..@.@@@.@@.@.@@..@@..@@@..@@.@..@@.@..@@@@@@@..@@@.@@@@@@.@.@@@@.@.@@.@@@@@@
..@@.@@@.@@@@@.@..@@@.....@@..@@@@@.@.@@...@@...@..@.@@@@@@@@@@@@@.@@@@@@@.@@..@.@@@@@..@@@.@.@..@.@@.@@@@.@@@@.@@@@@@@.@.@@.@.@@@.@@...@
@@.@@@...@.@...@..@..@@@@@@@.@.@...@..@@@@..@@.@.@@@.@.@@@.@@@.@@.@@@@@.@@@.@.@.@...@@..@@@@@@.@.@.@@@@@@@.@@..@@@@@.@@@...@..@...@@@.@@@
.@@@@.@@@.@..@@@@@@@@..@@@@..@..@@.@.@@@@.@@@@..@...@@@.@@@@@@..@@@@.@@@@@@.@@@@@@@@@@..@@.@@@.@@@@.@@@@@.@@@@@..@@@@@@@@@.@@@@..@.@@@@.@
@@.@@...@.@@..@.@@@.@@@.@....@@@@@@@.@@@@.@@.@.@@@@@@@.@@@@@@@.@@@.@..@@.@@@@...@.@@@@@.@.@@.@@@@@@@.@.@@@...@@@@@.@@.@@@....@.@@.@@.@@@.
@@..@@..@@..@@@@.@@..@@.@@@@@@.@@@@@@...@@@@.@@@.@@...@@@@.@.@@..@@@@....@@@.@.@@@..@@......@@..@..@@@@..@@@.@.....@.@@@..@.@@@@@@@@@@@@@
@...@@..@@@@@@.@@@@@....@@@@.@@.@@@.@@.@@@@..@@..@.@@@@.@.@..@@@.@@.@.@..@...@@..@.@@.@.@.@@@.@@.@@@@@@..@@@@@@.@@.@@@@@@@..@@.@@.@@@.@@.
.@.@..@.@@@..@@@@@@.@@.@@@@@@.@@@@.@@.@@@@@@@@@@.@.@@@@@..@..@.@@@@.@.@@.@@@@.@@...@.@...@@@@..@@@@@@@@..@@@@@.@@@@...@@@...@@@@.@@@.@@@.
.@@..@@@@...@@.@@@@..@..@@.@..@@@@@.@@@@.@@@..@@..@.@@...@.@@@.@@@..@.@@@@@.@@@@@.@@.@@@@@@...@.@@.@@...@.@@@.@@.@@.@@@.@.@@@@@...@...@..
@@@.@..@.@.@@@@..@@@@@@@.@@@@@.@.@@@.@@..@.@@.@@@@@@@@@.@@..@@@@@@@@@...@@@@.@@.@@@@@@@.@.@@@@@@@@...@@@@.@@@@...@@@@.@@@@@@@.@@@..@..@@@
@.@..@@@@@@.@@.@.@...@.@@..@@.@.@@..@.@@@@@@@@..@..@@@@@@@@@@@@@..@@...@@.@@@@@@.@@@@...@@.@..@...@@@@@@.@@@.@@@.@@@.@@.@@@@@.@@@..@@.@.@
..@.@.@@..@..@@.@@.@@.@@@@@.@.@.@.@@@@@@..@..@@@@@.@@.@@...@@@@@.@....@@@.@@@.@.@@@@@.@@...@@.@@.@@...@@@@@@..@.@@@@@@@@@@@@.@..@@@...@.@
@@@@@@.@....@@.@@@@@@@@@@@@.@@@@@@@.@@.@@@..@@...@.@@@.@..@@@@.@@@.@...@@..@.@@..@@.@@.@@@..@@..@...@@@@..@.@...@@@..@.@@.@..@.@@.@..@@@@
@@@@.@@@@@@@@@.@@.@@.@@@@.@@.@@.@@@@@@@@@@.@@@@.@..@...@@@@.@.@@@@@@@@@@@@.@@.@@@@@@@.@.@@@.@@@@@..@.@@..@@@..@@.@@....@..@@@@.@@@@@@@@@@
@@.@@.@@@.@...@@.@@.@@.@@@@@..@@@..@@.@@@@@@@@@@@@@@.@@@@..@...@..@@@..@@.@@@.@@@.@@@@@@@@@@@.@@..@@.@..@.@..@@.@.@@.@.@@@@@.@.@@@@@.@.@.
.@@@@@@.@..@..@.@@.@@@@..@.@.@.@@.@.@..@@@.@@@..@@@@@@.@@@@..@.@.@@@@@@@@@@@@.@@@.@@@@@.@.@@....@@@.@..@@.@.@.@@@.@.@..@.@@.@@@@@@.@@.@@@
..@.@@@@.@@@..@.@@@..@@......@@@@@.@.@@.@.@.@@.@..@@...@.@@@...@@@.@@.@.@...@..@@.@.@.@@@@..@.@.@@@..@@.@..@@.@.@@@@@@@@.@..@@@@@@..@@...
@@.@@@..@@@@@@@@@@@.@@@@.@@@@@@@@@@@.@.@@@@@@@..@@.@@@@@.@@@@@.@@..@@@@@.@@@....@@@@.@@@@@@@.@@@@@@@..@.@@@..@@@@.@@@@.@@@..@.@@..@@..@@.
@@@@.@@@@..@@..@@@...@@@....@@.@@@@@@@@@@@..@..@@@@@.@@@@@@@@@.@..@..@@@.@.@..@.@@@@@@@@@@...@..@.@@@.@.@.@.@.@@@@.@@@.@@@@@@.@..@@.@@.@.
@.@@.@@@@@@@.@@@@@@@.@..@@@@@.@@@@@..@@@...@@@.@@@.@@.@@@@.@.@@@..@.@@@@@..@@@.@@@@@@@@...@@@..@.@.@@.@@@@@.....@@@@.@@@@.@@@@@.@..@.@.@.
@@...@..@@@@@@@@@@@@@...@.@@@@@@@@.@@@@@...@..@.@.@.@....@@@.@@@...@@.@@@.@@.@@@...@@@..@..@@@@.@..@.@@.@@...@.@@...@@@...@@@@@.@@@@@...@
.@.@..@....@@.@@...@.....@@.@.@@@@@@@.@@.@@@@.@....@@..@..@@@@..@@@.@@.@@.@@@@..@.@..@@@@@@@.@@.@.@@@..@...@@@@..@.@.@@.@@@@@@@@@.@.@@..@
@.@@@@.@@@@...@..@.@@@@@@@.@@@@@@@.@.@@@@...@..@@@@.@.@..@.@@@@.@@@@@@..@.@@@.@@@@@@...@..@@@@.@.@@@@@@@.@@@@.@..@@.@@..@@..@@.@@.@@@@@.@
..@@.@@@..@.@@@@@@@.@@@@@@..@..@.@.@@...@@@@@.@.@.@.@@@.@@@.....@.@.@@@@@@..@@@@..@@.@@..@@@@@@.@.@@@@@@.@..@..@@@...@.@@@@.@@@@@@@@@.@.@
@.@@.@.@@.@@.@@.@.@.@@...@@@@..........@..@@@@.@@@@@@@@@@@@@@@@.@....@....@@@@@@.@@@@....@.@.@.@@@...@@@@@@@.@@@@.@@@@@@@.@@.@...@@..@...
@@...@@.@.....@..@.@@@@@@@.@........@@@.@.@.@@@.@..@@@..@@@@@.@@@.@.@@@@@..@@@.@@@.@@@.@@@@@@.@.@..@@.@@@@@@.@@@@.@@..@.@.@@@@@@@@@@..@.@
@@@@.@@.@...@@@@@@.@@.@.@@@@@@@@@.@@@@.@@@.@.@@@@@@@@..@@@@@@@@.@@@@@.@@@@...@..@.@.@.@@...@@@.@@..@@.@.@@@@@@@..@@@.@..@@.@@@.@@..@@@.@@
@@.@@.@@.@@@@@@@@.@@@@@..@@@.@.@@@@..@@.@......@@@@.@@@@.@.@@@@.@.@@.@@.@..@..@@.@@.@.@@.@@.@@.@..@@.@..@.@@.@@@@.@@@@@.@@@.@..@.@@.@..@@
@.@@.@@.@@.@@@@@..@@@.@@@.@@@@@@@@@@@.@.@@@.@.@@.@.@@@@@..@@..@@@@@@.@@@.@....@@@@@.@@.@@.@@@@@@@@@@@@@.@@.@.@.@@@@..@@@@..@@@@@@@.@.@@.@
...@..@.@@@.@@@....@.@@....@@@...@.@@@.@@@@@@@@@.@@@.@.@..@@@@..@.@.@..@@@@@@@@@@@.@@@.@@.@@@@@@.@.@@@.@.@@@.@..@...@@@.@@@@.@@..@.@.@@@.
@@@@@@.@@@.@@.@..@@@.@@...@@.@@@@@@@@@..@@...@.@@@@.@@@@@@@.@@@@@@@@.@@@.@@@.@@@@.@@@@@..@@@@..@.@..@...@.@.@@@@.@@..@@@.@@..@@@@@@@.@..@
@@@.@.@..@@@@.@...@...@@@@..@....@@.@@@...@@.@.@@@@@@.@@@@.@.@@@@..@@..@@@@@.@.@@@..@.@..@.@@@..@@.@@.@@.@@@@@@.@@@@.@@...@@@@@..@@@@@.@.
@..@.@@@@@.@@.@@@@@@@@@@@@@@@@@..@@@.@@@....@@...@@......@..@@.@@@@.@.@..@@@@.@@@.@@@@.@.@.@.@@.@@.@@@@@@.@.@..@.@@@..@.@@.@@.@@@@....@@@
@@..@@@.@@@...@@@.@@@@@.@@.@.@.@@.....@@@@...@@@.@@@@@.@@.@.@@.@@@..@.@@....@@..@.@@@@...@...@@@.@@@....@@@.@@..@..@.@..@@..@@..@@@@@@.@@
@@@@.@@@@@@@@@.@@@@@@@@@.@.@@@@@@@@..@.@..@@.@@..@@@@@@@.@@@@@@@.@@@@..@..@.@..@.@@@...@.@.@@@@@.@.@@@..@@@@.@@@.@@.@.@..@@@.@.....@.@..@
.@..@@@@...@@@..@...@@.@@.@@@@.@@..@@@@@@@@@.@@@@.@@@@.@@.@.@@@@@@@@.@.@.@@@.@.@.@.@.@@@@.@.@..@....@@@@..@.@@.@@@@...@.@.@@@.@@@@@.@@@..
...@@.@@@@...@@.@@@.@@@.@@@@@.@@.@@.@@.@@@...@..@.@@.@@@@@.@@@.@@@.@.@..@@@.@@@@@@...@@.@@@.@@@@@@..@@...@@@@@@@....@..@.@@.@@@@.@.@@@@@@
......@.@@@@@.@..@@@@@@@@@.@....@@..@@@@@@@@@@.@.@@@@@@.@.@@@..@@@..@@.@@.@.@...@@@@.@@@@.@@@@.@@.@@@.@@.@@@@@@..@@@.@.@..@@.@.@@@@.@@@..
.@@..@@@@@@@@@@@@.@@..@@@.@.@.@.@.@@.@@@..@@.@@@.@@@@@.@@@@@@@@@.@.@@@@..@@@@.@.@...@.@@@@..@@@.@@.@.......@....@@@.@@.@.@@@.@...@@@@@@@@
@@@@...@@..@@.@@.@@@@.@@@@.@.@@@.@..@..@.@.@.@@@@@@@@@..@.@.@..@..@...@@@@@..@.@@@..@@@@@@@.@@.@@@@.@@.@@...@@@@@@@..@@@@@.@@@.@@.@@@@@.@
@@..@....@@.@.@..@.@@@.@@.@@@@@@..@@@@.@@.@@@..@@@.@@@@@...@@@@..@@@@.@..@.@.@@@@@.@.@@@..@@.@.@..@@.....@.@.@@.@@.@@..@@@@.@@.@@@.@.@@@@
.@@@.@@@.@@....@@@@....@.@...@@@@@.@@..@@..@@..@..@@@@@@@..@@@@..@.@@@.@..@@@@@.@@@.@@.@..@.@.@@@.@@.@@@.@@@@....@.@@.@......@@@@@@..@@@@
@@@@@@@.@@@.@@@@@@@@@@@@.@.@@.@.@@..@.@@@@@@@@@@...@@.@...@@@@..@@@@@@@@@@@.@@@@.@@@.@.@@.@@..@@@@@..@@@@@..@@@.@.@@@..@.@@@.@@@@.@.@@@@.
@.@.@.@.@@@.@@.@.@..@@@..@@@..@@.@.......@@@@.@.@.@...@..@@@@.@.@@@@@@.@.@@@@@@.@@.@.@@@.@....@@@@@@@.@@@@@@@@@@@@..@@@@@.@@@@.@@@@...@@.
@..@@@@@.@@..@@@@@.@@@@@.@@...@@@.@.@@@@@.@@@..@@@@.@@.@@@.@.@@@@@@@@@.@@.@@...@@..@@@.@...@@@@@.@@@.@@@@@..@@@...@.@@@..@@@@@@@@.@@@.@.@
@.@@@@@.@@@@@..@@@..@@..@@.@@.@.@@@@.@..@@..@@.@..@@.@@@@@.@@@@@@@.@@@@@@@@@@@@@...@.@.@@@..@.@@@...@..@@@..@@@@@.@@@@@@@.@@.@@@@@..@@@..
@@..@.@@@@@@@@@.@@@@@.@@@@.@@@@.@@@..@@@@@@@@@@.@@..@@@.@@@@@@@...@@@.@@@@.@.@@@@@@@@@@.@.@.@@@@.@@..@.@.@.@...@@@@@.@.@@@..@@@..@.@.@@@@
.@@@@@@@@@.@..@.@@@.@@.@..@.@@@..@.@@@.@@@@@@@@.@.@.@@.@@@...@@@@@@@@@.@@@@@@@@.@@@@...@@@.@.@.@@.@@@@@@@..@@@.@@@@@.@.@@.@@.@.@@.@.@@...
@.@...@@@.@..@...@.@@@..@.@@@@.@...@..@@@@@@@@@@@....@@.@@....@@@.@@..@@@@@@.@@@@..@@.@..@@.@.@@..@..@@@.@.@.@@...@@@@@@@@.@.@.@@@@@.@@@@
@.@@@@.@@@.@..@@.@@@@.@@@.@@@@@.@.@@@.@.@..@..@@@.@@@@.@@@@@@.@@@@...@@@....@..@@@@.@@@..@@..@@@.@@@@@.@.@@@@.@.@..@@...@...@@@@@@.@..@@.
@@.@@@.....@@@@@@@.@...@@@..@..@@@@.@@...@.@@@@....@@.@@.@.@@.@.@@@@.@@.@@@@@@@@@@@@...@.@..@@@.@@.@..@.@@@.@@@@@@@..@@.@@.@@@@@@@@@@@@.@
..@@@@@@@....@.@@@@.@.@@@@.@@@.@@@.@@@.@@@..@@.@@.@@@@@..@.@@..@@@@@@@@@@@@.@@..@@.@@@..@@@@@@@@@@@@@.@@..@.@@.@@@.@@@@@@@..@.@.@@..@@@@@
@..@@@..@.@@@@@@@@@@.@@@@@@@@.@@@@.@@...@.@@@.@@@..@@.@@@.@.@@@@@@@@@@.@@.@@@@.@@@.@@.@@@@@@.@....@...@@@.@@@@@@.@..@.@@.@.@@@..@@.@@@@.@
@@@.@@....@@@.@.@@.@@..@..@.@.@@@..@.@@@@..@..@.@@@@@@@@.@.@..@.@@@.@.@@@@.@..@..@..@@.@.@@.@@.@@@@@@@@@@.@...@@@@.@@.@@@@.@@@@@.@@@@@@@.
.@@@.@@.@@..@....@@@@..@@..@@...@@@.@@@@....@@@@..@.@.@.@.@..@@@.@@@@@@@@.@@.@@@.@.@@.@..@..@.@.@.@@@@.@@@@@@.@...@@.@@@.@@@@@@@@.@@....@
@..@@..@@.@...@..@.@.@@.@@...@@@@@@.@@..@@@@@.@@@@@@@@.@..@@@.......@.@.@.....@@@@@@..@.@.@.@@@@..@.@.@@@@@@.@@.@...@.@@.@@@@..@.@@@@@@..
@@@@@@@@@...@..@@@@@@@.@@.@@@.@@@@@@..@@.@@@@@..@@.@.@@@@@.@@@@@@@..@@@@@@@@@@@..@@@@.@@.@@@@.@@.@@@.@@@@@@@@.@@@.@..@.@.@@.@..@.@..@.@.@
@@..@@.@@.@.@@@@@@..@@@@.@@@@...@@@@@@@@@..@@@.@@@.@...@...@.@@.@..@....@.@@.@@.@@@..@...@.@@@@@@@@@@...@.@@@@.@..@...@@.@@@@..@@.@@.@.@@
@@.@@.@..@@..@@@@@.@@.@@@@..@@@@@@@@.@.@@.@@@@@@@@@@.@..@@.@@..@@@@@.@@@@.@.@@..@@@@@@@@.@@..@....@@@@@@@@.@.@@..@@...@@.@@@.@..@.@@@@@@@
@.@@..@@@..@.@@.@...@@...@@.@....@.@@.@.@@@@@@.@@.@@.@@@@.@@@@@.@@.@..@@@@..@@@@.@@@@@@..@@.@@@.@@@.@@@@@@@.@.@..@..@@@@@...@@.....@@@@@@
@..@@@@@.@@.@....@@.@.@..@..@.@@@.@@@.@.@.@@@.@..@@@@..@@@@@@.@@@@.@.@@...@@@.@@@@.@@@@.@..@@@@@.@.@.@.@@@@@@..@.@@@@@@...@@@@.@.@.@@.@..
@@@@@.@@@..@@@........@@@..@.@@...@..@@@@@@@.@.@@@@.@@@@@@@...@@@@.@@.@@.....@@@.@..@.@@@@@.@@@@@@.@.@@.@.@@@@.@@.@.@.@.@@@@..@.@.@.@@..@
...@@@@..@@@.@.@.@.@@.@@.@...@...@@@.@@@.@@.@@@.@@@..@@.@@@@.@@@@@@@.@.@..@@.@@@.@.@@..@@.@@@@...@@@..@.@.@@@@.@.@@@@.@@@@...@@...@@@@@@.

150
puzzle/2025/04/prompt.html Normal file
View File

@ -0,0 +1,150 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8"/>
<title>Day 4 - Advent of Code 2025</title>
<link rel="stylesheet" type="text/css" href="/static/style.css?32"/>
<link rel="stylesheet alternate" type="text/css" href="/static/highcontrast.css?2" title="High Contrast"/>
<link rel="shortcut icon" href="/favicon.png"/>
<script>window.addEventListener('click', function(e,s,r){if(e.target.nodeName==='CODE'&&e.detail===3){s=window.getSelection();s.removeAllRanges();r=document.createRange();r.selectNodeContents(e.target);s.addRange(r);}});</script>
</head><!--
Oh, hello! Funny seeing you here.
I appreciate your enthusiasm, but you aren't going to find much down here.
There certainly aren't clues to any of the puzzles. The best surprises don't
even appear in the source until you unlock them for real.
Please be careful with automated requests; I'm not a massive company, and I can
only take so much traffic. Please be considerate so that everyone gets to play.
If you're curious about how Advent of Code works, it's running on some custom
Perl code. Other than a few integrations (auth, analytics, social media), I
built the whole thing myself, including the design, animations, prose, and all
of the puzzles.
The puzzles are most of the work; preparing a new calendar and a new set of
puzzles takes all of my free time for months every year. A lot of effort went
into building this thing - I hope you're enjoying playing it as much as I
enjoyed making it for you!
If you'd like to hang out, I'm @was.tl on Bluesky and @ericwastl@hachyderm.io
on Mastodon.
- Eric Wastl
-->
<body>
<header><div><h1 class="title-global"><a href="/">Advent of Code</a></h1><nav><ul><li><a href="/2025/about">[About]</a></li><li><a href="/2025/events">[Events]</a></li><li><a href="/2025/shop">[Shop]</a></li><li><a href="/2025/settings">[Settings]</a></li><li><a href="/2025/auth/logout">[Log Out]</a></li></ul></nav><div class="user">buhman</div></div><div><h1 class="title-event">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">/^</span><a href="/2025">2025</a><span class="title-event-wrap">$/</span></h1><nav><ul><li><a href="/2025">[Calendar]</a></li><li><a href="/2025/support">[AoC++]</a></li><li><a href="/2025/sponsors">[Sponsors]</a></li><li><a href="/2025/leaderboard/private">[Leaderboards]</a></li><li><a href="/2025/stats">[Stats]</a></li></ul></nav></div></header>
<div id="sidebar">
<div id="sponsor"><div class="quiet">Our <a href="/2025/sponsors">sponsors</a> help make Advent of Code possible:</div><div class="sponsor"><a href="/2025/sponsors/redirect?url=https%3A%2F%2Feu1%2Ehubs%2Ely%2FH0q0W730" target="_blank" onclick="if(ga)ga('send','event','sponsor','sidebar',this.href);" rel="noopener">CGI</a> - Join our Software Development Revolution. Discover how AI is transforming the way we build software and how we&apos;re building what&apos;s next.</div></div>
</div><!--/sidebar-->
<main>
<article class="day-desc"><h2>--- Day 4: Printing Department ---</h2><p>You ride the escalator down to the printing department. They're clearly getting ready for Christmas; they have lots of large rolls of paper everywhere, and there's even a massive printer in the corner (to handle the really <span title="This joke is stupid and I love it.">big</span> print jobs).</p>
<p>Decorating here will be easy: they can make their own decorations. What you really need is a way to get further into the North Pole base while the elevators are offline.</p>
<p>"Actually, maybe we can help with that," one of the Elves replies when you ask for help. "We're pretty sure there's a cafeteria on the other side of the back wall. If we could break through the wall, you'd be able to keep moving. It's too bad all of our forklifts are so busy moving those big rolls of paper around."</p>
<p>If you can optimize the work the forklifts are doing, maybe they would have time to spare to break through the wall.</p>
<p>The rolls of paper (<code>@</code>) are arranged on a large grid; the Elves even have a helpful diagram (your puzzle input) indicating where everything is located.</p>
<p>For example:</p>
<pre><code>..@@.@@@@.
@@@.@.@.@@
@@@@@.@.@@
@.@@@@..@.
@@.@@@@.@@
.@@@@@@@.@
.@.@.@.@@@
@.@@@.@@@@
.@@@@@@@@.
@.@.@@@.@.
</code></pre>
<p>The forklifts can only access a roll of paper if there are <em>fewer than four rolls of paper</em> in the eight adjacent positions. If you can figure out which rolls of paper the forklifts can access, they'll spend less time looking and more time breaking down the wall to the cafeteria.</p>
<p>In this example, there are <code><em>13</em></code> rolls of paper that can be accessed by a forklift (marked with <code>x</code>):</p>
<pre><code>..xx.xx@x.
x@@.@.@.@@
@@@@@.x.@@
@.@@@@..@.
x@.@@@@.@x
.@@@@@@@.@
.@.@.@.@@@
x.@@@.@@@@
.@@@@@@@@.
x.x.@@@.x.
</code></pre>
<p>Consider your complete diagram of the paper roll locations. <em>How many rolls of paper can be accessed by a forklift?</em></p>
</article>
<p>To begin, <a href="4/input" target="_blank">get your puzzle input</a>.</p>
<form method="post" action="4/answer"><input type="hidden" name="level" value="1"/><p>Answer: <input type="text" name="answer" autocomplete="off"/> <input type="submit" value="[Submit]"/></p></form>
<p>You can also <span class="share">[Share<span class="share-content">on
<a href="https://bsky.app/intent/compose?text=%22Printing+Department%22+%2D+Day+4+%2D+Advent+of+Code+2025+%23AdventOfCode+https%3A%2F%2Fadventofcode%2Ecom%2F2025%2Fday%2F4" target="_blank">Bluesky</a>
<a href="https://twitter.com/intent/tweet?text=%22Printing+Department%22+%2D+Day+4+%2D+Advent+of+Code+2025&amp;url=https%3A%2F%2Fadventofcode%2Ecom%2F2025%2Fday%2F4&amp;related=ericwastl&amp;hashtags=AdventOfCode" target="_blank">Twitter</a>
<a href="javascript:void(0);" onclick="var ms; try{ms=localStorage.getItem('mastodon.server')}finally{} if(typeof ms!=='string')ms=''; ms=prompt('Mastodon Server?',ms); if(typeof ms==='string' && ms.length){this.href='https://'+ms+'/share?text=%22Printing+Department%22+%2D+Day+4+%2D+Advent+of+Code+2025+%23AdventOfCode+https%3A%2F%2Fadventofcode%2Ecom%2F2025%2Fday%2F4';try{localStorage.setItem('mastodon.server',ms);}finally{}}else{return false;}" target="_blank">Mastodon</a
></span>]</span> this puzzle.</p>
</main>
<!-- ga -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-69522494-1', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
</script>
<!-- /ga -->
</body>
</html>

1187
puzzle/2025/05/input Normal file

File diff suppressed because it is too large Load Diff

148
puzzle/2025/05/prompt.html Normal file
View File

@ -0,0 +1,148 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8"/>
<title>Day 5 - Advent of Code 2025</title>
<link rel="stylesheet" type="text/css" href="/static/style.css?32"/>
<link rel="stylesheet alternate" type="text/css" href="/static/highcontrast.css?2" title="High Contrast"/>
<link rel="shortcut icon" href="/favicon.png"/>
<script>window.addEventListener('click', function(e,s,r){if(e.target.nodeName==='CODE'&&e.detail===3){s=window.getSelection();s.removeAllRanges();r=document.createRange();r.selectNodeContents(e.target);s.addRange(r);}});</script>
</head><!--
Oh, hello! Funny seeing you here.
I appreciate your enthusiasm, but you aren't going to find much down here.
There certainly aren't clues to any of the puzzles. The best surprises don't
even appear in the source until you unlock them for real.
Please be careful with automated requests; I'm not a massive company, and I can
only take so much traffic. Please be considerate so that everyone gets to play.
If you're curious about how Advent of Code works, it's running on some custom
Perl code. Other than a few integrations (auth, analytics, social media), I
built the whole thing myself, including the design, animations, prose, and all
of the puzzles.
The puzzles are most of the work; preparing a new calendar and a new set of
puzzles takes all of my free time for months every year. A lot of effort went
into building this thing - I hope you're enjoying playing it as much as I
enjoyed making it for you!
If you'd like to hang out, I'm @was.tl on Bluesky and @ericwastl@hachyderm.io
on Mastodon.
- Eric Wastl
-->
<body>
<header><div><h1 class="title-global"><a href="/">Advent of Code</a></h1><nav><ul><li><a href="/2025/about">[About]</a></li><li><a href="/2025/events">[Events]</a></li><li><a href="/2025/shop">[Shop]</a></li><li><a href="/2025/settings">[Settings]</a></li><li><a href="/2025/auth/logout">[Log Out]</a></li></ul></nav><div class="user">buhman</div></div><div><h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">0xffff&amp;</span><a href="/2025">2025</a><span class="title-event-wrap"></span></h1><nav><ul><li><a href="/2025">[Calendar]</a></li><li><a href="/2025/support">[AoC++]</a></li><li><a href="/2025/sponsors">[Sponsors]</a></li><li><a href="/2025/leaderboard/private">[Leaderboards]</a></li><li><a href="/2025/stats">[Stats]</a></li></ul></nav></div></header>
<div id="sidebar">
<div id="sponsor"><div class="quiet">Our <a href="/2025/sponsors">sponsors</a> help make Advent of Code possible:</div><div class="sponsor"><a href="/2025/sponsors/redirect?url=https%3A%2F%2Fhoneycomb%2Eio%2F" target="_blank" onclick="if(ga)ga('send','event','sponsor','sidebar',this.href);" rel="noopener">Honeycomb</a> - The observability platform that helps teams solve problems they couldn&apos;t before, with unified telemetry and fast, powerful querying.</div></div>
</div><!--/sidebar-->
<main>
<article class="day-desc"><h2>--- Day 5: Cafeteria ---</h2><p>As the forklifts break through the wall, the Elves are delighted to discover that there was a cafeteria on the other side after all.</p>
<p>You can hear a commotion coming from the kitchen. "At this rate, we won't have any time left to put the wreaths up in the dining hall!" Resolute in your quest, you investigate.</p>
<p>"If only we hadn't switched to the new inventory management system right before Christmas!" another Elf exclaims. You ask what's going on.</p>
<p>The Elves in the kitchen explain the situation: because of their complicated new inventory management system, they can't figure out which of their ingredients are <em>fresh</em> and which are <span title="No, this puzzle does not take place on Gleba. Why do you ask?"><em>spoiled</em></span>. When you ask how it works, they give you a copy of their database (your puzzle input).</p>
<p>The database operates on <em>ingredient IDs</em>. It consists of a list of <em>fresh ingredient ID ranges</em>, a blank line, and a list of <em>available ingredient IDs</em>. For example:</p>
<pre><code>3-5
10-14
16-20
12-18
1
5
8
11
17
32
</code></pre>
<p>The fresh ID ranges are <em>inclusive</em>: the range <code>3-5</code> means that ingredient IDs <code>3</code>, <code>4</code>, and <code>5</code> are all <em>fresh</em>. The ranges can also <em>overlap</em>; an ingredient ID is fresh if it is in <em>any</em> range.</p>
<p>The Elves are trying to determine which of the <em>available ingredient IDs</em> are <em>fresh</em>. In this example, this is done as follows:</p>
<ul>
<li>Ingredient ID <code>1</code> is spoiled because it does not fall into any range.</li>
<li>Ingredient ID <code>5</code> is <em>fresh</em> because it falls into range <code>3-5</code>.</li>
<li>Ingredient ID <code>8</code> is spoiled.</li>
<li>Ingredient ID <code>11</code> is <em>fresh</em> because it falls into range <code>10-14</code>.</li>
<li>Ingredient ID <code>17</code> is <em>fresh</em> because it falls into range <code>16-20</code> as well as range <code>12-18</code>.</li>
<li>Ingredient ID <code>32</code> is spoiled.</li>
</ul>
<p>So, in this example, <em><code>3</code></em> of the available ingredient IDs are fresh.</p>
<p>Process the database file from the new inventory management system. <em>How many of the available ingredient IDs are fresh?</em></p>
</article>
<p>To begin, <a href="5/input" target="_blank">get your puzzle input</a>.</p>
<form method="post" action="5/answer"><input type="hidden" name="level" value="1"/><p>Answer: <input type="text" name="answer" autocomplete="off"/> <input type="submit" value="[Submit]"/></p></form>
<p>You can also <span class="share">[Share<span class="share-content">on
<a href="https://bsky.app/intent/compose?text=%22Cafeteria%22+%2D+Day+5+%2D+Advent+of+Code+2025+%23AdventOfCode+https%3A%2F%2Fadventofcode%2Ecom%2F2025%2Fday%2F5" target="_blank">Bluesky</a>
<a href="https://twitter.com/intent/tweet?text=%22Cafeteria%22+%2D+Day+5+%2D+Advent+of+Code+2025&amp;url=https%3A%2F%2Fadventofcode%2Ecom%2F2025%2Fday%2F5&amp;related=ericwastl&amp;hashtags=AdventOfCode" target="_blank">Twitter</a>
<a href="javascript:void(0);" onclick="var ms; try{ms=localStorage.getItem('mastodon.server')}finally{} if(typeof ms!=='string')ms=''; ms=prompt('Mastodon Server?',ms); if(typeof ms==='string' && ms.length){this.href='https://'+ms+'/share?text=%22Cafeteria%22+%2D+Day+5+%2D+Advent+of+Code+2025+%23AdventOfCode+https%3A%2F%2Fadventofcode%2Ecom%2F2025%2Fday%2F5';try{localStorage.setItem('mastodon.server',ms);}finally{}}else{return false;}" target="_blank">Mastodon</a
></span>]</span> this puzzle.</p>
</main>
<!-- ga -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-69522494-1', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
</script>
<!-- /ga -->
</body>
</html>

5
puzzle/2025/06/input Normal file
View File

@ -0,0 +1,5 @@
7 49 28 99 6 92 61 13 6 792 94 596 3976 8 9 8 81 77 2 26 569 449 2 91 57 6 4241 6 416 627 454 36 12 27 539 33 4 1 373 33 53 19 8 28 4 78 9 173 35 458 567 844 6343 277 3953 614 28 2 425 2911 445 4414 95 53 993 94 48 3 619 9 661 991 477 35 1421 337 96 1 95 66 3 32 86 9978 7891 93 7969 43 6 546 58 6 8 8 69 97 43 462 7 513 1 695 812 15 368 1 55 56 9946 3 3134 78 4 63 7 7 29 1968 47 44 919 63 29 71 722 454 86 2 3172 2195 622 456 4 615 73 94 962 3672 3 25 224 968 79 88 57 96 8 345 47 64 29 85 875 9 84 49 56 6637 7 2 33 37 866 6 4 7 293 9735 3 817 641 3 85 4 8225 372 3 4455 74 52 17 11 286 82 6638 2894 486 4 25 7 82 7237 21 725 81 38 15 793 2345 849 2342 25 125 18 67 1 7 7 752 9253 79 8445 31 6 57 6 88 5 19 83 83 4 5 56 84 31 949 23 118 15 63 2424 453 3574 53 71 5 28 611 243 44 75 2281 19 7 7136 3926 381 467 72 7595 682 48 95 218 192 58 539 26 9 2 76 78 12 61 18 62 3664 5 866 48 37 27 669 13 434 55 5193 486 2128 77 74 92 623 63 55 82 62 95 12 852 31 73 85 9 7 84 44 88 7 151 433 631 137 33 6 14 49 719 9 665 75 8 8 18 968 511 68 769 26 46 873 837 92 51 81 387 619 49 47 73 794 562 32 15 8939 786 12 12 93 652 84 9 286 93 138 49 79 28 63 465 886 93 17 95 34 3 684 6 54 763 4 341 92 94 3 4 6 8 245 221 26 323 21 83 2 794 236 619 36 526 86 588 9582 416 73 4 8 48 92 1372 313 48 93 82 66 589 2 594 89 52 315 79 25 9 36 332 82 1968 1 19 1 2229 38 3 1 625 89 99 4471 81 74 36 6 5 5928 4 351 24 6 559 74 384 5 15 75 9645 485 98 39 4 97 91 3 9 6383 62 36 479 5 953 45 89 735 752 99 9 5891 146 86 8 653 6563 766 161 872 7 82 86 517 4 152 19 28 61 47 59 828 55 6341 1237 28 988 45 667 846 11 79 4 98 33 425 14 25 7726 5639 77 8 83 636 766 26 574 6169 33 775 395 5 3 569 9 68 89 1 43 2 477 859 7 143 489 299 257 137 27 8629 1 974 2 64 9 92 767 1 852 96 427 7616 88 625 68 1841 22 851 2 839 15 9 7885 6 343 32 762 37 6634 78 4 1 934 367 8359 694 91 3 2 2 593 85 23 682 36 7 84 882 379 86 6982 447 57 835 2 35 2985 9 43 1 8 3 431 774 36 87 6 23 918 44 899 56 2 31 176 64 4943 83 2 89 2 5 922 79 28 761 9979 727 22 71 87 961 627 42 7 83 23 8 73 988 437 25 4381 48 1 69 4 297 85 23 91 886 43 48 393 566 83 21 95 92 1 6 6142 5 486 11 64 742 171 21 95 31 27 32 36 57 32 75 8 25 69 4399 8 36 11 133 1 433 57 27 7 689 737 97 45 57 417 88 98 6855 39 789 53 339 58 4 8554 2 5585 1 195 27 11 44 243 61 5 26 955 92 5 95 81 3697 69 92 7147 8 5629 1 1 94 42 34 7 3 35 3 57 1 226 46 8 8451 826 7 12 2 698 281 696 312 85 64 9 21 91 872 3244 35 14 4765 869 4 232 8242 98 443 38 53 8 744 54 67 4953 9 728 3 6813 17 56 314 13 19 136 921 6123 4527 39 816 186 6 122 95 6 838 238 749 5 22 8 62 16 11 395 6 2 9 19 32 5 26 941 11 732 292 142 8728 74 894 896 73 77 52 796 3 16 21 8225 6547 3 62 57 69 3995 95 62 4 975 53 34 36 38 69 2 7 42 68 4 2 18 3 27 8 8675 492 6 459 88 51 88 5618 1 8 7 823 42 8 7222 911 26 62 6 13 26 2 7849 2 36 911 286 22 8 52 9 427 46 59 74 93 17 89 797 9 66 99 52 1 23 4 28 57 99 1393 872 965 253 47 244 31 8576 71 475 712 65 67 6 639 281 99 5 56 282 84 293 122 48 4 326 1 332 452 4 76 6 12 97 99 99 41 275 7529 76 13 23 95 35 931 5 624 5425 12 121 26 55 4 592 482 9 295 363 34 54 4 4919 52 39 5 6 4 72 4951 9346 5934 73 615 554 82 87 8247 52 261 28 14 862 15 4 64 462 5 61 55 1 59 2678 5 414 593 3347 4 2 52 2 29 148 7949 41 368 148 2 38 19 829 399
495 11 34 53 175 74 95 36 8 643 9 658 391 1 276 33 75 69 31 28 595 338 15 54 77 35 1927 74 131 281 382 67 83 85 725 795 49 97 143 94 49 75 8 36 163 28 1 322 956 281 377 76 2194 713 8932 539 46 1 742 3593 722 6255 94 31 271 989 67 3 457 2 876 352 837 41 6941 455 52 8 99 69 94 16 16 4154 6861 65 1588 2 4 77 57 636 161 82 15 91 25 746 2 519 54 243 811 63 867 9 39 14 7265 1 5287 64 4 67 3 6 99 289 13 15 43 26 695 61 148 755 5251 4 2334 4614 389 552 5 783 395 85 848 8973 3 31 433 969 15 6678 61 38 7 866 68 97 786 26 139 76 115 92 86 8885 24 12 44 35 893 7258 44 41 393 8241 87 122 768 28 28 896 5722 516 56 788 78 48 98 92 498 2878 468 1871 5165 78 42 77 97 8797 29 619 24 85 662 749 267 273 9941 67 578 87 1626 753 99 54 764 769 31 3798 13 72 15 8 384 238 98 871 1 99 185 221 27 52 878 64 758 23 276 922 265 6147 51 69 1 52 851 651 82 71 4258 312 8 3465 2469 223 416 515 4825 854 48 69 676 398 819 783 659 3 91 68 43 15 85 4 12 8244 3 724 559 95 29 351 68 846 44 6326 68 7539 346 22 62 525 77 44 549 95 44 22 463 71 54 888 156 8 82 27 76 7 283 231 367 135 763 19 43 47 8521 1 442 16 8 69 25 579 211 59 748 76 52 953 72 29 19 86 476 626 77 73 83 877 594 12 72 6839 898 13 957 36 819 791 35 3787 722 31 99 73 2 46 468 1541 43 995 37 54 112 949 82 81 579 9 168 732 33 69 63 62 26 482 411 47 495 96 69 7 264 7991 461 97 522 15 815 5169 355 87 8 72 75 42 7584 162 89 8866 21 44 577 8 548 21 15 973 74 123 7 551 593 52 8841 323 99 7 2291 91 13 91 658 21 24 7754 793 71 39 74 6 3587 87 228 24 85 363 15 231 58 58 82 6453 169 51 44 81 48 11 6 388 3448 521 834 453 49 469 391 28 224 665 73 75 7451 893 557 3 667 8169 94 785 197 4 78 787 444 83 898 8 16 49 18 18 554 659 4485 4717 45 7 593 241 656 944 929 59 88 74 924 31 52 2545 885 63 43 619 868 517 74 462 883 824 276 129 556 881 186 23 77 635 35 88 6 762 219 4 464 427 596 988 6658 94 1382 3 615 418 84 1 67 185 84 484 76 681 2466 28 945 91 886 48 97 6 72 57 74 316 61 166 32 483 14 3617 553 49 23 2693 74 9836 118 559 3 8 93 215 64 48 977 97 11 89 433 416 16 8819 874 42 275 62 56 6588 8 94 1 82 27 361 712 4 73 477 71 837 982 156 15 3 55 726 82 3554 246 381 57 5 1 748 92 84 313 9368 812 8126 71 24 715 739 17 55 51 97 81 39 439 669 36 6977 964 54 26 22 134 23 28 73 128 53 66 857 784 86 935 588 425 64 88 9451 5 434 67 83 11 357 65 64 39 83 13 663 88 15 58 266 31 94 8455 399 969 98 224 763 529 84 84 172 47 228 13 14 64 114 15 58 964 71 173 28 553 2396 4 9519 636 6864 158 2675 17 3 21 192 43 67 57 11 7 8 22 24 3386 72 26 8153 32 3538 1 95 16 44 38 233 46 19 2 99 4132 166 9717 88 8729 851 86 29 2 586 188 916 399 77 12 43 67 45 463 5166 43 26 653 553 7 1781 5898 235 711 19 28 9 741 61 79 5391 4 827 9 6388 32 49 561 94 78 346 817 537 1465 98 392 878 748 83 562 61 725 436 138 8 94 3 56 56 85 6422 23 69 68 39 96 44 29 533 66 923 459 927 937 82 954 756 35 48 64 294 8 99 52 212 5939 57 76 91 167 2982 83 527 66 441 11 53 22 34 2264 88 62 28 52 381 85 75 5 74 28 4755 871 57 723 25 56 49 2279 8 5 7 135 62 13 7364 67 777 6 5 28 64 3 3772 112 98 673 176 71 62 735 635 447 466 74 21 78 123 88 183 5 59 91 123 2 34 6 542 74 31 6497 97 72 144 64 7645 64 599 32 798 914 553 55 4 249 897 498 76 23 55 75 22 646 44 87 428 74 361 927 46 13 8 83 8 36 499 89 49 5291 34 65 387 35 217 886 62 946 2821 81 7249 89 36 75 936 435 1 881 551 64 93 6 2171 34 841 99 72 5 75 5135 6489 3885 35 679 63 32 16 8615 98 186 87 69 531 34 373 493 968 85 81 45 8166 12 8379 92 373 121 2429 578 55 55 827 82 239 6682 11 898 78 28 3176 34 415 986
3849 693 1 337 624 45 517 47 14 712 6 877 65 19 328 78 52 38 91 79 312 518 16 19 84 344 9327 2584 724 984 536 768 5 65 134 3714 84 513 87 611 872 1 19 946 415 36 683 721 225 69 68 73 427 6836 89 719 2 33 795 166 938 3316 16 71 253 1827 67 78 191 72 78 465 417 977 564 532 91 6 181 18 734 464 79 7888 8866 36 7492 7 98 75 33 579 126 145 73 64 56 339 28 173 244 62 222 7 635 89 67 58 7257 87 7819 34 854 23 77 14 78 133 57 64 11 53 571 78 94 414 9458 85 335 1426 329 624 36 631 543 31 591 9182 55 5 425 412 88 9365 212 87 2 3937 53 4 733 85 313 19 141 587 2 7768 26 68 1 77 655 3614 88 11 137 9288 62 473 46 65 966 262 244 925 926 835 51 54 68 76 616 3774 469 67 4549 24 4 13 17 1678 27 775 6 27 884 72 564 582 4182 5 941 86 9978 826 33 92 459 514 53 1978 35 73 56 443 529 555 95 5277 7 18 894 793 86 329 266 14 53 969 462 32 141 4938 37 29 82 76 767 958 67 62 8263 933 87 27 634 43 338 497 927 418 1 9 581 516 358 614 631 36 97 98 91 62 57 1 435 6779 467 743 893 84 7 38 83 873 51 825 6 728 412 59 74 45 83 56 259 44 78 26 715 23 75 619 457 19 48 79 67 554 225 432 886 552 267 58 32 7677 5536 99 461 32 59 14 15 674 526 696 96 675 29 28 8 45 218 69 238 381 88 65 18 872 78 56 861 3265 34 21 521 24 39 494 568 1177 981 6 37 48 4 59 226 3986 23 672 447 59 1783 146 72 367 23 77 6 386 596 59 875 19 885 95 58 45 557 54 44 68 879 7735 4617 79 466 46 6 7682 349 79 43 24 44 75 632 363 654 7753 84 34 658 39 184 926 8 842 73 886 97 395 418 33 8749 329 2 17 4781 93 46 44 818 39 46 5915 8911 72 68 38 563 9527 71 78 53 88 115 52 31 85 61 24 4438 559 11 83 939 6 78 6 692 7744 4464 689 323 11 324 442 83 926 79 45 96 4363 44 331 39 229 9243 28 178 25 79 712 732 336 88 227 9 64 88 78 76 947 569 822 1389 14 3 734 33 789 6186 778 19 88 51 87 69 89 6148 5 64 44 661 3136 367 673 614 274 8579 373 266 9346 248 191 24 9 119 23 23 67 76 458 51 871 246 16 599 1798 41 1959 52 93 828 36 31 38 493 61 59 15 979 299 14 226 45 462 78 39 49 97 93 714 52 98 995 36 518 49 535 542 67 11 5861 87 99 687 7669 915 1 84 131 76 69 799 52 18 68 3 979 834 754 74 91 233 2714 44 3253 74 71 59 15 815 16 537 8 366 762 45 168 258 63 2 43 7 424 155 9841 176 779 74 85 61 5 36 64 821 8415 139 9514 37 2923 96 71 78 91 37 38 53 93 567 147 33 3728 471 732 12 296 96 61 22 43 931 96 4 32 14 47 186 324 741 747 621 4345 24 275 68 24 34 134 63 26 97 61 4 5325 56 21 85 4979 53 61 3659 135 4398 73 734 8672 658 61 77 747 7 531 69 94 51 38 15 18 97 494 489 974 495 4857 98 8811 136 4577 863 5223 294 5 86 64 12 67 19 49 3 25 6137 15 81 57 14 586 99 241 27 675 138 2 458 213 42 52 26 72 5518 83 5242 327 56 631 63 46 56 47 524 995 932 98 12 96 74 45 712 4811 22 27 783 986 4521 6742 38 743 6 84 75 12 69 97 35 4394 15 436 4 9522 62 55 75 22 35 378 3 793 4118 85 485 14 534 55 478 61 55 74 37 86 98 1 15 22 66 2948 81 524 281 187 56 37 43 766 39 92 497 373 199 78 868 851 38 82 86 819 42 4 72 514 1737 86 1 59 249 698 43 238 32 173 36 88 589 12 9552 534 774 57 24 184 31 24 15 71 68 84 5714 67 144 96 6 65 1516 85 7 74 825 1 194 7791 25 186 2 49 51 6 4 8959 424 943 693 55 61 52 586 215 613 567 59 42 44 186 74 755 62 55 34 978 3 27 2 831 626 5753 781 27 2 367 33 1893 31 6 92 1 52 258 61 84 249 562 174 181 6 64 21 82 95 88 87 635 19 125 252 646 61 7 31 3 5776 247 47 26 5971 36 38 967 45 583 276 29 24 7789 5 6786 46 15 776 296 38 15 52 284 3 3 84 3953 933 692 21 51 87 94 6798 48 57 43 18 13 71 58 13 754 79 72 999 718 495 558 4783 371 68 34 8 3475 15 9125 78 614 47 5536 664 17 18 624 516 372 9285 77 582 38 434 9541 63 418 861
2238 8378 6 152 521 656 989 667 55 488 4 65 22 63 568 62 42 46 21 97 55 18 83 37 74 381 7275 2233 85 5 85 587 6 46 522 3999 369 238 23 787 965 8 26 739 365 92 887 14 823 53 52 28 57 6189 49 423 4 27 94 2 99 21 99 62 292 5892 61 19 621 32 3 77 16 111 291 91 32 43 598 11 279 8532 84 8797 593 52 6 2 82 56 77 825 814 522 42 9 84 1 23 951 559 3 985 8 189 91 48 86 225 77 28 1 193 3 52 63 29 84 25 89 48 3 735 8 3 38 4598 264 9 317 3 499 28 844 149 22 296 2374 45 2 61 636 59 1443 291 74 59 7485 21 5 939 47 613 52 987 676 9 218 14 84 4 29 98 3176 41 78 779 692 67 533 1 46 116 673 59 662 565 97 8 8 84 31 4 1821 22 5 7754 61 2 31 3 386 1 883 9 5 877 25 5 622 9 8 518 994 5287 923 24 58 6 732 93 47 24 33 55 567 814 587 87 7642 3 12 793 282 6 552 29 7 54 733 443 7 541 47 98 95 89 33 17 95 7 98 36 334 55 38 88 46 358 798 73 99 7 3 2 83 2615 283 381 26 53 3 85 9 2 3 253 2822 294 264 4933 86 4 93 92 41 531 92 6 594 789 37 96 82 97 3 372 68 85 97 574 52 39 936 639 41 67 4 52 187 623 45 46 4 782 63 3 5677 4575 96 667 81 95 22 66 4 72 823 12 142 84 1 3 9 314 91 16 56 797 8 52 182 35 79 919 766 7 45 729 16 3 532 516 1453 268 2 85 7 2 46 882 2193 29 559 882 26 2848 353 17 649 1 48 6 951 925 73 259 85 177 9 53 5 795 33 4 57 431 5189 8924 17 863 58 6 89 375 38 914 686 63 24 57 765 9333 9391 22 87 286 359 3 781 2 49 91 787 85 587 2 25 14 743 9 82 96 93 93 63 23 13 94 1693 4588 4 25 612 412 9383 68 19 97 24 414 43 7 54 9 15 9519 322 8 77 376 4 29 88 216 1311 7844 924 594 25 586 988 5 845 71 71 44 5979 7 475 12 74 8878 85 49 5 94 585 496 252 322 79 8 343 99 58 45 157 338 4 861 18 1 725 31 95 3384 516 38 73 58 72 9 77 5 4 33 12 691 1757 16 893 956 9 8848 532 914 3427 958 73 99 2 628 24 73 95 87 42 14 177 711 6 64 9383 56 15 79 82 783 96 84 71 972 96 53 1 69 379 18 963 4 832 19 4 99 93 89 123 91 795 92 61 273 22 91 774 16 912 7393 55 1 5 3935 623 52 71 52 52 5 8 19 26 3 6 723 799 213 4 83 941 4248 1 599 44 75 93 36 753 69 15 8 668 433 92 189 188 19 3 34 5 973 279 2754 979 174 9 89 73 5 18 84 94 8222 91 8481 98 4715 8 1 64 63 97 51 76 89 647 44 151 854 747 368 83 443 71 2 14 69 93 18 4 93 96 57 363 266 196 335 367 829 16 38 33 7 27 886 43 67 72 8 2 1383 47 76 5 9742 87 74 9699 494 8372 23 381 3487 4 43 57 877 1 245 24 49 27 6 1 98 85 835 76 728 351 3881 86 71 932 1392 967 2937 143 9 143 87 15 62 22 2 4 44 2949 5 8 2 53 91 49 1 61 398 553 4 834 661 79 93 54 94 9457 1 4353 9997 7 564 31 9 47 4 366 16 49 6 38 49 8 39 39 4887 5 7 134 54 2151 6651 99 991 7 25 51 59 4 94 9 37 45 482 22 8855 49 5 1 4 68 874 7 81 152 87 512 8 897 6 3525 79 9 47 48 73 57 39 73 7 3 5158 16 998 182 665 33 23 5 913 9 46 8 589 67 82 746 121 19 19 6 232 55 2 35 996 32 92 7 7 893 44 98 172 11 264 1 5 735 73 1895 484 368 28 3 614 88 33 17 61 66 86 8295 632 136 21 4 37 664 45 38 74 32 7 979 749 56 628 4 966 67 8 118 1446 612 165 792 5 14 779 475 657 262 591 3 8 4 721 28 714 88 52 39 861 39 2 514 529 187 7574 31 77 8 197 41 5548 67 4 53 8 21 966 6 37 471 464 238 193 4 82 47 3 4 26 441 74 43 184 9 776 42 19 9 9 2932 153 43 84 2669 97 67 715 29 1252 44 68 66 6931 7 2122 29 13 556 37 3 99 31 49 2 1 118 71 283 163 95 14 23 2 5735 83 58 3 9 3 922 73 71 898 8 134 539 13 4335 862 2786 65 19 3 6 2349 55 4533 141 414 63 868 749 82 16 415 324 883 6228 9 215 59 664 4646 22 56 3
+ + * * + + * * * * + + + + + * + * * + * + * * * * + + + * + * + * * + * * * + + * * * * + + + * * * + + + + * + * * + + + * * * + * + + * * * + * + + * * * + * + * + + * + * * + * * + + + + * * * * * * * * * * * * + * + * + + * + + + + + * + * + * * + * + + + * * + * * * + + + + + * + + + * + + + * + + + * * + + + + * * * + + + * + * * + * * * + + * + + + + * + + + + + + * * + + * * * * * + + + + + * * + * + + * + * + + + * + * * * + * * * * + + * * * * * + + + * + * * + * + * + * + + + * * * + + + * * + + + + * * * * * * + * + * * + + * + + * * + + + * * * + + + * + * * * + + * * + + + * + + + * + * + + + + * + * * * + * + + * + + * * + * + + * * + * * * + + + * * * * + * + + * * + + * * * + + * + * + * * * * + + * + + * * * * * * * * * + * + + * + * + + + * + * * + + + + + + * * * + + + + * * + * * + + * * * + + + * * * + + + * * + * + * + * + + + * * * + + * * + * * + + + + + * * * * * * * * * * + * * * * + * + * + + + * * * * * + + + + + + + * * * + + + * * * * + + * + + + * * + + * * + + * * + + + + * + + + * + * * * + * * + + + + * * * + * + * + * + + * + * + * + * + + + + + + + + * + * + + + * + + + * + * + + + + * * + * * * + * * + + + + * + * * + * + * + + + * + * * + * + + + * + + * + + + + + + * + + + * + * + * * * * + + + + + * * * * * + * * + * * + + * + + + * + * * + * + * * + + + * + * * * + * + + * + * * + + * * * + + * * * + * * + * * + + + + + + + * + * * * + * * * * * * + + + * + + * + + * + * + * + + * * + + + + + + * + * * + * + + * + * * * + * * + + + + + + + + * * + * * + * + + + + * * * + * * + + * * * * * + + + + * * * * + * * + * * * * + * * + * * * + + + * + * * + * * + + + + * + + + + * * * * + + * * + + * * + * * * * + * + + * + * * + + * * * + * + + + + * + * * * + * + * + * + * * * * + + + * + + * + * + + * + + + + + + * * * + * + * * * + * * * + + * + * + * + * * * + + + + + + * + + + * * + * + * * + + * + + * + + * + * * * + * + * + + + * * * * * + + + * + + + + + * + * * + + * + * + * * + + + + + * + * * + * * * + * * * * + + * *

140
puzzle/2025/06/prompt.html Normal file
View File

@ -0,0 +1,140 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8"/>
<title>Day 6 - Advent of Code 2025</title>
<link rel="stylesheet" type="text/css" href="/static/style.css?32"/>
<link rel="stylesheet alternate" type="text/css" href="/static/highcontrast.css?2" title="High Contrast"/>
<link rel="shortcut icon" href="/favicon.png"/>
<script>window.addEventListener('click', function(e,s,r){if(e.target.nodeName==='CODE'&&e.detail===3){s=window.getSelection();s.removeAllRanges();r=document.createRange();r.selectNodeContents(e.target);s.addRange(r);}});</script>
</head><!--
Oh, hello! Funny seeing you here.
I appreciate your enthusiasm, but you aren't going to find much down here.
There certainly aren't clues to any of the puzzles. The best surprises don't
even appear in the source until you unlock them for real.
Please be careful with automated requests; I'm not a massive company, and I can
only take so much traffic. Please be considerate so that everyone gets to play.
If you're curious about how Advent of Code works, it's running on some custom
Perl code. Other than a few integrations (auth, analytics, social media), I
built the whole thing myself, including the design, animations, prose, and all
of the puzzles.
The puzzles are most of the work; preparing a new calendar and a new set of
puzzles takes all of my free time for months every year. A lot of effort went
into building this thing - I hope you're enjoying playing it as much as I
enjoyed making it for you!
If you'd like to hang out, I'm @was.tl on Bluesky and @ericwastl@hachyderm.io
on Mastodon.
- Eric Wastl
-->
<body>
<header><div><h1 class="title-global"><a href="/">Advent of Code</a></h1><nav><ul><li><a href="/2025/about">[About]</a></li><li><a href="/2025/events">[Events]</a></li><li><a href="/2025/shop">[Shop]</a></li><li><a href="/2025/settings">[Settings]</a></li><li><a href="/2025/auth/logout">[Log Out]</a></li></ul></nav><div class="user">buhman</div></div><div><h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">0xffff&amp;</span><a href="/2025">2025</a><span class="title-event-wrap"></span></h1><nav><ul><li><a href="/2025">[Calendar]</a></li><li><a href="/2025/support">[AoC++]</a></li><li><a href="/2025/sponsors">[Sponsors]</a></li><li><a href="/2025/leaderboard/private">[Leaderboards]</a></li><li><a href="/2025/stats">[Stats]</a></li></ul></nav></div></header>
<div id="sidebar">
<div id="sponsor"><div class="quiet">Our <a href="/2025/sponsors">sponsors</a> help make Advent of Code possible:</div><div class="sponsor"><a href="/2025/sponsors/redirect?url=https%3A%2F%2Fcareers%2Eformlabs%2Ecom%2F%3Futm%5Fsource%3Dmedia%26utm%5Fmedium%3Dreferral%26utm%5Fcampaign%3Dadvent%2Dof%2Dcode%2D2025%2D12%2D01%2Dglobal" target="_blank" onclick="if(ga)ga('send','event','sponsor','sidebar',this.href);" rel="noopener">Formlabs</a> - CADing a gift, printing it twice, best-in-class printers make parts come out nice! Ditch the elves, build your next project with Formlabs!</div></div>
</div><!--/sidebar-->
<main>
<article class="day-desc"><h2>--- Day 6: Trash Compactor ---</h2><p>After helping the Elves in the kitchen, you were taking a break and helping them re-enact a movie scene when you over-enthusiastically jumped into the garbage chute!</p>
<p>A brief fall later, you find yourself in a <span title="To your surprise, the smell isn't that bad.">garbage smasher</span>. Unfortunately, the door's been magnetically sealed.</p>
<p>As you try to find a way out, you are approached by a family of cephalopods! They're pretty sure they can get the door open, but it will take some time. While you wait, they're curious if you can help the youngest cephalopod with her <a href="/2021/day/18">math homework</a>.</p>
<p>Cephalopod math doesn't look that different from normal math. The math worksheet (your puzzle input) consists of a list of <em>problems</em>; each problem has a group of numbers that need to be either <em>added</em> (<code>+</code>) or <em>multiplied</em> (<code>*</code>) together.</p>
<p>However, the problems are arranged a little strangely; they seem to be presented next to each other in a very long horizontal list. For example:</p>
<pre><code>123 328 51 64
45 64 387 23
6 98 215 314
* + * +
</code></pre>
<p>Each problem's numbers are arranged vertically; at the bottom of the problem is the symbol for the operation that needs to be performed. Problems are separated by a full column of only spaces. The left/right alignment of numbers within each problem can be ignored.</p>
<p>So, this worksheet contains four problems:</p>
<ul>
<li><code>123</code> * <code>45</code> * <code>6</code> = <code><em>33210</em></code></li>
<li><code>328</code> + <code>64</code> + <code>98</code> = <code><em>490</em></code></li>
<li><code>51</code> * <code>387</code> * <code>215</code> = <code><em>4243455</em></code></li>
<li><code>64</code> + <code>23</code> + <code>314</code> = <code><em>401</em></code></li>
</ul>
<p>To check their work, cephalopod students are given the <em>grand total</em> of adding together all of the answers to the individual problems. In this worksheet, the grand total is <code>33210</code> + <code>490</code> + <code>4243455</code> + <code>401</code> = <code><em>4277556</em></code>.</p>
<p>Of course, the actual worksheet is <em>much</em> wider. You'll need to make sure to unroll it completely so that you can read the problems clearly.</p>
<p>Solve the problems on the math worksheet. <em>What is the grand total found by adding together all of the answers to the individual problems?</em></p>
</article>
<p>To begin, <a href="6/input" target="_blank">get your puzzle input</a>.</p>
<form method="post" action="6/answer"><input type="hidden" name="level" value="1"/><p>Answer: <input type="text" name="answer" autocomplete="off"/> <input type="submit" value="[Submit]"/></p></form>
<p>You can also <span class="share">[Share<span class="share-content">on
<a href="https://bsky.app/intent/compose?text=%22Trash+Compactor%22+%2D+Day+6+%2D+Advent+of+Code+2025+%23AdventOfCode+https%3A%2F%2Fadventofcode%2Ecom%2F2025%2Fday%2F6" target="_blank">Bluesky</a>
<a href="https://twitter.com/intent/tweet?text=%22Trash+Compactor%22+%2D+Day+6+%2D+Advent+of+Code+2025&amp;url=https%3A%2F%2Fadventofcode%2Ecom%2F2025%2Fday%2F6&amp;related=ericwastl&amp;hashtags=AdventOfCode" target="_blank">Twitter</a>
<a href="javascript:void(0);" onclick="var ms; try{ms=localStorage.getItem('mastodon.server')}finally{} if(typeof ms!=='string')ms=''; ms=prompt('Mastodon Server?',ms); if(typeof ms==='string' && ms.length){this.href='https://'+ms+'/share?text=%22Trash+Compactor%22+%2D+Day+6+%2D+Advent+of+Code+2025+%23AdventOfCode+https%3A%2F%2Fadventofcode%2Ecom%2F2025%2Fday%2F6';try{localStorage.setItem('mastodon.server',ms);}finally{}}else{return false;}" target="_blank">Mastodon</a
></span>]</span> this puzzle.</p>
</main>
<!-- ga -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-69522494-1', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
</script>
<!-- /ga -->
</body>
</html>

142
puzzle/2025/07/input Normal file
View File

@ -0,0 +1,142 @@
......................................................................S......................................................................
.............................................................................................................................................
......................................................................^......................................................................
.............................................................................................................................................
.....................................................................^.^.....................................................................
.............................................................................................................................................
....................................................................^.^.^....................................................................
.............................................................................................................................................
...................................................................^.^.^.^...................................................................
.............................................................................................................................................
..................................................................^...^...^..................................................................
.............................................................................................................................................
.................................................................^.^...^.^.^.................................................................
.............................................................................................................................................
................................................................^.....^...^.^................................................................
.............................................................................................................................................
...............................................................^.^.^.^...^...^...............................................................
.............................................................................................................................................
..............................................................^.^...^.^...^.^.^..............................................................
.............................................................................................................................................
.............................................................^...^...^.....^...^.............................................................
.............................................................................................................................................
............................................................^.....^.^.^...^.....^............................................................
.............................................................................................................................................
...........................................................^.^...^.^...^...^.....^...........................................................
.............................................................................................................................................
..........................................................^.^.^.^...^.^.^...^.....^..........................................................
.............................................................................................................................................
.........................................................^.^.^...^...^.^.^.^.^.....^.........................................................
.............................................................................................................................................
........................................................^.^...^.^.^.^.....^...^.^.^.^........................................................
.............................................................................................................................................
.......................................................^.^...^.^...^...^.^.^.....^.^.^.......................................................
.............................................................................................................................................
......................................................^...^.^.^.^.^.^.^...^.^.^.^.^.^.^......................................................
.............................................................................................................................................
.....................................................^.......^.........^.^.^.......^...^.....................................................
.............................................................................................................................................
....................................................^.^.^.....^.^...^.^.^...^.^.^.^.^.^.^....................................................
.............................................................................................................................................
...................................................^...^.^.^.....^.^...........^.......^.^...................................................
.............................................................................................................................................
..................................................^...^.^...^.^.^...^.^.^.^.^...^.^.......^..................................................
.............................................................................................................................................
.................................................^...^.....^.^.^.^.^...^...^...^.^.^.^.....^.................................................
.............................................................................................................................................
................................................^.^.^.^.^...^.^.^.^.^.^.^...^.....^...^.^.^.^................................................
.............................................................................................................................................
...............................................^.^.^.^.....^.^.^.........^.^.^.^.^...^.^.....^...............................................
.............................................................................................................................................
..............................................^...^.^.^.^...^...........^.^.^.^...^...^.^.^...^..............................................
.............................................................................................................................................
.............................................^.^...^.^.^.^.^.....^.^.^.....^.......^.^.^.^...^.^.............................................
.............................................................................................................................................
............................................^.....^...^.....^.^.^...^...^.^.......^.^.....^.^.^.^............................................
.............................................................................................................................................
...........................................^.^.....^.....^.^.^.^.^.^.^.^.^.^.^.....^.^.^.^.^...^.^...........................................
.............................................................................................................................................
..........................................^.^...^.^.^.....^.^.^.......^...^.^.....^.^.^...^.^.^...^..........................................
.............................................................................................................................................
.........................................^.^.^.^.^...^.^.^.^.^.^...^...^.^.^...^.^.^.^.......^.^.^.^.........................................
.............................................................................................................................................
........................................^.^.....^.^.^.^.....^.^.^.^...^.^.^.^.......^.....^.^.^.^.^.^........................................
.............................................................................................................................................
.......................................^.^.^.^...^...^...^.^.^.^.^.........^.^.^.^.^...^.^.^.^...^.^.^.......................................
.............................................................................................................................................
......................................^.^.^.^.^.^.^.^.^...^...^.^.^.^.^...^.^.^...^...^.^.........^.^.^......................................
.............................................................................................................................................
.....................................^.^.^.^.......^...^.^...^.^.^.......^.....^.^.^.^...^.^.^.^...^...^.....................................
.............................................................................................................................................
....................................^.^.^.^.^.^.^...^...^.........^.^...^.^.^...^.^.^...^.....^.^.^.^...^....................................
.............................................................................................................................................
...................................^.^...^...^...^.^.^.......^.^.^...^.^.^.^.....^.^.^.^.^.^.^.^.^.^.^.^.^...................................
.............................................................................................................................................
..................................^...^.^.^.^.....^.^...^.......^.^.^...^.^.^.^.^.^.^...^.^.^...^...^.^.^.^..................................
.............................................................................................................................................
.................................^.^.^...^.^.^...^.^.^.^.^.^...^.^.^.^.^...^...^...^.^...^.^.^.^.^.^.^.^...^.................................
.............................................................................................................................................
................................^.^...^...^.^.^.^.^.......^.^...^...^...^...^.....^.^.^.^.^.^...^.^.^.....^.^................................
.............................................................................................................................................
...............................^.^.^.^.^.^.^.^.^.^.^.^.^.^...^.^.^...^...^...^.^.^.^.^.^...^.^.^.^...^.^...^.^...............................
.............................................................................................................................................
..............................^.^.....^.^.......^.^.^...^.^.^.^.^.^.^.^.........^.^.^.^.^.^.^.......^...^.^.^.^..............................
.............................................................................................................................................
.............................^.^.............^.^.^.^.^...^...^.....^.^.^.^...^.^.^.^.....^.^.^.^.^...^.^.^.....^.............................
.............................................................................................................................................
............................^.^.^...^.^.^...^.^.^.^.^.^.^.^.^.^...^...^.....^...^.^...^...^.^...^.^.^.^.^...^...^............................
.............................................................................................................................................
...........................^.....^.^...^.^.^.^.^.^...^...^.^.^...^...........^...^.^.^...^.^...^.^.^.^.^.^.^.^.^.^...........................
.............................................................................................................................................
..........................^...^...^...^.^...^.^.^.....^.....^...^.^.^.....^.^...^...^.^.^.^.^.^.^...^.^.^...^.^.^.^..........................
.............................................................................................................................................
.........................^.^...^.^.....^...^.^.^.^.....^.^.^.....^.^.^.^.^.^.....^.^.^...^.^.....^.^.^.^.^...^.....^.........................
.............................................................................................................................................
........................^.^...^.^.^...^...^.^.....^...^.^...^.^.....^.^...^.^.^.^.^...^...^.^.^...^...^.^...^.^.^.^.^........................
.............................................................................................................................................
.......................^.^.^.^.^...^.^.^.^.^.^.^.^.^.^...^.^.^...^...^.....^...^.^.^.^.^.....^.^.^.^.^.^.^.^.....^.^.^.......................
.............................................................................................................................................
......................^.^...^.^.^.^...^.^.^.^.^.^...^.^.^.....^.^.^.^...^.^...^.^.^.........^.^.....^.^.^.^.^.^.....^.^......................
.............................................................................................................................................
.....................^...^...^...^.^.^...^.^.^.^.^.^.^...^.^.^.^.^.^.^.^.^.^.^...^.^.....^.^.^.^...^.....^.^.....^...^.^.....................
.............................................................................................................................................
....................^.^.^.^.^.^...^.^.^.^.^...^.^...^.^.^.....^...^.^.^...^.^.^.^...^.^.^.^.^.^.^...^...^.....^.^...^.^.^....................
.............................................................................................................................................
...................^.^...^...^...^.^.^...^...^.........^.....^.^.....^...^.^.^.^.^.^.^.^.^.^.........^.^.^.^...^.^.^...^.^...................
.............................................................................................................................................
..................^.^.....^.......^...^.^.^...^...^.^...^.^.^.^.........^.^.......^.^.^.^.^.^...^.^.....^.^...^.^...^...^.^..................
.............................................................................................................................................
.................^.^...^.^.^.^...^.^.^.....^...^.^.^.^.^.......^...^...^.^.....^.^.^.^.^.^...^.^.....^.....^.^.^.......^.^.^.................
.............................................................................................................................................
................^.^.^.......^.^.^.^.^.^.^.^.^.^.^.....^.^.....^...^.^.^.^.^.^.^.^.^.^...^.....^.^.....^.^.^.......^...^.^.^.^................
.............................................................................................................................................
...............^.....^.^.^.^.^.........^.^...^.^.^.....^.^...^.^.^...^.^.....^.^.^.^.^.^.....^...^.^...^.^...^.^.^...^.^.^...^...............
.............................................................................................................................................
..............^.^.^.^.^.....^.....^.^.^.^.^.^...^.^.^.^...^.^.^.^.^...^.^.^.^.^.^.....^...^.^.^.............^.^...^.^.^.^...^.^..............
.............................................................................................................................................
.............^...^...^.^.^.^.^.^...^.^.^...^.^.^...^...^.^.....^...^.^.^.^...^...^.^.^.^.^.^.^...^.^...^.^...^.^.^.^...^.....^.^.............
.............................................................................................................................................
............^.^.......^.^...........^.^.^.^.^...^.....^.^.^.^.^.^...^.^...^.^.^.^.^...^.^.^.^.^.....^.^.^.^...^.^.^.^.^.^...^.^.^............
.............................................................................................................................................
...........^.^...^.^...^.^.....^.^.^.^.^.^.^.....^.^.^.^.^.^.^...^...^...^.^.^.^.^.^.^.^.^...^.^...^...^.....^.^.^.^.^...^.^.^.^.^...........
.............................................................................................................................................
..........^.^.^.^.^.....^.^.^...^...^.^.........^.^.^.^.^.^...^.^.^.^.......^...^...^.^.^.^...^...^.^.^.^.^.^.^.^...^...^.^...^...^..........
.............................................................................................................................................
.........^.^.^.^.^...^...^.^.^.^.^.^.^.^.^.^.^.^.^...^.^...^.^.^.^.^.^...^.^.^.....^.^...^...^.^.^.^.^.^...^.^.^.^.^.^...^.^...^.^.^.........
.............................................................................................................................................
........^.^.....^.^.......^.^.^.^.^...^.^.^.^...^...^...^.^.......^.^.^.....^...^.^.......^.^.^...^...^.^.^.^.....^.^.....^.^.^.^...^........
.............................................................................................................................................
.......^.^...^.^.^.......^.^.^.^...^...^.....^.^.....^...^...^.^...^.^.^.^.^...^.^...^.^.^.......^...^.^.^.^.^.^.^...........^.^.^.^.^.......
.............................................................................................................................................
......^.^.^.^.^.^.^.^.^.^.^.^.^.^.^...^.^.^.^.^.^...^.^.^.^...^.^...^.^.^.^.^.^.^.^.....^...^.^.^.^.....^.....^.....^...^.^.....^.^.^.^......
.............................................................................................................................................
.....^...^.^.^...^...^.^...^.....^.^...^.^.....^.^.^.^.^.^...^...^...^...^.^.^.^...^.^.^.^.^.^.^.^...^...^.^.....^.^.......^.^.^...^...^.....
.............................................................................................................................................
....^.....^.^.^.........^.^...^...........^.^.^.^.^.^.^.^...^.^.^.^...^.......^.....^.^...^.^.....^.^...^.^.......^.^.^.^.....^.^.^.^.^.^....
.............................................................................................................................................
...^.^.^...^.^...^.^.^.....^.^...^.^.^.....^...^...^.....^.....^.^...^.^.....^...^.^.^.^...^.^.^.....^.....^.^.^.^.^.^...^.^.^.^.^...^.^.^...
.............................................................................................................................................
..^...^.^.....^.^.^.^.^.^.^.^...^...^.^.^.^.^.^.^.^.^.^.^...^.......^.^.^.^...^.......^.^.^.^.^.^.^...^.^.^.^.^.^.^.......^...^...^...^...^..
.............................................................................................................................................
.^.^.^.^.^...^.^.......^.^.^.^.^.^...^...^...^.^.^.......^.^.........^.^.^.^.^.....^.......^.^.^.^...^.^.^...^.^.^.....^...^.^.^...^.^...^.^.
.............................................................................................................................................

234
puzzle/2025/07/prompt.html Normal file
View File

@ -0,0 +1,234 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8"/>
<title>Day 7 - Advent of Code 2025</title>
<link rel="stylesheet" type="text/css" href="/static/style.css?32"/>
<link rel="stylesheet alternate" type="text/css" href="/static/highcontrast.css?2" title="High Contrast"/>
<link rel="shortcut icon" href="/favicon.png"/>
<script>window.addEventListener('click', function(e,s,r){if(e.target.nodeName==='CODE'&&e.detail===3){s=window.getSelection();s.removeAllRanges();r=document.createRange();r.selectNodeContents(e.target);s.addRange(r);}});</script>
</head><!--
Oh, hello! Funny seeing you here.
I appreciate your enthusiasm, but you aren't going to find much down here.
There certainly aren't clues to any of the puzzles. The best surprises don't
even appear in the source until you unlock them for real.
Please be careful with automated requests; I'm not a massive company, and I can
only take so much traffic. Please be considerate so that everyone gets to play.
If you're curious about how Advent of Code works, it's running on some custom
Perl code. Other than a few integrations (auth, analytics, social media), I
built the whole thing myself, including the design, animations, prose, and all
of the puzzles.
The puzzles are most of the work; preparing a new calendar and a new set of
puzzles takes all of my free time for months every year. A lot of effort went
into building this thing - I hope you're enjoying playing it as much as I
enjoyed making it for you!
If you'd like to hang out, I'm @was.tl on Bluesky and @ericwastl@hachyderm.io
on Mastodon.
- Eric Wastl
-->
<body>
<header><div><h1 class="title-global"><a href="/">Advent of Code</a></h1><nav><ul><li><a href="/2025/about">[About]</a></li><li><a href="/2025/events">[Events]</a></li><li><a href="/2025/shop">[Shop]</a></li><li><a href="/2025/settings">[Settings]</a></li><li><a href="/2025/auth/logout">[Log Out]</a></li></ul></nav><div class="user">buhman</div></div><div><h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">&lt;y&gt;</span><a href="/2025">2025</a><span class="title-event-wrap">&lt;/y&gt;</span></h1><nav><ul><li><a href="/2025">[Calendar]</a></li><li><a href="/2025/support">[AoC++]</a></li><li><a href="/2025/sponsors">[Sponsors]</a></li><li><a href="/2025/leaderboard/private">[Leaderboards]</a></li><li><a href="/2025/stats">[Stats]</a></li></ul></nav></div></header>
<div id="sidebar">
<div id="sponsor"><div class="quiet">Our <a href="/2025/sponsors">sponsors</a> help make Advent of Code possible:</div><div class="sponsor"><a href="/2025/sponsors/redirect?url=https%3A%2F%2Fwww%2Eboot%2Edev%3Fpromo%3DADVENTOFCODE" target="_blank" onclick="if(ga)ga('send','event','sponsor','sidebar',this.href);" rel="noopener">Boot.dev</a> - Become more than a vibe-coder! Master backend development from start to finish on Boot.dev: the most addicting way to learn to code.</div></div>
</div><!--/sidebar-->
<main>
<article class="day-desc"><h2>--- Day 7: Laboratories ---</h2><p>You thank the cephalopods for the help and exit the trash compactor, finding yourself in the <a href="/2024/day/6">familiar</a> <a href="/2018/day/4">halls</a> of a North Pole research wing.</p>
<p>Based on the large sign that says "teleporter hub", they seem to be researching <em>teleportation</em>; you can't help but try it for yourself and step onto the large yellow teleporter pad.</p>
<p>Suddenly, you find yourself in an unfamiliar room! The room has no doors; the only way out is the teleporter. Unfortunately, the teleporter seems to be leaking <a href="https://en.wikipedia.org/wiki/Magic_smoke" target="_blank">magic smoke</a>.</p>
<p>Since this is a teleporter lab, there are lots of spare parts, manuals, and diagnostic equipment lying around. After connecting one of the diagnostic tools, it helpfully displays error code <code>0H-N0</code>, which apparently means that there's an issue with one of the <em>tachyon manifolds</em>.</p>
<p>You quickly locate a diagram of the tachyon manifold (your puzzle input). A tachyon beam enters the manifold at the location marked <code>S</code>; tachyon beams always move <em>downward</em>. Tachyon beams pass freely through empty space (<code>.</code>). However, if a tachyon beam encounters a splitter (<code>^</code>), the beam is stopped; instead, a new tachyon beam continues from the immediate left and from the immediate right of the splitter.</p>
<p>For example:</p>
<pre><code>.......S.......
...............
.......^.......
...............
......^.^......
...............
.....^.^.^.....
...............
....^.^...^....
...............
...^.^...^.^...
...............
..^...^.....^..
...............
.^.^.^.^.^...^.
...............
</code></pre>
<p>In this example, the incoming tachyon beam (<code>|</code>) extends downward from <code>S</code> until it reaches the first splitter:</p>
<pre><code>.......S.......
.......|.......
.......^.......
...............
......^.^......
...............
.....^.^.^.....
...............
....^.^...^....
...............
...^.^...^.^...
...............
..^...^.....^..
...............
.^.^.^.^.^...^.
...............
</code></pre>
<p>At that point, the original beam stops, and two new beams are emitted from the splitter:</p>
<pre><code>.......S.......
.......|.......
......|^|......
...............
......^.^......
...............
.....^.^.^.....
...............
....^.^...^....
...............
...^.^...^.^...
...............
..^...^.....^..
...............
.^.^.^.^.^...^.
...............
</code></pre>
<p>Those beams continue downward until they reach more splitters:</p>
<pre><code>.......S.......
.......|.......
......|^|......
......|.|......
......^.^......
...............
.....^.^.^.....
...............
....^.^...^....
...............
...^.^...^.^...
...............
..^...^.....^..
...............
.^.^.^.^.^...^.
...............
</code></pre>
<p>At this point, the two splitters create a total of only <em>three</em> tachyon beams, since they are both dumping tachyons into the same place between them:</p>
<pre><code>.......S.......
.......|.......
......|^|......
......|.|......
.....|^|^|.....
...............
.....^.^.^.....
...............
....^.^...^....
...............
...^.^...^.^...
...............
..^...^.....^..
...............
.^.^.^.^.^...^.
...............
</code></pre>
<p>This process continues until all of the tachyon beams reach a splitter or exit the manifold:</p>
<pre><code>.......S.......
.......|.......
......|^|......
......|.|......
.....|^|^|.....
.....|.|.|.....
....|^|^|^|....
....|.|.|.|....
...|^|^|||^|...
...|.|.|||.|...
..|^|^|||^|^|..
..|.|.|||.|.|..
.|^|||^||.||^|.
.|.|||.||.||.|.
|^|^|^|^|^|||^|
|.|.|.|.|.|||.|
</code></pre>
<p>To repair the teleporter, you first need to understand the beam-splitting properties of the tachyon manifold. In this example, a tachyon beam is split a total of <em><code>21</code></em> times.</p>
<p>Analyze your manifold diagram. <em>How many times will the beam be split?</em></p>
</article>
<p>To begin, <a href="7/input" target="_blank">get your puzzle input</a>.</p>
<form method="post" action="7/answer"><input type="hidden" name="level" value="1"/><p>Answer: <input type="text" name="answer" autocomplete="off"/> <input type="submit" value="[Submit]"/></p></form>
<p>You can also <span class="share">[Share<span class="share-content">on
<a href="https://bsky.app/intent/compose?text=%22Laboratories%22+%2D+Day+7+%2D+Advent+of+Code+2025+%23AdventOfCode+https%3A%2F%2Fadventofcode%2Ecom%2F2025%2Fday%2F7" target="_blank">Bluesky</a>
<a href="https://twitter.com/intent/tweet?text=%22Laboratories%22+%2D+Day+7+%2D+Advent+of+Code+2025&amp;url=https%3A%2F%2Fadventofcode%2Ecom%2F2025%2Fday%2F7&amp;related=ericwastl&amp;hashtags=AdventOfCode" target="_blank">Twitter</a>
<a href="javascript:void(0);" onclick="var ms; try{ms=localStorage.getItem('mastodon.server')}finally{} if(typeof ms!=='string')ms=''; ms=prompt('Mastodon Server?',ms); if(typeof ms==='string' && ms.length){this.href='https://'+ms+'/share?text=%22Laboratories%22+%2D+Day+7+%2D+Advent+of+Code+2025+%23AdventOfCode+https%3A%2F%2Fadventofcode%2Ecom%2F2025%2Fday%2F7';try{localStorage.setItem('mastodon.server',ms);}finally{}}else{return false;}" target="_blank">Mastodon</a
></span>]</span> this puzzle.</p>
</main>
<!-- ga -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-69522494-1', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
</script>
<!-- /ga -->
</body>
</html>

497
puzzle/static/style.css Normal file
View File

@ -0,0 +1,497 @@
@font-face {
font-family: 'Source Code Pro';
font-style: normal;
font-weight: 300;
src: url(SourceCodePro-300.woff) format('woff');
}
body {
background: #0f0f23; /*337 x 5*/
color: #cccccc;
font-family: "Source Code Pro", monospace;
font-weight: 300;
font-size: 14pt;
min-width: 60em;
}
img { border:0; }
a { outline:0; }
main, figure, figcaption { display:block; }
pre, code { font-family: "Source Code Pro", monospace; }
header, main {
-webkit-text-size-adjust: none;
}
a {
text-decoration: none;
color: #009900;
}
a:hover, a:focus {
color: #99ff99;
}
h1, h2 {
font-size: 1em;
font-weight: normal;
}
code {
position: relative;
display: inline-block;
margin: 0;
padding: 0;
}
code:before {
z-index: -1;
content: "";
position: absolute;
display: block;
left: -2px;
right: -2px;
top: 3px;
bottom: 0px;
border: 1px solid #333340;
background: #10101a;
}
pre.wrap {
max-width: 100%;
white-space: pre-wrap;
}
.quiet {
opacity: .5;
}
p.wrap {
width: 45em;
}
.hidden-until-hover {
border: 1px dotted gray;
overflow: hidden;
position: relative;
padding: 0 .5em;
transition: border-color 0s linear 5s;
}
.hidden-until-hover:before {
content: "(hover to reveal)";
position: absolute;
opacity: .5;
text-align: center;
left: 0;
top: 0;
width: 100%;
overflow: hidden;
transition: width 0s linear 5s;
}
.hidden-until-hover > * {
visibility: hidden;
transition: visibility 0s linear 5s;
}
.hidden-until-hover:hover {
transition: border-color 0s linear 1s;
border-color: transparent;
}
.hidden-until-hover:hover:before {
content: "( keep hovering )";
transition: width 0s linear 1s;
width: 0;
}
.hidden-until-hover:hover > * {
transition: visibility 0s linear 1s;
visibility: visible;
}
.warning:not(.warning-active) {
transition: color 1s, opacity 1s;
}
.warning-active {
color: #ff0000;
opacity: 1;
}
.star-count {
color: #ffff66;
}
.supporter-badge {
color: #ffff66;
}
a.supporter-badge:hover, a.supporter-badge:focus {
text-decoration: none;
color: #ffffcc;
text-shadow: 0 0 5px #ffff66;
}
.sponsor-badge {
color: #79a2d8;
}
a.sponsor-badge:hover, a.sponsor-badge:focus {
text-decoration: none;
color: #ccdbed;
text-shadow: 0 0 5px #79a2d8;
}
#sidebar {
width: 200px;
float: right;
margin: 0 15px 2em 2em;
position: relative;
z-index: 10;
}
#sponsor {
margin-bottom: 2.5em;
}
header {
white-space: nowrap;
cursor: default;
z-index: 100;
margin-bottom: 2em;
}
header h1 {
display: inline-block;
margin: 0;
padding-right: 1em;
}
header h1 a, header h1 span {
display: inline-block;
text-decoration: none;
color: #00cc00;
text-shadow: 0 0 2px #00cc00, 0 0 5px #00cc00;
}
header h1 a:hover, header h1 a:focus {
color: #99ff99;
text-shadow: 0 0 2px #99ff99, 0 0 5px #99ff99;
}
header h1.title-event .title-event-wrap {
opacity: .33;
white-space: pre;
}
header .user {
display: inline-block;
padding-left: 1em;
}
header nav {
display: inline-block;
}
header nav ul {
list-style-type: none;
padding: 0;
margin: 0;
display: inline-block;
}
header nav li {
display: inline-block;
padding: 0 .6em;
}
header nav a {
display: inline-block;
text-decoration: none;
outline: none;
}
input[type="text"], textarea {
background: transparent;
color: inherit;
border: 1px solid #666666;
background: #10101a;
padding: 0 2px;
font-family: inherit;
font-size: inherit;
margin: 0;
}
textarea {
vertical-align: top;
}
label img {
vertical-align: bottom;
position: relative;
top: -3px;
margin-right: .3em;
}
input[type="radio"] { display: none; }
input[type="radio"] ~ span {
cursor: pointer;
display: inline-block;
}
input[type="radio"] ~ span:before {
content: "( ) ";
}
input[type="radio"] ~ span:hover, input[type="radio"] ~ span:focus {
background-color: #19193b;
}
input[type="radio"]:checked ~ span {
color: #ffffff;
}
input[type="radio"]:checked ~ span:before {
content: "(O) ";
}
input[type="checkbox"] { display: none; }
input[type="checkbox"] ~ span {
cursor: pointer;
display: inline-block;
}
input[type="checkbox"] ~ span:before {
content: "[ ] ";
}
input[type="checkbox"] ~ span:hover, input[type="checkbox"] ~ span:focus {
background-color: #19193b;
}
input[type="checkbox"]:checked ~ span {
color: #ffffff;
}
input[type="checkbox"]:checked ~ span:before {
content: "[X] ";
}
input[type="checkbox"]:disabled ~ span {
opacity: .3;
cursor: default;
}
input[type="checkbox"]:disabled ~ span:before {
content: "[-] ";
}
input[type="checkbox"]:disabled ~ span:hover {
background-color: transparent;
}
input[type="submit"] {
background: transparent;
border: 0;
font-family: inherit;
font-size: inherit;
margin: 0;
padding: 0;
color: #009900;
cursor: pointer;
}
input[type="submit"]:hover, input[type="submit"]:focus {
color: #99ff99;
}
*::-moz-focus-inner {
padding: 0;
border: 0
}
article {
width: 45em;
margin-bottom: 2em;
margin-top: 2em;
}
article:first-of-type {
margin-top: 0;
}
article h2 {
color: #ffffff;
margin-top: 1em;
margin-bottom: 1em;
white-space: nowrap;
}
article h2 + * {
margin-top: 0;
}
article em {
color: #ffffff;
font-style: normal;
text-shadow: 0 0 5px #ffffff;
}
article em.star {
color: #ffff66;
font-style: normal;
text-shadow: 0 0 5px #ffff66;
}
article a {
white-space: nowrap;
}
article .aside {
opacity: .6;
}
article ul {
list-style-type: none;
padding: 0;
}
article li {
padding-left: 2.5em;
position: relative;
}
article li:before {
content: "\00a0\00a0-\00a0";
position: absolute;
left: 0;
top: 0;
}
.day-success {
color: #ffff66;
text-shadow: 0 0 5px #ffff66;
}
form#settings input[type="radio"] ~ span {
min-width: 30em;
}
form#settings input[type="checkbox"] ~ span {
min-width: 30em;
}
.share {
color: #009900;
cursor: default;
transition: color .2s 1s;
/*position: relative;*/
}
.share:hover, .share:focus-within {
color: #aaffaa;
transition: color .2s 0s;
}
.share .share-content {
/*position: absolute; background: #0f0f23;*/
display: inline-block;
vertical-align: text-bottom;
white-space: nowrap;
overflow: hidden;
max-width: 0;
transition: max-width .2s 1s;
}
.share .share-content:before {
content: "\00a0";
}
.share .share-content:after {
/*content: "]";*/
}
.share:hover .share-content, .share:focus-within .share-content {
max-width: 45em;
transition: max-width .2s 0s;
}
.puzzle-input {
border: 1px solid #999999;
background: #333333;
color: #ffffff;
text-shadow: 0 0 5px #ffffff;
}
.calendar {
cursor: default;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: -moz-none;
-o-user-select: none;
user-select: none;
}
.calendar > span {
color: #333333;
}
.calendar > a {
text-decoration: none;
color: #666666;
outline: none;
cursor: default;
}
.calendar a:hover, .calendar a:focus {
background-color: #1e1e46;
background-color: rgba(119,119,165,.2);
cursor: pointer;
}
#calendar-countdown {
padding-left: .5em;
color: #cccccc;
}
.calendar .calendar-day { color: #666666; }
.calendar a .calendar-day { color: #cccccc; }
.calendar a .calendar-mark-complete,
.calendar a .calendar-mark-verycomplete { visibility: hidden; }
.calendar a.calendar-complete .calendar-mark-complete,
.calendar a.calendar-verycomplete .calendar-mark-complete { visibility: visible; color: #ffff66; }
.calendar a.calendar-verycomplete .calendar-mark-verycomplete { visibility: visible; color: #ffff66; }
.calendar .calendar-day-new { animation: anim-day-new 5s; }
.calendar .calendar-day-new .calendar-day { animation: anim-day-new-day 5s; }
@keyframes anim-day-new {
0% { color: #333333; text-shadow: 0 0 5px transparent; }
25% { color: #ffffff; text-shadow: 0 0 5px #ffffff; }
100% { color: #666666; text-shadow: 0 0 5px transparent; }
}
@keyframes anim-day-new-day {
0% { color: #666666; text-shadow: 0 0 5px transparent; }
25% { color: #ffffff; text-shadow: 0 0 5px #ffffff; }
100% { color: #cccccc; text-shadow: 0 0 5px transparent; }
}
.eventlist-event {
white-space: pre;
}
.stats > span, .stats > span .stats-firstonly, .stats > span .stats-both {
color: #666666;
}
.stats > a {
color: #cccccc;
min-width: 35em;
display: inline-block;
}
.stats > a:hover, .stats > a:focus {
background-color: #1e1e46;
}
.stats-firstonly {
color: #9999cc;
}
.stats-both {
color: #ffff66;
}
.leaderboard-daylinks {
cursor: default;
}
.leaderboard-daylinks-selected {
color: #ffffff;
text-shadow: 0 0 5px #ffffff;
}
.leaderboard-daydesc-first {
color: #9999cc;
}
.leaderboard-daydesc-both {
color: #ffff66;
}
.leaderboard-entry {
white-space: pre;
}
.leaderboard-entry .leaderboard-totalscore {
color: #ffffff;
}
.leaderboard-anon {
opacity: .6;
}
.leaderboard-userphoto {
display: inline-block;
height: 20px;
width: 20px;
margin: 0 .5em;
text-align: center;
}
.leaderboard-userphoto img {
height: 20px;
max-width: 20px;
vertical-align: middle;
position: relative;
top: -2px;
}
.leaderboard-time {
opacity: .5;
}
.privboard-row {
white-space: pre;
}
.privboard-name {
vertical-align: text-bottom;
}
.privboard-days > span { display: inline-block; color: #333333; }
.privboard-days > a { display: inline-block; }
.privboard-star-locked { visibility: hidden; }
.privboard-star-unlocked { color: #333333; }
.privboard-star-firstonly { color: #9999cc; }
.privboard-star-both { color: #ffff66; }
.privboard-delbtn { opacity:.33; }
.privboard-row:hover .privboard-delbtn { opacity:1; }
.sponsors {
width: 46em; /*76 characters*/
}
.sponsor {
margin: 1em 0;
}

1839
src/glad.c Normal file

File diff suppressed because it is too large Load Diff

110
src/main.c Normal file
View File

@ -0,0 +1,110 @@
#include <stdio.h>
#include <unistd.h>
#include <math.h>
#include <assert.h>
#include "glad.h"
#include <GLFW/glfw3.h>
#include "opengl.h"
typedef unsigned int uint;
int vp_width = 800;
int vp_height = 600;
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
{
vp_width = width;
vp_height = height;
}
int main()
{
glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_X11);
glfwInit();
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
GLFWwindow* window = glfwCreateWindow(vp_width, vp_height, "advent-of-pixel-shaders", NULL, NULL);
if (window == NULL) {
const char* description;
glfwGetError(&description);
fprintf(stderr, "Failed to create GLFW window: %s\n", description);
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);
if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) {
fprintf(stderr, "gladLoadGLLoader error\n");
return -1;
}
glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
//////////////////////////////////////////////////////////////////////
// textures
//////////////////////////////////////////////////////////////////////
const char * data = "arst";
make_texture(data,
GL_R8, // internalformat
2, // width
2, // height
GL_RED,
GL_UNSIGNED_BYTE);
uint texture_framebuffer = make_texture(NULL,
GL_RGBA32F,
2,
2,
GL_RGBA,
GL_UNSIGNED_BYTE);
uint fp_framebuffer;
glGenFramebuffers(1, &fp_framebuffer);
glBindFramebuffer(GL_FRAMEBUFFER, fp_framebuffer);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture_framebuffer, 0);
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
assert(status == GL_FRAMEBUFFER_COMPLETE);
uint draw_buffers[1] = {GL_COLOR_ATTACHMENT0};
glDrawBuffers(1, draw_buffers);
while(!glfwWindowShouldClose(window)) {
if(glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
glfwSetWindowShouldClose(window, true);
glBindFramebuffer(GL_FRAMEBUFFER, fp_framebuffer);
glViewport(0, 0, 2, 2);
glClearColor(0.1, 0.2, 0.3, 0.4);
glClear(GL_COLOR_BUFFER_BIT);
//glFlush();
//glFinish();
float out[4 * 2 * 2] = {0};
glReadPixels(0, 0,
2, 2,
GL_RGBA,
GL_FLOAT,
out);
for (int i = 0; i < 4 * 2 * 2; i++) {
printf("%f\n", out[i]);
}
break;
glfwPollEvents();
}
glfwTerminate();
return 0;
}

92
src/opengl.c Normal file
View File

@ -0,0 +1,92 @@
#include <stddef.h>
#include <stdio.h>
#include "glad.h"
unsigned int compile_shader(const void * vp,
const int vp_length,
const void * fp,
const int fp_length)
{
unsigned int vertex_shader;
vertex_shader = glCreateShader(GL_VERTEX_SHADER);
glShaderSource(vertex_shader, 1, (const char **)&vp, &vp_length);
glCompileShader(vertex_shader);
{
int success;
char info_log[512];
glGetShaderiv(vertex_shader, GL_COMPILE_STATUS, &success);
if(!success) {
glGetShaderInfoLog(vertex_shader, 512, NULL, info_log);
fprintf(stderr, "vertex shader compile failed:\n%s\n", info_log);
}
}
unsigned int fragment_shader;
fragment_shader = glCreateShader(GL_FRAGMENT_SHADER);
glShaderSource(fragment_shader, 1, (const char **)&fp, &fp_length);
glCompileShader(fragment_shader);
{
int success;
char info_log[512];
glGetShaderiv(fragment_shader, GL_COMPILE_STATUS, &success);
if(!success) {
glGetShaderInfoLog(fragment_shader, 512, NULL, info_log);
fprintf(stderr, "fragment shader compile failed:\n%s\n", info_log);
}
}
unsigned int shader_program;
shader_program = glCreateProgram();
glAttachShader(shader_program, vertex_shader);
glAttachShader(shader_program, fragment_shader);
glLinkProgram(shader_program);
{
int success;
char info_log[512];
glGetProgramiv(shader_program, GL_LINK_STATUS, &success);
if(!success) {
glGetProgramInfoLog(shader_program, 512, NULL, info_log);
fprintf(stderr, "program link failed:\n%s\n", info_log);
}
}
glDeleteShader(vertex_shader);
glDeleteShader(fragment_shader);
return shader_program;
}
int make_buffer(unsigned int target,
const void * data,
size_t size)
{
unsigned int buffer;
glGenBuffers(1, &buffer);
glBindBuffer(target, buffer);
glBufferData(target, size, data, GL_STATIC_DRAW);
return buffer;
}
int make_texture(const void * data,
int internalformat,
int width,
int height,
int format,
int type)
{
unsigned int texture;
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, internalformat, width, height, 0, format, type, data);
return texture;
}