Giter VIP home page Giter VIP logo

adventofcode2022's Introduction

AdventOfCode2022

My attempt at the Advent of Code 2022.

CI

Credits

Puzzles, Code, & Design of AdventOfCodes : Eric Wastl

Advent of Code template based on AoCHelper project.

It allows you to focus on solving AoC puzzles while providing you with some performance stats.

Problem example:

using AoCHelper;
using System.Threading.Tasks;

namespace AdventOfCode;

public class Day_01 : BaseDay
{
    public override ValueTask<string> Solve_1() => new("Solution 1");

    public override ValueTask<string> Solve_2() => new("Solution 2");
}

Output example:

aochelper

Basic usage

  • Create one class per advent day, following DayXX or Day_XX naming convention and implementing AoCHelper.BaseDay.
  • Place input files under Inputs/ dir, following XX.txt convention.
  • Read the input content from InputFilePath and solve the puzzle by implementing Solve_1() and Solve_2()!

By default, only your last problem will be solved when running the project. You can change that by behavior by modifying Program.cs.

Invoking different methods:

  • Solver.SolveAll(); → solves all the days.

  • Solver.SolveLast(); → solves only the last day.

  • Solver.Solve<Day_XX>(); → solves only day XX.

  • Solver.Solve(new uint[] { XX, YY }); → solves only days XX and YY.

  • Solver.Solve(new [] { typeof(Day_XX), typeof(Day_YY) }); → same as above.

Providing a custom Action<SolverConfiguration> to any of those methods (availabe options described here):

  • Solver.SolveLast(opt => opt.ClearConsole = false); → solves only the last day providing a custom configuration.

  • Solver.SolveAll(opt =>
    {
        opt.ShowConstructorElapsedTime = true;
        opt.ShowTotalElapsedTimePerDay = true;
        opt.ElapsedTimeFormatSpecifier = "F3";
    });

    solves all the days providing a custom configuration.

Advanced usage

Check AoCHelper README file for detailed information about how to override the default file naming and location conventions of your problem classes and input files.

adventofcode2022's People

Contributors

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