<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="155243" data-post-id="155243">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sasajuric" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/120/991_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sasajuric
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Elixir In Action</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Wow, this was very finicky!</p>
<p>I refused to solve the problem manually. It was clear to me in the morning that it’s not tricky in the algorithmical sense, but that there will be many fine-print details to pay attention to.</p>
<p>I ultimately solved it in a brute-force fashion. I did a depth-first search to find complete paths, then on each path I look for a valid program. This boils down to trying all possible triplets of main routines until I’m able to encode the entire thing into three routines, none of which exceeds the desired length.</p>
<p>The code is available <a href="https://github.com/sasa1977/aoc/blob/master/lib/2019/201917.ex" rel="noopener nofollow ugc">here</a>. It could use a bit more of a cleanup, can’t say it’s my finest hour <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="155243" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/advent-of-code-2019-day-17/27635/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-155243" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="155243"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="155319" data-post-id="155319">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="qhwa" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/qhwa/120/17564_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  qhwa
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m stuck on part 2.</p>
<p>I want to find the solution with program. So I made a path finding function. It outputs all (in my mind) possible routes, in which another function searches for the ABC pattens.</p>
<p>It <a href="https://github.com/qhwa/AdventOfCode/blob/master/test/aoc/2019/day17_test.exs" rel="noopener nofollow ugc">works</a> on the small examples provided, but sadly not with my puzzle input. I think there might be some issues with my path finding algorithm. However I couldn’t figure it out in hours.</p>
<p><a href="https://github.com/qhwa/AdventOfCode/blob/master/lib/aoc/2019/day17.ex" rel="noopener nofollow ugc">The code</a> looks ugly at this moment. <img src="https://forum.elixirforum.com/images/emoji/apple/joy.png?v=15" title=":joy:" class="emoji" alt=":joy:" loading="lazy" width="20" height="20"></p>
<p>rewriting it.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="155319" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/advent-of-code-2019-day-17/27635/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-155319" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="155319"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="155321" data-post-id="155321">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ferd" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ferd/120/12731_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ferd
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Property-Based Testing with PropEr, LYSE, &amp; Erlang in Anger</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<div class="youtube-onebox lazy-video-container" data-video-id="e_AedFneB7Q" data-video-title="Advent of Code 2019 - Day 17" data-video-start-time="" data-provider-name="youtube">
  <a href="https://www.youtube.com/watch?v=e_AedFneB7Q" target="_blank" class="video-thumbnail" rel="noopener nofollow ugc">
    <img class="youtube-thumbnail" src="https://img.youtube.com/vi/e_AedFneB7Q/maxresdefault.jpg" title="Advent of Code 2019 - Day 17" width="690" height="388">
  </a>
</div>

<p>Did the entire thing fully automated using some brute-force probabilistic searches to break down the full path into subroutines and then re-combine the valid subroutines into a sequence of calls that re-create the original program.</p>
<p>One of my biggest struggles there was just remembering the limitations of my intcode computer in that it only handles integers and not strings!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="155321" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/advent-of-code-2019-day-17/27635/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-155321" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="155321"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="155466" data-post-id="155466">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="qhwa" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/qhwa/120/17564_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  qhwa
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Turns out my pattern searching approach was not working correctly. Finally get it perfectly working! Tired but really happy!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="155466" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/advent-of-code-2019-day-17/27635/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-155466" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="155466"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>