Giter Site home page Giter Site logo

tomplum / advent-of-code-2019 Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 1.27 MB

:gift: My completion of Advent of Code 2019 in an enterprise-style codebase with an emphasis on design, readability and testing.

Home Page: https://adventofcode.com/2019

License: Apache License 2.0

Kotlin 99.54% Java 0.46%
advent-of-code-2019 gradle java jmh-benchmarks junit5 kotlin kotlin-gradle-dsl

advent-of-code-2019's Introduction

๐Ÿ”ญ Iโ€™m currently working on Advent of Code 2023 in Kotlin.

๐Ÿ‡ฏ๐Ÿ‡ต Iโ€™m also working on Nyusu, a small personal project for practing your Japanese reading skills via news articles and headlines.

๐Ÿ“— I'm currently reading Head First Design Patterns by Eric Freeman & Elisabeth Robson.

advent-of-code-2019's People

Contributors

tomplum avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

mutkan

advent-of-code-2019's Issues

Abstract Common 'Map' Implementations

Classes such as AsteroidMap, ScaffoldMap and ShipFloorMap all have common code that can abstracted into an abstract class.

The toString() implementation is the same as they all have an internal data structure of Map<Point2D, SomeDomainObject>. Generic typing can be used here for the value data type.

Future README Additions

  • Favourite days (Technically / Most Fun)
  • Most Challenging Day (18 as of this)
  • Maybe add any interesting visualisations
  • If you create custom JUnit arg provider annotations, add them to the JUnit5/AssertK Section

Also add things learned;

  • Design Patterns w/list of them

  • Algorithms: Graphing, Pathing, Searching

  • Performance related stuff

  • Functional Programming (Kotlin) Stuff incl. extension functions

  • Maybe add what you prefer in Kotlin over Java?

  • Section on Intcode Computer. Mention its progression over the event

  • DeteKT Static Code Analyser

Introduce Extension Functions

Some functions would benefit from being transformed into extension function of their parameter types.

Example: Formulae could have its lcm function turned into an extension function of List<Long>.

Day 19 (Part 2) - Performance Improvement

Currently implemented lazy scanning the DroneSystem so that it scans for the beam 1 block at a time. It also stops scanning in the x-direction once its reached the end of the beam.

TractorBeamScan now also searches the current and the last block in-case Santas ship area overlaps two blocks. This saves having to scan 1 block, then 2, then 3... now it only does 1, then 2, then 2 and just 2 forever.

Solution currently taking ~13s to run with logging turned off.

Fix Logging Implementation

Replace all println() statements in :implementation with debug() or info() logs. Then maybe introduce profiles to be able to toggle them on off. Will speed up unit tests.

This is having a big impact on the IntCodeComputers System IO. It's logging the I/O every time compute() is called.

Test Support Module

Maybe a new gradle module that the implementation:test src set depends on.

The InputReader could have its functions removed that take strings and just leave the ones with Days in.
A FakeInputReader or something of the sorts could be added for use in test scope.

The same goes for the ExampleMap and ExampleTile objects nested in the AdventMap2DTest. These can be pulled out into their own Fake or Dummy implementations.

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.