Skip to content

Praful/advent_of_code

Repository files navigation

Advent of Code

Update 2

I have 1.5 problems remaining for Aoc 2019. However, AoC 2021 has arrived. I'm doing this in Julia, which I know nothing about; I haven't even read a tutorial! My solutions for 2021, therefore, are the first bits of code I've ever written in Julia. Initially, they will probably look generically procedural but hopefully will become more idiomatic Julia as I learn the language.

Update 1

Having completed AoC 2020, I'm slowly working my way through AoC 2019. This repository has solutions to the 2020 programming challenges on Advent of Code.

Original

I'm learning Flutter and, therefore, Dart too. Dart is the programming language used to develop Flutter apps. Dart seems primarily to be a cross between Java, JavaScript and C#.

I recently came across the Advent of Code 2020. Attempting to solve the puzzles seemed a good way to learn a new programming language.

Sometimes the solutions seem verbose but I like to write code that you can read like prose and have some idea what's going on. Sometimes, I'm also trying to incorporate Dart features so that I can learn how to use them. For example, on Day 2, using named groups in the regular expressions was not necessary but it was good to learn their syntax. The regular expression itself follows JavaScript so there are plenty of examples on the web if you can't work out an expression.

Please feel free to suggest improvements, especially to make the code more Dart-like instead of the hybrid Java/JavaScript it tends to be whilst I learn Dart.

To run, go to directory advent_of_code/2020/src and run the day's program. For example, to run day 6's solution:

cd advent_of_code/2020/src
dart ./day06.dart

To enable assertions in dart:

dart --enable-asserts ./day06.dart

I wrote these on Windows 10 but Dart can run on Linux and macOS.

The story of my Advent of Code 2020 is on my blog.

About

Solutions to programming puzzles on Advent of Code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published