All Projects → encse → adventofcode

encse / adventofcode

Licence: other
🎄 Advent of Code (2015-2021) in C#

Programming Languages

C#
18002 projects
smalltalk
420 projects

Projects that are alternatives of or similar to adventofcode

adventofcode
Advent of Code solutions 2015-2021
Stars: ✭ 95 (-16.67%)
Mutual labels:  advent-of-code, advent-of-code-2016, advent-of-code-2015, advent-of-code-2017, advent-of-code-2018, advent-of-code-2019, advent-of-code-2020, advent-of-code-2021
adventofcode-solver
🎄 Advent of Code (2015-2021) in JavaScript
Stars: ✭ 16 (-85.96%)
Mutual labels:  advent-of-code, advent-of-code-2016, advent-of-code-2015, advent-of-code-2017, advent-of-code-2018, advent-of-code-2019, advent-of-code-2020, advent-of-code-2021
advent-of-code
My Advent of Code Solutions - 350/350 Stars
Stars: ✭ 30 (-73.68%)
Mutual labels:  advent-of-code, advent-of-code-2016, advent-of-code-2015, advent-of-code-2017, advent-of-code-2018, advent-of-code-2019, advent-of-code-2020, advent-of-code-2021
advent-of-code
My solutions for Advent of Code
Stars: ✭ 32 (-71.93%)
Mutual labels:  advent-of-code, advent-of-code-2016, advent-of-code-2015, advent-of-code-2017, advent-of-code-2018, advent-of-code-2019, advent-of-code-2020
AdventOfCode-Java
adventOfCode(Language.JAVA);
Stars: ✭ 15 (-86.84%)
Mutual labels:  advent-of-code, advent-of-code-2018, advent-of-code-2019, advent-of-code-2020, advent-of-code-2021
aoc2021
Advent of Code 2021 - my answers
Stars: ✭ 25 (-78.07%)
Mutual labels:  advent-of-code, advent-of-code-2021
awesome-adventjs
🎅🎄 A collection of awesome resources related to the adventJS challenge https://adventjs.dev by @midudev
Stars: ✭ 45 (-60.53%)
Mutual labels:  advent-of-code, advent-of-code-2021
aoc2017
Advent of Code 2017
Stars: ✭ 15 (-86.84%)
Mutual labels:  advent-of-code, advent-of-code-2017
advent2017
Advent of Code 2017 solutions
Stars: ✭ 28 (-75.44%)
Mutual labels:  advent-of-code, advent-of-code-2017
adventofcode-21
AdventOfCode 2021 solutions from the Devcord server
Stars: ✭ 12 (-89.47%)
Mutual labels:  advent-of-code, advent-of-code-2021
advent-of-code-2019
Advent of Code 2019 Submissions
Stars: ✭ 27 (-76.32%)
Mutual labels:  advent-of-code, advent-of-code-2019
adventofcode-2018
Advent of Code 2018
Stars: ✭ 28 (-75.44%)
Mutual labels:  advent-of-code, advent-of-code-2018
AoCHelper
Helper .NET library for solving Advent of Code puzzles
Stars: ✭ 22 (-80.7%)
Mutual labels:  advent-of-code, advent-of-code-2021
rust-advent
Learning Rust by solving advent of code challenges (Streaming live on Twitch every Monday)
Stars: ✭ 20 (-82.46%)
Mutual labels:  advent-of-code, advent-of-code-2020
advent-of-code-2020
🎅🌟❄️☃️🎄🎁
Stars: ✭ 98 (-14.04%)
Mutual labels:  advent-of-code, advent-of-code-2020
Advent-of-Code-2019
My solutions for Advent of Code 2019
Stars: ✭ 14 (-87.72%)
Mutual labels:  advent-of-code, advent-of-code-2019
advent-2020-kotlin
🎄 Advent of Code 2020: Solutions in Kotlin
Stars: ✭ 37 (-67.54%)
Mutual labels:  advent-of-code, advent-of-code-2020
advent-of-code-2021
🎄 My Advent of Code solutions in Rust. http://adventofcode.com/2021
Stars: ✭ 173 (+51.75%)
Mutual labels:  advent-of-code, advent-of-code-2021
coding challenge-24
Advent of Code 2019
Stars: ✭ 50 (-56.14%)
Mutual labels:  advent-of-code, advent-of-code-2019
aoc2018
Advent of Code 2018 - my answers
Stars: ✭ 13 (-88.6%)
Mutual labels:  advent-of-code, advent-of-code-2018

Advent of Code (2015-2021)

C# solutions to the Advent of Code problems. Check out https://adventofcode.com.

The goal is to keep my C# knowledge fresh and to follow the latest changes of the language.

Everything is self contained. I don't use any libraries to make things short or predefined algorithms to parameterize. Just stick to what .Net provides. Each problem is solved by plain C# classes without any 'base' to derive from. The solvers have different entry points for part 1 and 2. There is no local state, part 2 starts from scratch, but code sharing between part 1 and 2 is important to me. (Unless it makes things hard to read.)

I prefer to use functional style, local or anonymous functions, immutability and linq over the state manipulation style of oop, but I'm not very strict about this. Whatever I see fit for the problem.

One thing that you will not see much in C# projects is K&R indentation. Sorry about that...

The way I solve the puzzles should be pretty consistent during an event but there are small changes over the years as I find something new or forget about stuff I learned last year.

I try to keep things tight and golf the solution to a certain level, but don't want to overgolf it. (Sometimes I fail.)

There aren't many comments, but if I find that the solution is not straightforward, the algorithm has a name, or it is using some special property of the input I might explain it in a line or two.

You can browse my solutions as they are or fork the repo, remove everything and use just the lib part to start working on your own. The framework part is pretty stable and you get testing, scaffolding etc for free.

Dependencies

  • This project is based on .NET 6 and C# 10. It should work on Windows, Linux and OS-X.
  • AngleSharp is used for problem download.

Running

To run the project:

  1. Install .NET Core
  2. Clone the repo
  3. Get help with dotnet run

Usage: dotnet run [arguments]
1) To run the solutions and admire your advent calendar:

 [year]/[day|all]      Solve the specified problems
 today                 Shortcut to the above
 [year]                Solve the whole year
 all                   Solve everything

 calendars             Show the calendars

2) To start working on new problems:
login to https://adventofcode.com, then copy your session cookie, and export 
it in your console like this

 export SESSION=73a37e9a72a...

then run the app with

 update [year]/[day]   Prepares a folder for the given day, updates the input,
                       the readme and creates a solution template.
 update today          Shortcut to the above.

3) To upload your answer:
set up your SESSION variable as above.

 upload [year]/[day]   Upload the answer for the selected year and day.
 upload today          Shortcut to the above.


Working in Visual Studio Code

If you prefer, you can work directly in VSCode as well.

Open the command Palette (⇧ ⌘ P), select Tasks: Run Task then e.g. update today.

Work on part 1. Check the solution with the upload today task. Continue with part 2.

Note: this feature relies on the "Memento Inputs" extension to store your session cookie, you need to set it up in advance from the Command Palette with Install Extensions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].