Git Product home page Git Product logo

advent-of-code-2015's Introduction

Advent of Code 2015

This project contains my solutions for the Advent of Code 2015 in Kotlin. Advent of Code is an Advent calendar of small programming puzzles by Eric Wastl.

Solutions

Features

  • Gradle setup so you can run a specific day or all days on the command line (see Running)
  • Timings for each part of each day
  • Input for each day automatically exposed in String and List form
  • Junit 5 and AssertJ test libraries included (see ** Testing**)
  • Starter .gitignore

Running

Project is already setup with gradle. To run the app:

  • Navigate to top-level directory on the command line
  • Run ./gradlew run to run all days
  • Run ./gradlew run --args $DAY where $DAY is an integer to run a specific day
  • Run ./gradlew run --args "$DAY1 $DAY2 $ANOTHERDAY" to run a subset of days

Testing

Project includes JUnit and AssertJ and a stub unit test to get you going. To run all tests:

  • Navigate to top-level directory on the command line
  • Run ./gradlew test
  • Add --info, --debug or --stacktrace flags for more output

By default, instantiations of Day classes in tests will use the input files in src/test/resources, not those in src/main/resources. This hopefully gives you flexibility - you could either just copy the real input into src/test/resources if you want to test the actual answers, or you could add a file of test data based on the examples given on the Advent of Code description for the day. The stub Day1Test class shows a test of the functionality of Day1 where the test input differs from the actual input.

Architecture

  • Inputs go into src/main/resources and follow the naming convention input_day_X.txt
  • Solutions go into src/main/kotlin/days and implement the Puzzle interface
  • Solutions follow the naming convention DayX
  • It is assumed all solutions will have two parts
  • It is assumed that the puzzle input is provided through the primary constructor
  • You can use the InputReader methods for reading input
  • To get started simply replace src/main/resources/input_day_1.txt with the real input and the solutions in Day1 with your own

advent-of-code-2015's People

Contributors

andilau avatar dependabot[bot] avatar

Watchers

 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.