Giter Club home page Giter Club logo

adventofcode2018's Introduction

AdventOfCode2018 ๐Ÿ

Solutions to all 25 AoC 2018 problems in modern, type-annotated Python 3.10!

Finishing this year finally gave me the last stars of Advent of Code, I now have all 350 โญ I wanted to finish AoC off in Python to see what it would be like to maybe switch from Rust to Python for AoC 2022. I must say that using Python for AoC is a delight. Things are so simple, while still being really expressive. Unsurprisingly, you skip so much of the boilerplate compared to something like Rust. If I ever want to get a top 100 placing I will probably have to use Python.

I wanted to try the newest version of Python, 3.10, which finally adds pattern matching to Python. It was nice but I failed to find a usecase in these challenges beyond just strictly comparing values. Using such a recent version of Python was a bit annoying though, I could not get pip working and mypy does not support the new syntax yet.

Usage

# run a solution
python3 src/<DAY>.py

# run all solutions, and run static type checking on each
for DAY in src/*.py; do
  echo -e "\nRunning $DAY"
  python3 $DAY
  mypy $DAY
done

Note that at the time of writing mypy does not support 3.10 syntax, which means it fails on a lot of the days.

Other years

  • 2023 in Rust ๐Ÿฆ€
  • 2022 in Rust ๐Ÿฆ€
  • 2021 in Rust ๐Ÿฆ€
  • 2020 in Rust ๐Ÿฆ€
  • 2019 in Rust ๐Ÿฆ€
  • 2017 in Haskell ฮป
  • 2016 in OCaml ๐Ÿซ
  • 2015 in Clojure ฮป

endscreen

adventofcode2018's People

Contributors

axllind avatar

Stargazers

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