Code Monkey home page Code Monkey logo

advent-of-code-2022's Introduction

Advent of Code 2022 ๐ŸŽ„

Advent of Code 2022 solutions in Python.

Requirements โš’

The solutions are intended for Python 3.11, although the majority of the solutions should work even with older versions of Python. Required Python packages are specified in requirements.txt. Use pip to install them.

pip install -r requirements.txt

Running Solutions ๐Ÿƒ

The repository contains a script designed for running solutions and comparing expected result with produced result. To use it, navigate first to the src directory inside the project repository.

cd src

You can get the script help using --help parameter.

python main.py --help

There are two required parameters to specify which solution should be executed. To run solution for day 6 part a, use the following command.

python main.py 6 a

To select a different input for the solution, use option --task-input. The default value is test. To execute solution with actual puzzle input run the following command.

python main.py 6 a --task-input puzzle

The command should result the following output.

INFO:2022-12-15 18:42:05,327:__main__:Running day_str='06' task='a' task_input='test'
INFO:2022-12-15 18:42:05,327:__main__:Importing solution module.
INFO:2022-12-15 18:42:05,328:__main__:Accessing solution class.
INFO:2022-12-15 18:42:05,328:__main__:Creating a solution instance.
INFO:2022-12-15 18:42:05,328:__main__:Running solution for /path_to_repository/advent-of-code-2022/src/inputs/day_06_test.txt
INFO:2022-12-15 18:42:05,328:pytimers.triggers.logger_trigger:Finished task run in 0.053ms [0.0s].
INFO:2022-12-15 18:42:05,328:__main__:Result: 7
INFO:2022-12-15 18:42:05,328:__main__:Expected result: 7
INFO:2022-12-15 18:42:05,328:__main__:Success!!

Disclaimer ๐ŸŽ

The solutions were optimized for implementation speed (I didn't want to finish last obviously ๐Ÿข) with reasonable focus on code quality on the other hand. Therefore, used algorithms are by no means optimal and there should be cleaner and faster solutions around.

advent-of-code-2022's People

Contributors

michalfilippi avatar

Watchers

James Cloos avatar  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.