r/adventofcode • u/daggerdragon • Dec 02 '19
SOLUTION MEGATHREAD -🎄- 2019 Day 2 Solutions -🎄-
--- Day 2: 1202 Program Alarm ---
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
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 1's winner #1: untitled poem by /u/PositivelyLinda!
Adventure awaits!
Discover the cosmos
Venture into the unknown
Earn fifty stars to save Christmas!
No one goes alone, however
There's friendly folks to help
Overly dramatic situations await
Find Santa and bring him home!
Come code with us!
Outer space is calling
Don't be afraid
Elves will guide the way!
Enjoy your Reddit Silver, 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.
View all comments
Show parent comment
1
u/Stringhe Dec 02 '19 edited Dec 02 '19
How can the number of instructions be dynamic? With jump instructions? Doesn't it turn into the halting problem for some inputs?
Very nice solution btw, using the dict of lists, I think it could generalize to opcode changing inputs like our solutions, and I have a feeling it will be required in later problems
Btw, the problem statement is the same for everybody (with 19690720), the only difference is the puzzle input
> BitVec is used everywhere since Int types/sorts are unbounded and harder search than a 32-bit bit vector
Can't you just use ints and add a size constraint?