Coder Social home page Coder Social logo

aoc-2022's Introduction

Bob's Advent of Code 2022

It's Advent of Code time again! I probably won't document every day like I did last year, but may write up some stuff as I get into the chunkier puzzles.

Everything is in C# again this year. I have no intention of keeping up with this every day, but may try to at least beat all the puzzles... eventually.

Day 4

This one, for me, is notable mostly because it gave me an excuse to play with generic math to create a Range<T> type that can theoretically be used for different numeric types. I'm not 100% sure what I'm doing there, but it works for integers, so far. Also, I'm kind of abusing records here as a lazy way of destructuring what is effectively a list of values, since C# does not have array destructuring built-in. It had the added bonus of giving me the ability to apply a transformation to my soon-to-be-destructured values.

Day 8

I think I write a basic Grid and Vector class every year. I suppose I could've used last year's implementation, but each time I write it gets... maybe not better, but different. Last year I really couldn't decide if my Grid API should take an x and y value, or a Point, or a Vector, or whatever. I had a lot of different ways of representing "two values". This year I think I'll mostly stick to my own Vector2<T> class. Re-inventing the wheel here, but it's all for fun. In retrospect, my Range type could probably have just been a Vector2<T> as well. Maybe I'll refactor at some point.

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.