Giter Club home page Giter Club logo

advent-of-code's Introduction

Advent of Code

My solutions to Advent of Code.

All solutions are written for Python 3.9+ and use only standard library utilities.

All solution files can be executed without arguments on the command line. The script will try to find a matching input file under the input directory relative to the script. E.g. ./2023/day01.py will try to read ./2023/input/day01.

$ python3 2023/day01.py
55002
55093

You can also specify the input file as an extra argument:

$ python3 2023/day04.py example
13
30

util.py

The util.py module contains common helper functions used in the solutions.

download.py

The download.py script can be used to download input files from adventofcode.com. It requires an active session key ot be stored in the sessionkey file.

The script will also create a template for the solution file if non already exists.

$ python3 download.py 2023 10
Fetching input file /Users/pnystrom/Projects/advent-of-code/2023/input/day10
Writing empty solution file /Users/pnystrom/Projects/advent-of-code/2023/day10.py

runall.py

The runall.py script can be used to execute all solution files in the repo (that there are input files for):

$ python3 runall.py
day01a.py: 888331
    (0.005 s)
day01b.py: 130933530
    (0.102 s)
day02a.py: 378
    (0.004 s)
day02b.py: 280
    (0.006 s)
day03a.py: 195
    (0.001 s)
...

advent-of-code's People

Contributors

jimorie avatar

Watchers

 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.