Skip to content

lypnol/adventofcode-2017

Repository files navigation

Build Status

Advent of code 2017 submissions

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

These are proposed submissions for http://adventofcode.com/2017.

The solutions are automatically tested with travis

How to use

To run submissions use run.py script

usage: run.py [-h] [--last] [-d DAY] [-p PART] [-a AUTHORS] [-i IGNORE]
              [-l LANGUAGES] [-f] [-r] [-s]

Run contest submissions

optional arguments:
  -h, --help            show this help message and exit
  --last                Run submissions from last day
  -d DAY, --day DAY     Run submissions for specific day
  -p PART, --part PART  Run submissions for specific day part
  -a AUTHORS, --authors AUTHORS
                        Run submissions from specific authors, ex: user1,user2
  -i IGNORE, --ignore IGNORE
                        Ignore submissions from specific authors
  -l LANGUAGES, --languages LANGUAGES
                        Run submissions written in specific languages, ex:
                        js,py, supported: c cpp go js py rb rs
  -f, --force           Force running submissions even if tool is missing
  -r, --restricted      Restrict each author to their input only
  -s, --silent          Disable debug mode

How to contribute

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

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

usage: create.py [-h] [-p {1,2}] [-l {c,cpp,go,js,py,rb,rs}] author day

Creates new empty submission

positional arguments:
  author                Name of author (github login)
  day                   Day of problem (between 1 and 25)

optional arguments:
  -h, --help            show this help message and exit
  -p {1,2}, --part {1,2}
                        Create submission for one day part only
  -l {c,cpp,go,js,py,rb,rs}, --language {c,cpp,go,js,py,rb,rs}
                        Use specified language

Using python

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

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

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

from runners.python import Submission

class MyAwesomeSubmission(Submission):

    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.

About

Proposed solutions for adventofcode 2017 edition

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published