Neil Banman
12/12/2023, 12:51 AMGrid
class and made it quite powerful and flexible. But this year I've really been enjoying using the input String
directly as a virtual 2-D grid. You just need to track the width, after that, you can move around in any direction. The line breaks delineate the left and right sides of (almost) every row. Top and bottom are handled by using getOrNull
. This also handles left of 0 and right of lastIndex
.
Does anyone else prefer working with a 1-D String rather than lines()
or List<List<E>>
?ephemient
12/12/2023, 4:17 AMbj0
12/12/2023, 4:33 AMMap
of coordinate to content.Neil Banman
12/12/2023, 4:52 AMNeil Banman
12/12/2023, 4:57 AMbj0
12/12/2023, 4:59 AMNeil Banman
12/12/2023, 5:00 AMNeil Banman
12/12/2023, 5:14 AMephemient
12/12/2023, 11:44 AMKroppeb
12/12/2023, 1:26 PMAnd maybe that one that had teleporters on the outside that matched up with ones on the inside. Can’t remember if that one had consistent spacing.It had extra spacing on the end yes. I know that very well cause I was relying on it, but IntelliJ was stripping the spaces at the end when I pasted them into the file, giving me the weirdest errors that took me way to long to figure out
Kroppeb
12/12/2023, 1:26 PM