4 <meta charset=
"utf-8"/>
5 <title>Day
10 - Advent of Code
2016</title>
6 <!--[if lt IE 9]><script src="/static/html5.js"></script><![endif]-->
7 <link href='//fonts.googleapis.com/css?family=Source+Code+Pro:
300&subset=latin,latin-ext' rel='stylesheet' type='text/css'
>
8 <link rel=
"stylesheet" type=
"text/css" href=
"/static/style.css?9"/>
9 <link rel=
"shortcut icon" href=
"/favicon.ico?2"/>
15 Oh, hello! Funny seeing you here.
17 I appreciate your enthusiasm, but you aren't going to find much down here.
18 There certainly aren't clues to any of the puzzles. The best surprises don't
19 even appear in the source until you unlock them for real.
21 Please be careful with automated requests; I'm not Google, and I can only take
22 so much traffic. Please be considerate so that everyone gets to play.
24 If you're curious about how Advent of Code works, it's running on some custom
25 Perl code. Other than a few integrations (auth, analytics, ads, social media),
26 I built the whole thing myself, including the design, animations, prose, and
29 The puzzles probably took the longest; the easiest ones were around 45 minutes
30 each, but the harder ones took 2-3 hours, and a few even longer than that. A
31 lot of effort went into building this thing - I hope you're enjoying playing it
32 as much as I enjoyed making it for you!
34 If you'd like to hang out, I'm @ericwastl on Twitter.
89 <header><div><h1 class=
"title-global"><a href=
"/">Advent of Code
</a></h1><nav><ul><li><a href=
"/2016/about">[About]
</a></li><li><a href=
"/2016/support">[AoC++]
</a></li><li><a href=
"/2016/events">[Events]
</a></li><li><a href=
"/2016/settings">[Settings]
</a></li><li><a href=
"/2016/auth/logout">[Log Out]
</a></li></ul></nav><div class=
"user">Neil Smith
<span class=
"supporter">(AoC++)
</span> <span class=
"star-count">20*
</span></div></div><div><h1 class=
"title-event"> <span class=
"title-event-wrap">//
</span><a href=
"/2016">2016</a><span class=
"title-event-wrap"></span></h1><nav><ul><li><a href=
"/2016">[Calendar]
</a></li><li><a href=
"/2016/leaderboard">[Leaderboard]
</a></li><li><a href=
"/2016/stats">[Stats]
</a></li><li><a href=
"/2016/sponsors">[Sponsors]
</a></li></ul></nav></div></header>
92 <div id=
"sponsor"><div class=
"quiet">Our
<a href=
"/2016/sponsors">sponsors
</a> help make AoC possible:
</div><p><a href=
"http://www.aandkrentals.net/" target=
"_blank" onclick=
"if(ga)ga('send','event','sponsor','click',this.href);">A
&K Rentals
</a> - Affordable, high-quality homes just north of Kansas City.
</p></div>
94 <script async
src=
"//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
95 <!-- Advent of Code Wide Skyscraper -->
96 <ins class=
"adsbygoogle"
97 style=
"display:inline-block;width:160px;height:600px"
98 data-ad-client=
"ca-pub-9420604735624631"
99 data-ad-slot=
"8014013294"></ins>
101 (adsbygoogle = window.adsbygoogle || []).push({});
104 </div><!--/sidebar-->
107 <article class=
"day-desc"><h2>--- Day
10: Balance Bots ---
</h2><p>You come upon a factory in which many robots are
<a href=
"https://www.youtube.com/watch?v=JnkMyfQ5YfY&t=40">zooming around
</a> handing small microchips to each other.
</p>
108 <p>Upon closer examination, you notice that each bot only proceeds when it has
<em>two
</em> microchips, and once it does, it gives each one to a different bot or puts it in a marked
"output" bin. Sometimes, bots take microchips from
"input" bins, too.
</p>
109 <p>Inspecting one of the microchips, it seems like they each contain a single number; the bots must use some logic to decide what to do with each chip. You access the local control computer and download the bots' instructions (your puzzle input).
</p>
110 <p>Some of the instructions specify that a specific-valued microchip should be given to a specific bot; the rest of the instructions indicate what a given bot should do with its
<em>lower-value
</em> or
<em>higher-value
</em> chip.
</p>
111 <p>For example, consider the following instructions:
</p>
112 <pre><code>value
5 goes to bot
2
113 bot
2 gives low to bot
1 and high to bot
0
114 value
3 goes to bot
1
115 bot
1 gives low to output
1 and high to bot
0
116 bot
0 gives low to output
2 and high to output
0
117 value
2 goes to bot
2
120 <li>Initially, bot
<code>1</code> starts with a value-
<code>3</code> chip, and bot
<code>2</code> starts with a value-
<code>2</code> chip and a value-
<code>5</code> chip.
</li>
121 <li>Because bot
<code>2</code> has two microchips, it gives its lower one (
<code>2</code>) to bot
<code>1</code> and its higher one (
<code>5</code>) to bot
<code>0</code>.
</li>
122 <li>Then, bot
<code>1</code> has two microchips; it puts the value-
<code>2</code> chip in output
<code>1</code> and gives the value-
<code>3</code> chip to bot
<code>0</code>.
</li>
123 <li>Finally, bot
<code>0</code> has two microchips; it puts the
<code>3</code> in output
<code>2</code> and the
<code>5</code> in output
<code>0</code>.
</li>
125 <p>In the end, output bin
<code>0</code> contains a value-
<code>5</code> microchip, output bin
<code>1</code> contains a value-
<code>2</code> microchip, and output bin
<code>2</code> contains a value-
<code>3</code> microchip. In this configuration, bot number
<em><code>2</code></em> is responsible for comparing value-
<code>5</code> microchips with value-
<code>2</code> microchips.
</p>
126 <p>Based on your instructions,
<em>what is the number of the bot
</em> that is responsible for comparing value-
<code>61</code> microchips with value-
<code>17</code> microchips?
</p>
128 <p>Your puzzle answer was
<code>86</code>.
</p><article class=
"day-desc"><h2>--- Part Two ---
</h2><p><span title=
"What do you get if you multiply six by nine?">What do you get
</span> if you
<em>multiply together the values
</em> of one chip in each of outputs
<code>0</code>,
<code>1</code>, and
<code>2</code>?
</p>
130 <p>Your puzzle answer was
<code>22847</code>.
</p><p class=
"day-success">Both parts of this puzzle are complete! They provide two gold stars: **
</p>
131 <p>At this point, you should
<a href=
"/2016">return to your advent calendar
</a> and try another puzzle.
</p>
132 <p>If you still want to see it, you can
<a href=
"10/input" target=
"_blank">get your puzzle input
</a>.
</p>
133 <p>You can also
<span class=
"share">[Share
<span class=
"share-content">on
134 <a href=
"https://twitter.com/intent/tweet?text=I%27ve+completed+%22Balance+Bots%22+%2D+Day+10+%2D+Advent+of+Code+2016&url=http%3A%2F%2Fadventofcode%2Ecom%2F2016%2Fday%2F10&related=ericwastl&hashtags=AdventOfCode" target=
"_blank">Twitter
</a>
135 <a href=
"https://plus.google.com/share?url=http%3A%2F%2Fadventofcode%2Ecom%2F2016%2Fday%2F10" target=
"_blank">Google+
</a>
136 <a href=
"http://www.reddit.com/submit?url=http%3A%2F%2Fadventofcode%2Ecom%2F2016%2Fday%2F10&title=I%27ve+completed+%22Balance+Bots%22+%2D+Day+10+%2D+Advent+of+Code+2016" target=
"_blank">Reddit
</a
137 ></span>]
</span> this puzzle.
</p>
142 (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
143 (i[r].q=i[r].q||[]).push(arguments)},i[r].l=
1*new Date();a=s.createElement(o),
144 m=s.getElementsByTagName(o)[
0];a.async=
1;a.src=g;m.parentNode.insertBefore(a,m)
145 })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
146 ga('create', 'UA-
69522494-
1', 'auto');
147 ga('send', 'pageview');