Code Monkey home page Code Monkey logo

advent-of-code-2023's Introduction

Advent of Code 2023 Elixir

This repository contains my Advent of Code 2023 solutions, implemented in elixir.

I used mhanberg/advent-of-code-elixir-starter as a starting point, slightly tweaking it (for example updating elixir and changing the http client, as in f0e2e1a495f069e66c234d6d329022e78f31f770 )

Usage

There are 25 modules, 25 tests, and 50 mix tasks.

You will find the implementations in lib/advent_of_code/ The tests are located in test/advent_of_code

Run mix test to run the tests with the public examples from the challenge. Run mix dXX.pY to run the challenge with the personal input:

# Run all available tests
mix test

# Run the first task of the first day, and the second task of the 14th day
mix d01.p1
mix d14.p2

You will need elixir and mix installed to run the examples, as well as having run mix deps.get in the root repository to fetch dependencies.

Make sure you have configured your session cookie to get your personal input, see below for more information

Optional Automatic Input Retriever

This starter comes with a module that will automatically get your inputs so you don't have to mess with copy/pasting. Don't worry, it automatically caches your inputs to your machine so you don't have to worry about slamming the Advent of Code server. You will need to configure it with your cookie and make sure to enable it. You can do this by creating a config/secrets.exs file containing the following:

import Config

config :advent_of_code, AdventOfCode.Input,
  allow_network?: true,
  session_cookie: "..." # yours will be longer

Get started coding with zero configuration

Using Visual Studio Code

  1. Install Docker Desktop
  2. Open project directory in VS Code
  3. Press F1, and select Remote-Containers: Reopen in Container...
  4. Wait a few minutes as it pulls image down and builds Dev Conatiner Docker image (this should only need to happen once unless you modify the Dockerfile)
    1. You can see progress of the build by clicking Starting Dev Container (show log): Building image that appears in bottom right corner
    2. During the build process it will also automatically run mix deps.get
  5. Once complete VS Code will connect your running Dev Container and will feel like your doing local development
  6. If you would like to use a specific version of Elixir change the VARIANT version in .devcontainer/devcontainer.json
  7. If you would like more information about VS Code Dev Containers check out the dev container documentation

Compatible with Github Codespaces

  1. If you dont have Github Codespaces beta access, sign up for the beta https://github.com/features/codespaces/signup
  2. On GitHub, navigate to the main page of the repository.
  3. Under the repository name, use the Code drop-down menu, and select Open with Codespaces.
  4. If you already have a codespace for the branch, click New codespace.

advent-of-code-2023's People

Contributors

ptitmouton avatar

Stargazers

David 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.