Skip to content

OctaviPascual/AdventOfCode2017

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code 2017

My solutions for Advent of Code 2017 in Python.

Special thanks to Erisc Wastl and the rest of the AoC team for such an awesome set of challenges! :bowtie:

Usage

The main program of this project is adventofcode.py. You must use this program to run any day puzzle. Usage is pretty straightforward. Note that DAY can be any number from 1 to 25. You can find a sample of the ouput in output.txt.

usage: adventofcode.py [-h] [-d DAY]

Run Advent of Code 2017

optional arguments:
  -h, --help         show this help message and exit
  -d DAY, --day DAY  day to run (all by default)

I only used built-in modules, so it should be easy to run the program in your local machine. Just note that Python3 is required. However, to ensure that indeed the program works, I have dockerized the program.

Run all days

git clone https://github.com/EikaNN/AdventOfCode2017.git
cd AdventOfCode2017/adventofcode
python adventofcode.py

Run a specific day

git clone https://github.com/EikaNN/AdventOfCode2017.git
cd AdventOfCode2017/adventofcode
python adventofcode.py -d DAY

Docker

If you want to use Docker, there are two docker images available. The first one uses Python while the second one uses PyPy, which speeds up considerably the execution.

The following table shows how much it takes to run all days in both Python and Pypy, and the performance gain is substantial, especially considering that no source code modifications were needed!

Python PyPy
9min44s 1min20s

Python

Run a specific day

git clone https://github.com/EikaNN/AdventOfCode2017.git
cd AdventOfCode2017/docker
./docker_python.sh -d DAY

Run all days

git clone https://github.com/EikaNN/AdventOfCode2017.git
cd AdventOfCode2017/docker
./docker_python.sh

PyPy

Run a specific day

git clone https://github.com/EikaNN/AdventOfCode2017.git
cd AdventOfCode2017/docker
./docker_pypy.sh -d DAY

Run all days

git clone https://github.com/EikaNN/AdventOfCode2017.git
cd AdventOfCode2017/docker
./docker_pypy.sh

About

🎄Solutions in Python to Advent Of Code 2017

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published