paulovap / Advent-Of-Code-Polyglot

Examples of "Advent Of Code" solutions in many programming languages.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Advent of Code

For the uninitiated, Advent of Code is a series of programming challenges, a new one is released each day until Dec. 25th.

Each challenge requires thinking in a different way to solve it, and for this reason I love to use these sorts of problems to learn how different programming languages idiomatically approach each solution. You'll notice that in any given situation, the idiomatic Python way of solving something will be very different from the Haskell or Lisp way of doing things.

So let's collect code samples from as many languages as we can to see how things are done!

Guidelines

  • If you have solutions to contribute in a language, please submit them in a pull-request and I'll get to them as soon as I can.
  • Please don't include your problem's 'input.txt' or solution, as these are different for each person.
  • Please put each solution (including part 1 and part 2) into separate files (even if there's a bit of code duplication) it makes it easier to figure out what's going on.
  • Please try to write clean code solutions in your language of choice, and remember that this is about seeing different ways that languages approach things, so if a particular language feature or idiom applies nicely to the situation, make sure to include it!
  • The goal of this is to be easy to read, so include comments and avoid using multiple files and using complicated build steps unless necessary.
  • I'm not an expert, so if you see improvements that could be made to a solution in the repository, feel free to submit a pull request to clean it up, but keep in mind that if it's a trivial difference, or is simply personal preference, it may be ignored.
  • In pull requests please follow the established pattern:
  • language-name/day-num/part#.extension
  • How will we decide what the optimal solution is?
  • For now I'm just accepting solutions as they come in, if someone can demonstrate that their solution is either more idiomatic to the language or is significantly cleaner, then we'll switch it in. Keep in mind that it's about seeing how idioms differ amongst different languages, not necessarily about getting the most optimal solution. Let's not get competitive about it.

Have fun!!

About

Examples of "Advent Of Code" solutions in many programming languages.


Languages

Language:C 15.3%Language:Erlang 14.7%Language:PHP 14.1%Language:Haskell 12.9%Language:Perl 9.1%Language:Python 8.8%Language:C# 4.9%Language:Rust 4.6%Language:Elixir 3.9%Language:Java 3.3%Language:Scala 3.2%Language:Go 3.0%Language:Ruby 1.6%Language:Awk 0.5%