Giter Site home page Giter Site logo

advent-of-code-2023's Introduction

Multilingual Advent of Code 2023

Python C++

Advent of Code is a great opportunity to brush up on existing languages and learn some new ones!

Usage - Directory Structure - Extending Language Support

Usage

$ ./run.sh
usage: ./run.sh LANGUAGE DAY PART INPUT_TYPE

arguments:
  LANGUAGE     the programming language
  DAY          the day of a problem, day{01..25}
  PART         the part of a problem, part{1,2}
  INPUT_TYPE   type of input file
$ ./dev.sh
usage: ./dev.sh LANGUAGE

arguments:
  LANGUAGE     the programming language

Examples

Run the Python solution for part 1 of day 2's problem, using the sample-1.in input:

$ ./run.sh python day02 part1 sample-1

Open a development container for working on C++ solutions:

$ ./dev.sh cpp

Directory structure

File / Directory Description
data/dayXX/sample-1.in Sample input for part 1 of dayXX
data/dayXX/sample-2.in Sample input for part 2 of dayXX
data/dayXX/test.in Test input for dayXX
drivers/LANG Build context and solution for LANG
dev.sh Multilingual development container launcher
run.sh Multilingual solution dispatcher

Extending language support

# 1.
# Create a driver subdirectory for the new language.
$ mkdir drivers/golang

# 2.
# Implement a Dockerfile with a base image for the new language,
# and sets '/workarea' as the WORKDIR.
$ cat drivers/golang/Dockerfile

# 3.
# Create an executable 'run.sh' file that expects to be invoked with
# './run.sh day{01..25} part{1..2} sample|test'.
$ cat drivers/golang/run.sh

advent-of-code-2023's People

Contributors

ansonmiu0214 avatar

Watchers

 avatar

advent-of-code-2023's Issues

Support `test.sh` action with `sample.out`

Running

$ ./test.sh python day01 part2 sample

should delegate to some drivers/python/test.sh, which will:

  • use
    • the idiomatic unit testing framework/tooling/library
  • to verify that
    • the answer generated from running
      • the python solution
      • to part2
      • of theday01 problem
    • on the data/day02/sample.in input file
  • matches data/day02/sample.out.

GitHub Action to validate repo-wide things

  • data/dayXX: XX must be {01..25}
  • data/dayXX: must only contain {sample,test}.in
  • drivers/LANG: run.sh and Dockerfile exists
  • drivers/LANG: Dockerfile defines the correct volume mounts

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.