@@ -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
0 commit comments