Skip to content

Commit

Permalink
leaderboard
Browse files Browse the repository at this point in the history
  • Loading branch information
shahata committed Dec 8, 2023
1 parent c7fcb47 commit a72d4eb
Show file tree
Hide file tree
Showing 12 changed files with 445 additions and 175 deletions.
2 changes: 1 addition & 1 deletion src/2023/day01.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</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">14*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">16*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down
4 changes: 2 additions & 2 deletions src/2023/day02.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</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">14*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">16*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down Expand Up @@ -58,7 +58,7 @@ <h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=<
</code></pre>
<ul>
<li>In game 1, the game could have been played with as few as 4 red, 2 green, and 6 blue cubes. If any color had even one fewer cube, the game would have been impossible.</li>
<li>Game 2 could have been played with a minimum of 1 red, 3 green, and 4 blue cubes.<li>
<li>Game 2 could have been played with a minimum of 1 red, 3 green, and 4 blue cubes.</li>
<li>Game 3 must have been played with at least 20 red, 13 green, and 6 blue cubes.</li>
<li>Game 4 required at least 14 red, 3 green, and 15 blue cubes.</li>
<li>Game 5 needed no fewer than 6 red, 3 green, and 2 blue cubes in the bag.</li>
Expand Down
2 changes: 1 addition & 1 deletion src/2023/day03.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</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">14*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">16*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down
2 changes: 1 addition & 1 deletion src/2023/day04.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</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">14*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">16*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down
2 changes: 1 addition & 1 deletion src/2023/day05.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</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">14*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">16*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down
2 changes: 1 addition & 1 deletion src/2023/day06.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</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">14*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">16*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down
2 changes: 1 addition & 1 deletion src/2023/day07.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</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">14*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">16*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand Down
95 changes: 95 additions & 0 deletions src/2023/day08.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8" />
<title>Day 8 - 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">16*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<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 8: Haunted Wasteland ---</h2><p>You're still riding a camel across Desert Island when you spot a sandstorm quickly approaching. When you turn to warn the Elf, she disappears before your eyes! To be fair, she had just finished warning you about <em>ghosts</em> a few minutes ago.</p>
<p>One of the camel's pouches is labeled "maps" - sure enough, it's full of documents (your puzzle input) about how to navigate the desert. At least, you're pretty sure that's what they are; one of the documents contains a list of left/right instructions, and the rest of the documents seem to describe some kind of <em>network</em> of labeled nodes.</p>
<p>It seems like you're meant to use the <em>left/right</em> instructions to <em>navigate the network</em>. Perhaps if you have the camel follow the same instructions, you can escape the haunted wasteland!</p>
<p>After examining the maps for a bit, two nodes stick out: <code>AAA</code> and <code>ZZZ</code>. You feel like <code>AAA</code> is where you are now, and you have to follow the left/right instructions until you reach <code>ZZZ</code>.</p>
<p>This format defines each <em>node</em> of the network individually. For example:</p>
<pre><code>RL

AAA = (BBB, CCC)
BBB = (DDD, EEE)
CCC = (ZZZ, GGG)
DDD = (DDD, DDD)
EEE = (EEE, EEE)
GGG = (GGG, GGG)
ZZZ = (ZZZ, ZZZ)
</code></pre>
<p>Starting with <code>AAA</code>, you need to <em>look up the next element</em> based on the next left/right instruction in your input. In this example, start with <code>AAA</code> and go <em>right</em> (<code>R</code>) by choosing the right element of <code>AAA</code>, <code><em>CCC</em></code>. Then, <code>L</code> means to choose the <em>left</em> element of <code>CCC</code>, <code><em>ZZZ</em></code>. By following the left/right instructions, you reach <code>ZZZ</code> in <code><em>2</em></code> steps.</p>
<p>Of course, you might not find <code>ZZZ</code> right away. If you run out of left/right instructions, repeat the whole sequence of instructions as necessary: <code>RL</code> really means <code>RLRLRLRLRLRLRLRL...</code> and so on. For example, here is a situation that takes <code><em>6</em></code> steps to reach <code>ZZZ</code>:</p>
<pre><code>LLR

AAA = (BBB, BBB)
BBB = (AAA, ZZZ)
ZZZ = (ZZZ, ZZZ)
</code></pre>
<p>Starting at <code>AAA</code>, follow the left/right instructions. <em>How many steps are required to reach <code>ZZZ</code>?</em></p>
</article>
<p>Your puzzle answer was <code>20777</code>.</p><article class="day-desc"><h2 id="part2">--- Part Two ---</h2><p>The <span title="Duhduhduhduhduh! Dah, duhduhduhduhduh!">sandstorm</span> is upon you and you aren't any closer to escaping the wasteland. You had the camel follow the instructions, but you've barely left your starting position. It's going to take <em>significantly more steps</em> to escape!</p>
<p>What if the map isn't for people - what if the map is for <em>ghosts</em>? Are ghosts even bound by the laws of spacetime? Only one way to find out.</p>
<p>After examining the maps a bit longer, your attention is drawn to a curious fact: the number of nodes with names ending in <code>A</code> is equal to the number ending in <code>Z</code>! If you were a ghost, you'd probably just <em>start at every node that ends with <code>A</code></em> and follow all of the paths at the same time until they all simultaneously end up at nodes that end with <code>Z</code>.</p>
<p>For example:</p>
<pre><code>LR

11A = (11B, XXX)
11B = (XXX, 11Z)
11Z = (11B, XXX)
22A = (22B, XXX)
22B = (22C, 22C)
22C = (22Z, 22Z)
22Z = (22B, 22B)
XXX = (XXX, XXX)
</code></pre>
<p>Here, there are two starting nodes, <code>11A</code> and <code>22A</code> (because they both end with <code>A</code>). As you follow each left/right instruction, use that instruction to <em>simultaneously</em> navigate away from both nodes you're currently on. Repeat this process until <em>all</em> of the nodes you're currently on end with <code>Z</code>. (If only some of the nodes you're on end with <code>Z</code>, they act like any other node and you continue as normal.) In this example, you would proceed as follows:</p>
<ul>
<li>Step 0: You are at <code>11A</code> and <code>22A</code>.</li>
<li>Step 1: You choose all of the <em>left</em> paths, leading you to <code>11B</code> and <code>22B</code>.</li>
<li>Step 2: You choose all of the <em>right</em> paths, leading you to <code><em>11Z</em></code> and <code>22C</code>.</li>
<li>Step 3: You choose all of the <em>left</em> paths, leading you to <code>11B</code> and <code><em>22Z</em></code>.</li>
<li>Step 4: You choose all of the <em>right</em> paths, leading you to <code><em>11Z</em></code> and <code>22B</code>.</li>
<li>Step 5: You choose all of the <em>left</em> paths, leading you to <code>11B</code> and <code>22C</code>.</li>
<li>Step 6: You choose all of the <em>right</em> paths, leading you to <code><em>11Z</em></code> and <code><em>22Z</em></code>.</li>
</ul>
<p>So, in this example, you end up entirely on nodes that end in <code>Z</code> after <code><em>6</em></code> steps.</p>
<p>Simultaneously start on every node that ends with <code>A</code>. <em>How many steps does it take before you're only on nodes that end with <code>Z</code>?</em></p>
</article>
<p>Your puzzle answer was <code>13289612809129</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="day08.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+%22Haunted+Wasteland%22+%2D+Day+8+%2D+Advent+of+Code+2023&amp;url=https%3A%2F%2Fadventofcode%2Ecom%2F2023%2Fday%2F8&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=I%27ve+completed+%22Haunted+Wasteland%22+%2D+Day+8+%2D+Advent+of+Code+2023+%23AdventOfCode+https%3A%2F%2Fadventofcode%2Ecom%2F2023%2Fday%2F8';try{localStorage.setItem('mastodon.server',ms);}finally{}}else{return false;}" target="_blank">Mastodon</a
></span>]</span> this puzzle.</p>
</main>
</body>
</html>
6 changes: 3 additions & 3 deletions src/2023/events.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="title-global"><a href="index.html">Advent of Code</a></h1>
</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">14*</span></div>
title="Member of sponsor: Wix Engineering">(Sponsor)</a> <span class="star-count">16*</span></div>
</div>
<div>
<h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=</span><a
Expand All @@ -32,7 +32,7 @@ <h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=<
<main>
<article>
<p>From here, you can access all of the events (and the corresponding puzzles, leaderboards, stats, etc) ever run on Advent of Code:</p>
<div class="eventlist-event"><a href="../2023/index.html">[2023]</a> <span class="star-count">14*</span> <a href="/2023/support" class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a></div>
<div class="eventlist-event"><a href="../2023/index.html">[2023]</a> <span class="star-count">16*</span> <a href="/2023/support" class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a></div>
<div class="eventlist-event"><a href="../2022/index.html">[2022]</a> <span class="star-count">50*</span> <a href="/2022/support" class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a></div>
<div class="eventlist-event"><a href="../2021/index.html">[2021]</a> <span class="star-count">50*</span> <a href="/2021/support" class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a></div>
<div class="eventlist-event"><a href="../2020/index.html">[2020]</a> <span class="star-count">50*</span> <a href="/2020/support" class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a></div>
Expand All @@ -41,7 +41,7 @@ <h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">$year=<
<div class="eventlist-event"><a href="../2017/index.html">[2017]</a> <span class="star-count">50*</span> <a href="/2017/support" class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a></div>
<div class="eventlist-event"><a href="../2016/index.html">[2016]</a> <span class="star-count">50*</span> <a href="/2016/support" class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a></div>
<div class="eventlist-event"><a href="../2015/index.html">[2015]</a> <span class="star-count">50*</span> <a href="/2015/support" class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a></div>
<p>Total stars: <span class="star-count">414*</span></article>
<p>Total stars: <span class="star-count">416*</span></article>
</main>
</body>
</html>
Loading

0 comments on commit a72d4eb

Please sign in to comment.