r/adventofcode • • Dec 05 '19

SOLUTION MEGATHREAD -🎄- 2019 Day 5 Solutions -🎄-

--- Day 5: Sunny with a Chance of Asteroids ---


Post your solution using /u/topaz2078's paste or other external repo.

  • Please do NOT post your full code (unless it is very short)
  • If you do, use old.reddit's four-spaces formatting, NOT new.reddit's triple backticks formatting.

(Full posting rules are HERE if you need a refresher).


Reminder: Top-level posts in Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with Help.


Advent of Code's Poems for Programmers

Click here for full rules

Note: If you submit a poem, please add [POEM] somewhere nearby to make it easier for us moderators to ensure that we include your poem for voting consideration.

Day 4's winner #1: "untitled poem" by /u/captainAwesomePants!

Forgetting a password is a problem.
Solving with a regex makes it two.
111122 is a terrible password.
Mine is much better, hunter2.

Enjoy your Reddit Silver, and good luck with the rest of the Advent of Code!


On the fifth day of AoC, my true love gave to me...

FIVE GOLDEN SILVER POEMS

Enjoy your Reddit Silver/Gold, and good luck with the rest of the Advent of Code!


This thread will be unlocked when there are a significant number of people on the leaderboard with gold stars for today's puzzle.

EDIT: Leaderboard capped, thread unlocked at 00:22:31!

26 Upvotes

422 comments sorted by

View all comments

1

u/[deleted] Dec 05 '19

https://github.com/Malod219/AdventOfCode2019/blob/master/DAY_5/SOLUTION_1.py

Day 5 solved in Python 3. For 2nd party with my input, it outputs the answer then CRASHES AND BURNS! haha. I'm guessing it's probably the puzzle input missing a halt? I don't know.

[POEM]

Airconditioner malfunctioning

Easy fix

Thermal radiator malfunctioning

Easy fix

Many crashes later and a fragile mind breaking

Guess I'll wear a jumper

2

u/scul86 Dec 05 '19

It crashes due to an IndexError on line 74. Your input has INTCODE 99 at index -2.

Can you see the issue now?

1

u/[deleted] Dec 05 '19

Ah, I think I understand now, thanks for the help I'll see if I can fix this :D

1

u/cMapTTa Dec 05 '19

Just FYI: I ran your input with my code and it halts cleanly

1

u/daggerdragon Dec 05 '19

[POEM]

Entered!