We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7378ce6 commit 07562d0Copy full SHA for 07562d0
src/main/kotlin/com/soberg/aoc/utlities/datastructures/Grid2D.kt
@@ -21,6 +21,8 @@ data class Grid2D<T>(
21
22
infix operator fun get(location: Location): T = grid[location.row][location.col]
23
24
+ fun get(row: Int, col: Int): T = grid[row][col]
25
+
26
/** @return true if the specified [location] is in the bounds of this grid, false if not. */
27
fun isInBounds(location: Location): Boolean = isInBounds(location.row, location.col)
28
@@ -92,4 +94,4 @@ data class Grid2D<T>(
92
94
}
93
95
96
-fun <T> List<List<T>>.toGrid2D() = Grid2D(this)
97
+fun <T> List<List<T>>.toGrid2D() = Grid2D(this)
0 commit comments