AoC 2019 D9: Sensor Boost
| Problem statement | Source code | Tags: Intcode
← Previous Back to AoC Index Next →
- To add support for relative mode, the
relative_baseis added to theProgramclass. Becauseeval_paramandwrite_tonow relies on two states: the memory and the relative base, I just make them member functions so they can directly access onthis. Some other things are also incorporated into the class. - All memory values are now
long longinstead ofint. - The memory is now a
map<long long, long long>instead of avector<long long>, so that the memory can be indexed at arbitrary addresses without greatly growing its physical size.