Giter Site home page Giter Site logo

fvarnals / advent-of-code-2018 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from badouralix/adventofcode-2018

0.0 1.0 0.0 5 MB

Advent of Code 2018

Home Page: https://adventofcode.com/2018

License: MIT License

Python 98.30% Shell 0.01% Go 0.18% C++ 0.83% JavaScript 0.06% Rust 0.21% C 0.28% Java 0.11% Ruby 0.02%

advent-of-code-2018's Introduction

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++, java, javascript, go, python 3 (+ cython), 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,java,js,py,pyx,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,java,js,py,pyx,rb,rs,sh}, --language {c,cpp,go,java,js,py,pyx,rb,rs,sh}
                        submission language

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

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

Configures user parameters

positional arguments:
  username              prefered username
  {c,cpp,go,java,js,py,pyx,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
        pass

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

advent-of-code-2018's People

Contributors

badouralix avatar sfluor avatar thomren avatar lypnol avatar silvestreperret avatar solenleroux avatar atauveron avatar julesdt avatar david-ds avatar degemer avatar remicalixte avatar tpxp avatar evqna avatar jonremy avatar youyoun avatar anatolebeuzon avatar ayc0 avatar enizor avatar aymericbebert avatar ludoge avatar gandem avatar alsyia avatar oxlay avatar puigfp-dd avatar puigfp avatar rpelliard avatar quentinverlhac avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.