Advent of Code 2018
Clone or download
Latest commit da2e135 Dec 11, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
day-01 Day 1 part 2 perf update (#114) Dec 9, 2018
day-02 Merge remote-tracking branch 'origin/master' into ayoub/refactor Dec 9, 2018
day-03 Merge remote-tracking branch 'origin/master' into ayoub/refactor Dec 9, 2018
day-04 Merge remote-tracking branch 'origin/master' into ayoub/refactor Dec 9, 2018
day-05 Merge remote-tracking branch 'origin/master' into ayoub/refactor Dec 9, 2018
day-06 Merge remote-tracking branch 'origin/master' into ayoub/refactor Dec 9, 2018
day-07 [python] fix impores Dec 9, 2018
day-08 [python] fix impores Dec 9, 2018
day-09 silvestre/day-9 Dec 10, 2018
day-10 [day-10] ayoub solution optimization (cpp) Dec 10, 2018
day-11 Merge branch 'master' of github.com:badouralix/advent-of-code-2018 in… Dec 11, 2018
tool [runner] allow gc deactivation from go template Dec 10, 2018
.gitignore Merge remote-tracking branch 'origin/master' into ayoub/refactor Dec 8, 2018
.travis.yml [runner] use xenial Dec 4, 2018
Cargo.lock Test Dec 1, 2018
Cargo.toml [enizor] Day 7 (#91) Dec 7, 2018
LICENSE Commit for a dream Dec 1, 2018
README.md [breaking-change] refactor tool Dec 5, 2018
aoc [fixes] Dec 7, 2018
build.sh [build] remove warnings & build against master Dec 5, 2018
create.py [fixes] Dec 7, 2018
package-lock.json [runner] commit for a lock Dec 1, 2018
package.json Commit for a dream Dec 1, 2018
requirements.txt [run] add tqdm progress bar Dec 5, 2018
run.py [fixes] Dec 7, 2018
setup.cfg Commit for a dream Dec 1, 2018

README.md

Advent of code 2018 solutions

⁣    🌟
    🎄
   🎄🎄
  🎄🎄🎄
🎄🎄🎄🎄
🎄🎄🎄🎄🎄
  🎁🎁🎁

These are proposed solutions for the Advent of Code 2018.

The solutions are automatically tested with travis.

Build Status

Usage

use ./aoc script

usage: aoc <command> [<args>]

aoc commands are:
   run      Runs submissions
   create   Creates a new submission
   config   Configures user's parameters

Examples

Run last problem

./aoc run
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Running submissions for day 04:

* part 2:
---------------------------------------------------
Avg over all inputs
---------------------------------------------------
----------  ----------  -----------  ---
silvestre      78452        1.99 ms  py
degemer        43695        2.39 ms  py
jules          23037        2.49 ms  py
david          36371        2.94 ms  py
thomas          9763        2.97 ms  py
ayoub         136461        5.85 ms  cpp
evqna          49137        6.65 ms  cpp
badouralix     51232        7.26 ms  go
tpxp           41668      133.63 ms  rb
----------  ----------  -----------  ---

Run specific problems from specific users

./aoc run -d 1 -d 2 -p 1 -a ayoub -a david
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Running submissions for day 01:

* part 1:
---------------------------------------------------
Avg over all inputs
---------------------------------------------------
-----  -------  -----------  ---
david    543        0.46 ms  py
ayoub    445        4.94 ms  cpp
-----  -------  -----------  ---
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Running submissions for day 02:

* part 1:
---------------------------------------------------
Avg over all inputs
---------------------------------------------------
-----  --------  -----------  ---
david    5658        1.22 ms  py
ayoub    6448        4.84 ms  cpp
-----  --------  -----------  ---

You can use -r to run each submission on it's own input, or -e to print non-aggregated results.
see ./aoc run -h for full arguments description.

Contribute

For now we support c, c++, javascript, go, python 3, ruby, rust (stable) and bash scripts.

You can use ./aoc create tool to create a new empty submission:

usage: aoc create [-h] [-a AUTHOR] [-d DAY] [-p PART]
                  [-l {c,cpp,go,js,py,rb,rs,sh}]

Create a new submission

optional arguments:
  -a AUTHOR, --author AUTHOR
                        submission author
  -d DAY, --day DAY     problem day
  -p PART, --part PART  problem part
  -l {c,cpp,go,js,py,rb,rs,sh}, --language {c,cpp,go,js,py,rb,rs,sh}
                        submission language

you can also use ./aoc config to setup your local profile

usage: aoc config [-h] username {c,cpp,go,js,py,rb,rs,sh}

Configures user parameters

positional arguments:
  username              prefered username
  {c,cpp,go,js,py,rb,rs,sh}
                        prefered programming language

Using python

If you don't use create.py tool you should follow this convention:

day-[number]/part-[number]/[username].py    # your submission code
day-[number]/input/[username].txt           # your input file

Your submission code should inherit from the SubmissionPy class from runners.python module:

from tool.runners.python import SubmissionPy

class MyAwesomeSubmission(SubmissionPy):

    def run(self, s):
        # :param s: input in string format
        # :return: solution flag

You can add other functions & modules if you need to. Any external dependency should be added to requirements.txt.

Once you tested your solution you can submit it by making a PR.

History