Day 19 done
authorNeil Smith <neil.git@njae.me.uk>
Sat, 4 Jan 2020 12:31:45 +0000 (12:31 +0000)
committerNeil Smith <neil.git@njae.me.uk>
Sat, 4 Jan 2020 12:31:45 +0000 (12:31 +0000)
advent19/package.yaml [new file with mode: 0644]
advent19/src/advent19.hs [new file with mode: 0644]
data/advent19.txt [new file with mode: 0644]
data/advent19a.txt [new file with mode: 0644]
problems/day19.html [new file with mode: 0644]
stack.yaml

diff --git a/advent19/package.yaml b/advent19/package.yaml
new file mode 100644 (file)
index 0000000..4a6a56a
--- /dev/null
@@ -0,0 +1,60 @@
+# This YAML file describes your package. Stack will automatically generate a
+# Cabal file when you run `stack build`. See the hpack website for help with
+# this file: <https://github.com/sol/hpack>.
+
+name: advent19
+synopsis: Advent of Code
+version: '0.0.1'
+
+default-extensions:
+- AllowAmbiguousTypes
+- ApplicativeDo
+- BangPatterns
+- BlockArguments
+- DataKinds
+- DeriveFoldable
+- DeriveFunctor
+- DeriveGeneric
+- DeriveTraversable
+- EmptyCase
+- FlexibleContexts
+- FlexibleInstances
+- FunctionalDependencies
+- GADTs
+- GeneralizedNewtypeDeriving
+- ImplicitParams
+- KindSignatures
+- LambdaCase
+- MonadComprehensions
+- MonoLocalBinds
+- MultiParamTypeClasses
+- MultiWayIf
+- NegativeLiterals
+- NumDecimals
+- OverloadedLists
+- OverloadedStrings
+- PartialTypeSignatures
+- PatternGuards
+- PatternSynonyms
+- PolyKinds
+- RankNTypes
+- RecordWildCards
+- ScopedTypeVariables
+- TemplateHaskell
+- TransformListComp
+- TupleSections
+- TypeApplications
+- TypeInType
+- TypeOperators
+- ViewPatterns
+
+
+executables:
+  advent19:
+    main: advent19.hs
+    source-dirs: src
+    dependencies:
+    - base >= 2 && < 6
+    - text
+    - containers
+    - intcode
diff --git a/advent19/src/advent19.hs b/advent19/src/advent19.hs
new file mode 100644 (file)
index 0000000..7543513
--- /dev/null
@@ -0,0 +1,95 @@
+import Debug.Trace
+
+import Intcode
+
+import qualified Data.Text.IO as TIO
+
+import qualified Data.Map.Strict as M
+-- import Data.Map.Strict ((!))
+import Data.List
+
+newtype Position = Position (Integer, Integer) deriving (Ord, Eq, Show) -- x, y
+
+newtype Bounds = Bounds (Integer, Integer) deriving (Ord, Eq, Show) -- upper, lower
+
+type Beam = M.Map Integer Bounds
+
+
+main :: IO ()
+main = do 
+        text <- TIO.readFile "data/advent19.txt"
+        let mem = parseMachineMemory text
+        let machine = makeMachine mem
+        print $ part1 machine
+        print $ part2 machine
+
+
+maxY = 50 :: Integer
+xRange = [0..49] :: [Integer]
+boxSize = 100 :: Integer
+
+
+-- part1 :: Machine -> Integer
+-- part1 machine = beamPresence
+part1 machine = sum $ map cellsInRange $ M.elems beamPresence
+    where beamPresence = foldl' (traceBeam machine) M.empty xRange -- [0..49] @[Integer]
+          -- cir = map cellsInRange $ M.elems beamPresence
+
+
+part2 machine = score $ head $ dropWhile (not . containsBox) corners
+-- part2 machine = corners
+    where uppers = scanl' (traceUpper machine) 0 xs
+          lowers = scanl' (traceLower machine) (0, 0) xs
+          corners = zip (drop ((fromIntegral boxSize) - 1) uppers) lowers
+          xs = [0..] :: [Integer]
+
+containsBox (yt, (_xb, yb)) = yt + boxSize - 1 <= yb
+
+score (yt, (xb, _yb)) = xb * 10000 + yt
+
+
+cellsInRange :: Bounds -> Integer
+cellsInRange (Bounds (u, l)) = l' - u'
+    where u' = min u maxY
+          l' = min l maxY
+
+
+traceBeam :: Machine -> Beam -> Integer -> Beam
+-- traceBeam _machine beam x | trace ((show x) ++ " " ++ (show beam)) False = undefined
+traceBeam machine beam x = M.insert x (Bounds (u', l')) beam
+    where Bounds (prevU, _prevL) = M.findWithDefault (Bounds (0, 0)) (x - 1) beam
+          (bic, _foundU) = beamInColumn machine x
+          u = head $ dropWhile (\y -> not $ tractorBeamAt machine x y) [prevU..]
+          l = head $ dropWhile (\y -> tractorBeamAt machine x y) [u..]
+          (u', l') = if prevU == 0 && bic == False
+                       then (0, 0)
+                       else (u, l)
+
+traceUpper :: Machine -> Integer -> Integer -> Integer
+traceUpper machine prev x = u'
+    where (bic, _foundU) = beamInColumn machine x
+          u = head $ dropWhile (\y -> not $ tractorBeamAt machine x y) [prev..]
+          u' = if prev == 0 && bic == False
+               then 0
+               else u
+
+traceLower :: Machine -> (Integer, Integer) -> Integer -> (Integer, Integer)
+traceLower machine (_, prev) x = (x, l')
+    where (bic, foundU) = beamInColumn machine x
+          startU = max prev foundU
+          l = head $ dropWhile (\y -> tractorBeamAt machine x y) [startU..]
+          l' = if prev == 0 && bic == False
+               then 0
+               else l - 1
+
+tractorBeamAt :: Machine -> Integer -> Integer -> Bool
+tractorBeamAt machine x y = (head output) == 1
+    where (_, _, output) = runMachine [x, y] machine
+
+
+beamInColumn :: Machine -> Integer -> (Bool, Integer)
+beamInColumn machine x
+    | null fromTop = (False, 0)
+    | otherwise = (True, head fromTop)
+    where fromTop = dropWhile (\y -> not $ tractorBeamAt machine x y) [0..maxY]
+
diff --git a/data/advent19.txt b/data/advent19.txt
new file mode 100644 (file)
index 0000000..f62408e
--- /dev/null
@@ -0,0 +1 @@
+109,424,203,1,21102,1,11,0,1106,0,282,21101,18,0,0,1105,1,259,2102,1,1,221,203,1,21101,0,31,0,1105,1,282,21101,0,38,0,1105,1,259,20101,0,23,2,21202,1,1,3,21101,0,1,1,21101,57,0,0,1105,1,303,1202,1,1,222,21002,221,1,3,21001,221,0,2,21102,1,259,1,21101,0,80,0,1105,1,225,21101,0,175,2,21102,1,91,0,1106,0,303,2101,0,1,223,21001,222,0,4,21102,259,1,3,21101,225,0,2,21102,1,225,1,21102,1,118,0,1105,1,225,21002,222,1,3,21101,70,0,2,21101,0,133,0,1105,1,303,21202,1,-1,1,22001,223,1,1,21102,1,148,0,1105,1,259,2102,1,1,223,21002,221,1,4,21002,222,1,3,21102,24,1,2,1001,132,-2,224,1002,224,2,224,1001,224,3,224,1002,132,-1,132,1,224,132,224,21001,224,1,1,21101,195,0,0,105,1,109,20207,1,223,2,21002,23,1,1,21101,0,-1,3,21102,1,214,0,1106,0,303,22101,1,1,1,204,1,99,0,0,0,0,109,5,2102,1,-4,249,21202,-3,1,1,22102,1,-2,2,21201,-1,0,3,21101,0,250,0,1106,0,225,21201,1,0,-4,109,-5,2105,1,0,109,3,22107,0,-2,-1,21202,-1,2,-1,21201,-1,-1,-1,22202,-1,-2,-2,109,-3,2105,1,0,109,3,21207,-2,0,-1,1206,-1,294,104,0,99,21202,-2,1,-2,109,-3,2106,0,0,109,5,22207,-3,-4,-1,1206,-1,346,22201,-4,-3,-4,21202,-3,-1,-1,22201,-4,-1,2,21202,2,-1,-1,22201,-4,-1,1,22101,0,-2,3,21101,343,0,0,1105,1,303,1105,1,415,22207,-2,-3,-1,1206,-1,387,22201,-3,-2,-3,21202,-2,-1,-1,22201,-3,-1,3,21202,3,-1,-1,22201,-3,-1,2,21201,-4,0,1,21101,0,384,0,1105,1,303,1105,1,415,21202,-4,-1,-4,22201,-4,-3,-4,22202,-3,-2,-2,22202,-2,-4,-4,22202,-3,-2,-3,21202,-4,-1,-2,22201,-3,-2,1,21201,1,0,-4,109,-5,2106,0,0
diff --git a/data/advent19a.txt b/data/advent19a.txt
new file mode 100644 (file)
index 0000000..8881e0a
--- /dev/null
@@ -0,0 +1 @@
+3,20,3,21,2,21,22,24,1,24,20,24,9,24,204,25,99,0,0,0,0,0,40,35,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1
diff --git a/problems/day19.html b/problems/day19.html
new file mode 100644 (file)
index 0000000..543f2d9
--- /dev/null
@@ -0,0 +1,182 @@
+<!DOCTYPE html>
+<html lang="en-us">
+<head>
+<meta charset="utf-8"/>
+<title>Day 19 - Advent of Code 2019</title>
+<!--[if lt IE 9]><script src="/static/html5.js"></script><![endif]-->
+<link href='//fonts.googleapis.com/css?family=Source+Code+Pro:300&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
+<link rel="stylesheet" type="text/css" href="/static/style.css?24"/>
+<link rel="stylesheet alternate" type="text/css" href="/static/highcontrast.css?0" title="High Contrast"/>
+<link rel="shortcut icon" href="/favicon.png"/>
+</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, ads, 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 each year takes all of my free time for 4-5 months. 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 @ericwastl on Twitter.
+
+- Eric Wastl
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+-->
+<body>
+<header><div><h1 class="title-global"><a href="/">Advent of Code</a></h1><nav><ul><li><a href="/2019/about">[About]</a></li><li><a href="/2019/events">[Events]</a></li><li><a href="https://teespring.com/adventofcode-2019" target="_blank">[Shop]</a></li><li><a href="/2019/settings">[Settings]</a></li><li><a href="/2019/auth/logout">[Log Out]</a></li></ul></nav><div class="user">Neil Smith <a href="/2019/support" class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <span class="star-count">38*</span></div></div><div><h1 class="title-event">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">/*</span><a href="/2019">2019</a><span class="title-event-wrap">*/</span></h1><nav><ul><li><a href="/2019">[Calendar]</a></li><li><a href="/2019/support">[AoC++]</a></li><li><a href="/2019/sponsors">[Sponsors]</a></li><li><a href="/2019/leaderboard">[Leaderboard]</a></li><li><a href="/2019/stats">[Stats]</a></li></ul></nav></div></header>
+
+<div id="sidebar">
+<div id="sponsor"><div class="quiet">Our <a href="/2019/sponsors">sponsors</a> help make Advent of Code possible:</div><div class="sponsor"><a href="https://auricsystems.com/tokenize-almost-anything?utm_source=advent+of+code&amp;utm_medium=display&amp;utm_camapign=advent2019" target="_blank" onclick="if(ga)ga('send','event','sponsor','sidebar',this.href);" rel="noopener">AuricVault®</a> - Thieves can&apos;t steal -- what isn&apos;t there! Secure your sensitive data. Simple API. FREE test credentials. Start simplifying your compliance.</div></div>
+</div><!--/sidebar-->
+
+<main>
+<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>
+<article class="day-desc"><h2>--- Day 19: Tractor Beam ---</h2><p>Unsure of the state of Santa's ship, you <span title="&quot;borrowed&quot;">borrowed</span> the tractor beam technology from Triton. Time to test it out.</p>
+<p>When you're safely away from anything else, you activate the tractor beam, but nothing happens.  It's hard to tell whether it's working if there's nothing to use it on. Fortunately, your ship's drone system can be configured to deploy a drone to specific coordinates and then check whether it's being pulled. There's even an <a href="9">Intcode</a> program (your puzzle input) that gives you access to the drone system.</p>
+<p>The program uses two input instructions to request the <em>X and Y position</em> to which the drone should be deployed.  Negative numbers are invalid and will confuse the drone; all numbers should be <em>zero or positive</em>.</p>
+<p>Then, the program will output whether the drone is <em>stationary</em> (<code>0</code>) or <em>being pulled by something</em> (<code>1</code>). For example, the coordinate X=<code>0</code>, Y=<code>0</code> is directly in front of the tractor beam emitter, so the drone control program will always report <code>1</code> at that location.</p>
+<p>To better understand the tractor beam, it is important to <em>get a good picture</em> of the beam itself. For example, suppose you scan the 10x10 grid of points closest to the emitter:</p>
+<pre><code>       X
+  0-&gt;      9
+ 0#.........
+ |.#........
+ v..##......
+  ...###....
+  ....###...
+Y .....####.
+  ......####
+  ......####
+  .......###
+ 9........##
+</code></pre>
+<p>In this example, the <em>number of points affected by the tractor beam</em> in the 10x10 area closest to the emitter is <code><em>27</em></code>.</p>
+<p>However, you'll need to scan a larger area to <em>understand the shape</em> of the beam. <em>How many points are affected by the tractor beam in the 50x50 area closest to the emitter?</em> (For each of X and Y, this will be <code>0</code> through <code>49</code>.)</p>
+</article>
+<p>Your puzzle answer was <code>169</code>.</p><article class="day-desc"><h2 id="part2">--- Part Two ---</h2><p>You aren't sure how large Santa's ship is. You aren't even sure if you'll need to use this thing on Santa's ship, but it doesn't hurt to be prepared. You figure Santa's ship might fit in a <em>100x100</em> square.</p>
+<p>The beam gets wider as it travels away from the emitter; you'll need to be a minimum distance away to fit a square of that size into the beam fully. (Don't rotate the square; it should be aligned to the same axes as the drone grid.)</p>
+<p>For example, suppose you have the following tractor beam readings:</p>
+<pre><code>#.......................................
+.#......................................
+..##....................................
+...###..................................
+....###.................................
+.....####...............................
+......#####.............................
+......######............................
+.......#######..........................
+........########........................
+.........#########......................
+..........#########.....................
+...........##########...................
+...........############.................
+............############................
+.............#############..............
+..............##############............
+...............###############..........
+................###############.........
+................#################.......
+.................########<em>O</em>OOOOOOOOO.....
+..................#######OOOOOOOOOO#....
+...................######OOOOOOOOOO###..
+....................#####OOOOOOOOOO#####
+.....................####OOOOOOOOOO#####
+.....................####OOOOOOOOOO#####
+......................###OOOOOOOOOO#####
+.......................##OOOOOOOOOO#####
+........................#OOOOOOOOOO#####
+.........................OOOOOOOOOO#####
+..........................##############
+..........................##############
+...........................#############
+............................############
+.............................###########
+</code></pre>
+<p>In this example, the <em>10x10</em> square closest to the emitter that fits entirely within the tractor beam has been marked <code>O</code>. Within it, the point closest to the emitter (the only highlighted <code><em>O</em></code>) is at X=<code>25</code>, Y=<code>20</code>.</p>
+<p>Find the <em>100x100</em> square closest to the emitter that fits entirely within the tractor beam; within that square, find the point closest to the emitter.  <em>What value do you get if you take that point's X coordinate, multiply it by <code>10000</code>, then add the point's Y coordinate?</em> (In the example above, this would be <code>250020</code>.)</p>
+</article>
+<p>Your puzzle answer was <code>7001134</code>.</p><p class="day-success">Both parts of this puzzle are complete! They provide two gold stars: **</p>
+<p>At this point, you should <a href="/2019">return to your Advent calendar</a> and try another puzzle.</p>
+<p>If you still want to see it, you can <a href="19/input" target="_blank">get your puzzle input</a>.</p>
+<p>You can also <span class="share">[Share<span class="share-content">on
+  <a href="https://twitter.com/intent/tweet?text=I%27ve+completed+%22Tractor+Beam%22+%2D+Day+19+%2D+Advent+of+Code+2019&amp;url=https%3A%2F%2Fadventofcode%2Ecom%2F2019%2Fday%2F19&amp;related=ericwastl&amp;hashtags=AdventOfCode" target="_blank">Twitter</a>
+  <a href="javascript:void(0);" onclick="var mastodon_instance=prompt('Mastodon Instance / Server Name?'); if(typeof mastodon_instance==='string' && mastodon_instance.length){this.href='https://'+mastodon_instance+'/share?text=I%27ve+completed+%22Tractor+Beam%22+%2D+Day+19+%2D+Advent+of+Code+2019+%23AdventOfCode+https%3A%2F%2Fadventofcode%2Ecom%2F2019%2Fday%2F19'}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>
\ No newline at end of file
index f4b4817d923588df2ff84be4eae4d12015b562e0..9ea2285837540ab432a1f6614af05882defa71c8 100644 (file)
@@ -56,6 +56,7 @@ packages:
 - advent16
 - advent17
 - advent18
+- advent19
 
 
 # Dependency packages to be pulled from upstream that are not in the resolver.