File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/main/kotlin/com/soberg/aoc/utlities/datastructures Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ data class Grid2D<T>(
2121
2222 infix operator fun get (location : Location ): T = grid[location.row][location.col]
2323
24+ operator fun get (row : Int , col : Int ): T = grid[row][col]
25+
2426 /* * @return true if the specified [location] is in the bounds of this grid, false if not. */
2527 fun isInBounds (location : Location ): Boolean = isInBounds(location.row, location.col)
2628
@@ -127,4 +129,4 @@ fun <T> List<List<T>>.toGrid2D() = Grid2D(this)
127129/* * Converts the common AoC input (List of lines (as String) from input file). */
128130inline fun <T > List<String>.toGrid2D (convertLine : (String ) -> List <T >) = map { line ->
129131 convertLine(line)
130- }.toGrid2D()
132+ }.toGrid2D()
You can’t perform that action at this time.
0 commit comments