-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
300 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-us"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Day 1 - Advent of Code 2023</title> | ||
<link href='https://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" /> | ||
<link rel="stylesheet alternate" type="text/css" href="../static/highcontrast.css" title="High Contrast" /> | ||
<link rel="shortcut icon" href="../static/favicon.png" /> | ||
</head> | ||
<body> | ||
<header> | ||
<div> | ||
<h1 class="title-global"><a href="index.html">Advent of Code</a></h1> | ||
<nav> | ||
<ul> | ||
<li><a href="events.html">[Events]</a></li> | ||
<li><a href="leaderboard.html">[Leaderboard]</a></li> | ||
<li><a href="solver.html">[Solver]</a></li> | ||
</ul> | ||
</nav> | ||
<div class="user">Shahar Talmi <a class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <a | ||
href="https://www.wix.engineering/" target="_blank" class="sponsor-badge" | ||
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">50*</span></div> | ||
</div> | ||
<div> | ||
<h1 class="title-event"> <span class="title-event-wrap">$year=</span><a | ||
href="index.html">2023</a><span class="title-event-wrap">;</span></h1> | ||
</div> | ||
</header> | ||
<main> | ||
<article class="day-desc"><h2>--- Day 1: Trebuchet?! ---</h2><p>Something is wrong with global snow production, and you've been selected to take a look. The Elves have even given you a map; on it, they've used stars to mark the top fifty locations that are likely to be having problems.</p> | ||
<p>You've been doing this long enough to know that to restore snow operations, you need to check all <em class="star">fifty stars</em> by December 25th.</p> | ||
<p>Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants <em class="star">one star</em>. Good luck!</p> | ||
<p>You try to ask why they can't just use a <a href="/2015/day/1">weather machine</a> ("not powerful enough") and where they're even sending you ("the sky") and why your map looks mostly blank ("you sure ask a lot of questions") <span title="My hope is that this abomination of a run-on sentence somehow conveys the chaos of being hastily loaded into a trebuchet.">and</span> hang on did you just say the sky ("of course, where do you think snow comes from") when you realize that the Elves are already loading you into a <a href="https://en.wikipedia.org/wiki/Trebuchet" target="_blank">trebuchet</a> ("please hold still, we need to strap you in").</p> | ||
<p>As they're making the final adjustments, they discover that their calibration document (your puzzle input) has been <em>amended</em> by a very young Elf who was apparently just excited to show off her art skills. Consequently, the Elves are having trouble reading the values on the document.</p> | ||
<p>The newly-improved calibration document consists of lines of text; each line originally contained a specific <em>calibration value</em> that the Elves now need to recover. On each line, the calibration value can be found by combining the <em>first digit</em> and the <em>last digit</em> (in that order) to form a single <em>two-digit number</em>.</p> | ||
<p>For example:</p> | ||
<pre><code>1abc2 | ||
pqr3stu8vwx | ||
a1b2c3d4e5f | ||
treb7uchet | ||
</code></pre> | ||
<p>In this example, the calibration values of these four lines are <code>12</code>, <code>38</code>, <code>15</code>, and <code>77</code>. Adding these together produces <code><em>142</em></code>.</p> | ||
<p>Consider your entire calibration document. <em>What is the sum of all of the calibration values?</em></p> | ||
</article> | ||
<p>Your puzzle answer was <code>54953</code>.</p><article class="day-desc"><h2 id="part2">--- Part Two ---</h2><p>Your calculation isn't quite right. It looks like some of the digits are actually <em>spelled out with letters</em>: <code>one</code>, <code>two</code>, <code>three</code>, <code>four</code>, <code>five</code>, <code>six</code>, <code>seven</code>, <code>eight</code>, and <code>nine</code> <em>also</em> count as valid "digits".</p> | ||
<p>Equipped with this new information, you now need to find the real first and last digit on each line. For example:</p> | ||
<pre><code>two1nine | ||
eightwothree | ||
abcone2threexyz | ||
xtwone3four | ||
4nineeightseven2 | ||
zoneight234 | ||
7pqrstsixteen | ||
</code></pre> | ||
<p>In this example, the calibration values are <code>29</code>, <code>83</code>, <code>13</code>, <code>24</code>, <code>42</code>, <code>14</code>, and <code>76</code>. Adding these together produces <code><em>281</em></code>.</p> | ||
<p><em>What is the sum of all of the calibration values?</em></p> | ||
</article> | ||
<p>Your puzzle answer was <code>53868</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="index.html">return to your Advent calendar</a> and try another puzzle.</p> | ||
<p>If you still want to see it, you can <a href="day01.txt" 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+%22Trebuchet%3F%21%22+%2D+Day+1+%2D+Advent+of+Code+2023&url=https%3A%2F%2Fadventofcode%2Ecom%2F2023%2Fday%2F1&related=ericwastl&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=I%27ve+completed+%22Trebuchet%3F%21%22+%2D+Day+1+%2D+Advent+of+Code+2023+%23AdventOfCode+https%3A%2F%2Fadventofcode%2Ecom%2F2023%2Fday%2F1';try{localStorage.setItem('mastodon.server',ms);}finally{}}else{return false;}" target="_blank">Mastodon</a | ||
></span>]</span> this puzzle.</p> | ||
</main> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.