Problem

abstract class Problem[A](val day: Int, val year: Int)(val part: Int)(val exampleSolution: ExampleSolution[A], val i: Int) extends App with ProblemOps[A]

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

Value parameters:
day

the day of the year the problem is from

exampleSolution

the expected solution for the example input

i

what example file input to use, defaults to 1

part

one or two

year

the year the problem is from

trait ProblemOps[A]
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: Option[TimedEval[A]]

Attempts to solve the given problem using the given data.

Attempts to solve the given problem using the given data.

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
protected def error(msg: String, trim: Boolean): String
Inherited from:
ProblemOps
protected def info(msg: String): String
Inherited from:
ProblemOps
final def main(args: Array[String]): Unit
Inherited from:
App
protected def readFile(folder: String, year: Int, file: String): Option[List[String]]
Inherited from:
ProblemOps
protected def solvingError(name: String, exception: Throwable): Option[TimedEval[A]]
Inherited from:
ProblemOps
protected def solvingFail(name: String, eval: TimedEval[A]): Option[TimedEval[A]]
Inherited from:
ProblemOps
protected def solvingSuccess(name: String, eval: TimedEval[A]): Option[TimedEval[A]]
Inherited from:
ProblemOps
protected def success(msg: String): String
Inherited from:
ProblemOps
protected def tinyStack(e: Throwable): String
Inherited from:
ProblemOps

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 i: Int
val part: Int
val result: Option[TimedEval[A]]
val year: Int