Skip to content

Commit d2f532e

Browse files
committed
Added more private.
1 parent 0e19610 commit d2f532e

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

src/main/kotlin/day05/day05.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import common.day
77
import common.collectionops.middle
88
import common.readInput
99

10-
typealias OrderingRules = Map<Int, Set<Int>>
11-
typealias Updates = List<Int>
10+
private typealias OrderingRules = Map<Int, Set<Int>>
11+
private typealias Updates = List<Int>
1212

1313
/**
1414
* Parse the violation rules into a map where:

src/main/kotlin/day06/day06.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import common.readInput
1313
/**
1414
* The direction that the guard is facing and moves in.
1515
*/
16-
enum class Direction(val delta: IntPos2D) {
16+
private enum class Direction(val delta: IntPos2D) {
1717
NORTH(IntPos2D(-1, 0)),
1818
SOUTH(IntPos2D(1, 0)),
1919
EAST(IntPos2D(0, 1)),
@@ -27,20 +27,20 @@ enum class Direction(val delta: IntPos2D) {
2727
}
2828
}
2929

30-
typealias Orientation = Pair<Direction, IntPos2D>
30+
private typealias Orientation = Pair<Direction, IntPos2D>
3131

32-
data class MapGrid(val rows: Int,
33-
val cols: Int,
34-
val boundaries: Set<IntPos2D>) {
32+
private data class MapGrid(val rows: Int,
33+
val cols: Int,
34+
val boundaries: Set<IntPos2D>) {
3535
fun isBoundary(point: IntPos2D): Boolean =
3636
point in boundaries
3737

3838
fun isInBounds(point: IntPos2D): Boolean =
3939
point.first in 0 until rows && point.second in 0 until cols
4040
}
4141

42-
data class Guard(val startPosition: IntPos2D,
43-
val map: MapGrid) {
42+
private data class Guard(val startPosition: IntPos2D,
43+
val map: MapGrid) {
4444
/**
4545
* Simulate the guard's path and return either:
4646
* 1. A set of visited points if it escapes.
@@ -75,7 +75,7 @@ data class Guard(val startPosition: IntPos2D,
7575
/**
7676
* Parse the input into a Guard and MapGrid.
7777
*/
78-
fun parse(input: String): Guard {
78+
private fun parse(input: String): Guard {
7979
var startPosition: IntPos2D? = null
8080
val barriers = mutableSetOf<IntPos2D>()
8181

src/main/kotlin/day08/day08.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import common.day
77
import common.intpos2d.*
88
import common.readInput
99

10-
typealias Frequency = Char
11-
typealias AntennaMap = Map<Frequency, Set<IntPos2D>>
10+
private typealias Frequency = Char
11+
private typealias AntennaMap = Map<Frequency, Set<IntPos2D>>
1212

13-
data class Grid(val height: Int, val width: Int, val antennae: AntennaMap) {
13+
private data class Grid(val height: Int, val width: Int, val antennae: AntennaMap) {
1414

1515
private fun inBounds(pos: IntPos2D): Boolean =
1616
pos.first in 0 until height && pos.second in 0 until width

src/test/kotlin/day08/day08.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
package day08
55

66
import org.junit.jupiter.api.Test
7-
import java.math.BigInteger
87
import kotlin.test.assertEquals
98

109
class Day08Test {

0 commit comments

Comments
 (0)