1
|
|
package com.adventofcode.day17 |
2
|
|
|
3
|
|
|
4
|
1
1. getValue : replaced char return with 0 for com/adventofcode/day17/Cube::getValue → NO_COVERAGE
|
data class Cube(val value: Char) { |
5
|
|
|
6
|
|
fun isActive(): Boolean { |
7
|
2
1. isActive : replaced boolean return with true for com/adventofcode/day17/Cube::isActive → KILLED
2. isActive : negated conditional → KILLED
|
return this.value == '#' |
8
|
|
} |
9
|
|
|
10
|
|
} |
11
|
|
|
12
|
|
class State(val cubes: Map<Triple<Int, Int, Int>, Cube>) { |
13
|
|
|
14
|
|
fun countActives(): Long { |
15
|
6
1. countActives : changed conditional boundary → SURVIVED
2. countActives : removed call to kotlin/collections/CollectionsKt::throwCountOverflow → NO_COVERAGE
3. countActives : Changed increment from 1 to -1 → KILLED
4. countActives : negated conditional → KILLED
5. countActives : negated conditional → KILLED
6. countActives : replaced long return with 0 for com/adventofcode/day17/State::countActives → KILLED
|
return cubes.values.count { it.isActive() }.toLong() |
16
|
|
} |
17
|
|
|
18
|
|
companion object { |
19
|
|
fun fromInput(vararg input: String): State { |
20
|
|
return State(input |
21
|
|
.mapIndexed { x, line -> |
22
|
|
line.toCharArray() |
23
|
|
.mapIndexed { y, state -> Triple(x, y, 0) to Cube(state) } |
24
|
|
} |
25
|
|
.flatten() |
26
|
|
.toMap()) |
27
|
|
} |
28
|
|
|
29
|
|
} |
30
|
|
|
31
|
|
} |
| | Mutations |
4 |
|
1.1 Location : getValue Killed by : none replaced char return with 0 for com/adventofcode/day17/Cube::getValue → NO_COVERAGE
|
7 |
|
1.1 Location : isActive Killed by : com.adventofcode.day17.StateTest.[engine:junit-jupiter]/[class:com.adventofcode.day17.StateTest]/[method:shouldCountActivesCubesInState()] replaced boolean return with true for com/adventofcode/day17/Cube::isActive → KILLED 2.2 Location : isActive Killed by : com.adventofcode.day17.StateTest.[engine:junit-jupiter]/[class:com.adventofcode.day17.StateTest]/[method:shouldCountActivesCubesInState()] negated conditional → KILLED
|
15 |
|
1.1 Location : countActives Killed by : none changed conditional boundary → SURVIVED 2.2 Location : countActives Killed by : com.adventofcode.day17.StateTest.[engine:junit-jupiter]/[class:com.adventofcode.day17.StateTest]/[method:shouldCountActivesCubesInState()] Changed increment from 1 to -1 → KILLED 3.3 Location : countActives Killed by : com.adventofcode.day17.StateTest.[engine:junit-jupiter]/[class:com.adventofcode.day17.StateTest]/[method:shouldCountActivesCubesInState()] negated conditional → KILLED 4.4 Location : countActives Killed by : com.adventofcode.day17.StateTest.[engine:junit-jupiter]/[class:com.adventofcode.day17.StateTest]/[method:shouldCountActivesCubesInState()] negated conditional → KILLED 5.5 Location : countActives Killed by : com.adventofcode.day17.StateTest.[engine:junit-jupiter]/[class:com.adventofcode.day17.StateTest]/[method:shouldCountActivesCubesInState()] replaced long return with 0 for com/adventofcode/day17/State::countActives → KILLED 6.6 Location : countActives Killed by : none removed call to kotlin/collections/CollectionsKt::throwCountOverflow → NO_COVERAGE
|
33 |
|
1.1 Location : countActives Killed by : none negated conditional → SURVIVED 2.2 Location : countActives Killed by : com.adventofcode.day17.StateTest.[engine:junit-jupiter]/[class:com.adventofcode.day17.StateTest]/[method:shouldCountActivesCubesInState()] negated conditional → KILLED
|
35 |
|
1.1 Location : fromInput Killed by : com.adventofcode.day17.StateTest.[engine:junit-jupiter]/[class:com.adventofcode.day17.StateTest]/[method:shouldCountActivesCubesInState()] changed conditional boundary → KILLED 2.2 Location : fromInput Killed by : com.adventofcode.day17.StateTest.[engine:junit-jupiter]/[class:com.adventofcode.day17.StateTest]/[method:shouldCountActivesCubesInState()] Changed increment from 1 to -1 → KILLED 3.3 Location : fromInput Killed by : com.adventofcode.day17.StateTest.[engine:junit-jupiter]/[class:com.adventofcode.day17.StateTest]/[method:shouldCountActivesCubesInState()] negated conditional → KILLED
|
36 |
|
1.1 Location : fromInput Killed by : none Changed increment from 1 to -1 → SURVIVED
|
39 |
|
1.1 Location : fromInput Killed by : com.adventofcode.day17.StateTest.[engine:junit-jupiter]/[class:com.adventofcode.day17.StateTest]/[method:shouldCountActivesCubesInState()] changed conditional boundary → KILLED 2.2 Location : fromInput Killed by : com.adventofcode.day17.StateTest.[engine:junit-jupiter]/[class:com.adventofcode.day17.StateTest]/[method:shouldCountActivesCubesInState()] Changed increment from 1 to -1 → KILLED 3.3 Location : fromInput Killed by : com.adventofcode.day17.StateTest.[engine:junit-jupiter]/[class:com.adventofcode.day17.StateTest]/[method:shouldCountActivesCubesInState()] negated conditional → KILLED
|
40 |
|
1.1 Location : fromInput Killed by : none Changed increment from 1 to -1 → SURVIVED
|