Reflowed problems and added solutions

This commit is contained in:
2018-03-15 11:24:23 -05:00
parent 986d17f104
commit 2a37946673
50 changed files with 2124 additions and 1464 deletions

View File

@@ -1,39 +1,38 @@
Advent of Code
br0xen 40*
• [About]
• [Stats]
• [Leaderboard]
• [Settings]
• [Log out]
Advent of Code
--- Day 7: Some Assembly Required ---
This year, Santa brought little Bobby Tables a set of wires and bitwise logic gates!
Unfortunately, little Bobby is a little under the recommended age range, and he needs help
assembling the circuit.
This year, Santa brought little Bobby Tables a set of wires and bitwise
logic gates! Unfortunately, little Bobby is a little under the recommended
age range, and he needs help assembling the circuit.
Each wire has an identifier (some lowercase letters) and can carry a 16-bit signal (a number
from 0 to 65535). A signal is provided to each wire by a gate, another wire, or some specific
value. Each wire can only get a signal from one source, but can provide its signal to multiple
destinations. A gate provides no signal until all of its inputs have a signal.
Each wire has an identifier (some lowercase letters) and can carry a 16-bit
signal (a number from 0 to 65535). A signal is provided to each wire by a
gate, another wire, or some specific value. Each wire can only get a signal
from one source, but can provide its signal to multiple destinations. A gate
provides no signal until all of its inputs have a signal.
The included instructions booklet describes how to connect the parts together: x AND y -> z
means to connect wires x and y to an AND gate, and then connect its output to wire z.
The included instructions booklet describes how to connect the parts
together: x AND y -> z means to connect wires x and y to an AND gate, and
then connect its output to wire z.
For example:
 123 -> x means that the signal 123 is provided to wire x.
 x AND y -> z means that the bitwise AND of wire x and wire y is provided to wire z.
 p LSHIFT 2 -> q means that the value from wire p is left-shifted by 2 and then provided to
wire q.
 NOT e -> f means that the bitwise complement of the value from wire e is provided to wire
f.
Other possible gates include OR (bitwise OR) and RSHIFT (right-shift). If, for some reason,
you'd like to emulate the circuit instead, almost all programming languages (for example, C,
JavaScript, or Python) provide operators for these gates.
 x AND y -> z means that the bitwise AND of wire x and wire y is provided
to wire z.
 p LSHIFT 2 -> q means that the value from wire p is left-shifted by 2
and then provided to wire q.
 NOT e -> f means that the bitwise complement of the value from wire e is
provided to wire f.
Other possible gates include OR (bitwise OR) and RSHIFT (right-shift). If,
for some reason, you'd like to emulate the circuit instead, almost all
programming languages (for example, C, JavaScript, or Python) provide
operators for these gates.
For example, here is a simple circuit:
@@ -57,26 +56,26 @@
x: 123
y: 456
In little Bobby's kit's instructions booklet (provided as your puzzle input), what signal is
ultimately provided to wire a?
In little Bobby's kit's instructions booklet (provided as your puzzle
input), what signal is ultimately provided to wire a?
Your puzzle answer was 16076.
--- Part Two ---
Now, take the signal you got on wire a, override wire b to that signal, and reset the other
wires (including wire a). What new signal is ultimately provided to wire a?
Now, take the signal you got on wire a, override wire b to that signal, and
reset the other wires (including wire a). What new signal is ultimately
provided to wire a?
Your puzzle answer was 2797.
Both parts of this puzzle are complete! They provide two gold stars: **
At this point, you should return to your advent calendar and try another puzzle.
At this point, you should return to your advent calendar and try another
puzzle.
If you still want to see it, you can get your puzzle input.
You can also [Shareon Twitter Google+ Reddit] this puzzle.
References
Visible links
@@ -98,6 +97,3 @@ References
. https://wiki.python.org/moin/BitwiseOperators
. http://adventofcode.com/
. http://adventofcode.com/day/7/input
. https://twitter.com/intent/tweet?text=I%27ve+completed+%22Some+Assembly+Required%22+%2D+Day+7+%2D+Advent+of+Code&url=http%3A%2F%2Fadventofcode%2Ecom%2Fday%2F7&related=ericwastl&hashtags=AdventOfCode
. https://plus.google.com/share?url=http%3A%2F%2Fadventofcode%2Ecom%2Fday%2F7
. http://www.reddit.com/submit?url=http%3A%2F%2Fadventofcode%2Ecom%2Fday%2F7&title=I%27ve+completed+%22Some+Assembly+Required%22+%2D+Day+7+%2D+Advent+of+Code