Problem

abstract class Problem[A](val year: Int, val day: Int, val part: Int)(val example: Example[A]) extends App

An abstract class for solving a problem from Advent of Code.

Value parameters:
day

the day of the year the problem is from

expectedExampleSolution

the expected solution for the example input

year

the year the problem is from

trait App
trait DelayedInit
class Object
trait Matchable
class Any

Value members

Abstract methods

def name: String
def solve(data: List[String]): A

Concrete methods

def execute(implicit printResult: Boolean): Option[TimedEval[A]]

Attempts to solve the given problem using the given data.

Attempts to solve the given problem using the given data.

Value parameters:
printResult

Given boolean that decides whether to print the result or not. Defaults to true.

Returns:

The solution (if it was found), along with the time it took to solve it, or None if no solution was found or if the test case didn't pass, given that an example was provided.

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Returns:

a string representation of the object.

Definition Classes
Any

Inherited methods

final protected def args: Array[String]
Inherited from:
App
final def main(args: Array[String]): Unit
Inherited from:
App

Deprecated and Inherited methods

override def delayedInit(body: => Unit): Unit
Deprecated
[Since version 2.11.0] the delayedInit mechanism will disappear
Definition Classes
App -> DelayedInit
Inherited from:
App

Concrete fields

val day: Int
val part: Int
val result: Option[TimedEval[A]]
val year: Int