abstract class AdventDay(input) { abstract fun test(input: Something): Int }
so that Something is either List<String> or Sequence<String> or String? And you can decide in the implementation which one you choose?
k
Kevin Del Castillo
12/10/2022, 3:06 AM
You could define an
InputProvider
that receives a name of a file, and then has a function for each type of output you'd like to receive, that's what I'd do
j
Jonathan Kolberg
12/10/2022, 3:31 AM
I tried messing with delegates and creating a class that is both a list and a sequence of strings, that works, but you can not also claim to be a String, since String is final
m
maiatoday
12/10/2022, 6:55 AM
I have an interface with generics for the day, then intellij live template for the different kinds I might need on the day. Then a few basic test classes that can handle most of them. Utility functions to get the different input variants. But it is very custom to my template arrangement
m
mcbeelen
12/10/2022, 2:44 PM
I have a abstract class
AdventOfCodePuzzle
for that.
Also capable of loading the input from a file named