I didn't expect there to be another puzzle where w...
# advent-of-code
k
I didn't expect there to be another puzzle where we had to split on emptylines agian. I guess I should have made that
SplitOn{}
I was thinking about
a
I just used \n\n again 😄
b
I mean that's fast and you don't have to remember what you named your function
k
Yeah but I get my input as a list of strings
I guess I have a function that returns a string
But using
\n\n
wont work on windows, so idk
b
why do you get your input as a list of strings?
k
a
\r\n\r\n @Kroppeb
k
because I have a bunch of functions that parse the inputs
b
I have two helper functions textFile(filename) and linesFile(filename) that give me either the file as a full text, or lines
k
well my solution is shorter
b
you can probably tell intelliJ or whatever your editor is to use \n for line returns
so when you make the file you get \n
k
although i use curl to download my input
b
so you should have \n then
k
Lost about 30 points a year ago because intellij droped the ending whitespace
See i don't want to have to think about line endings
And split on might be useful for other things too
b
sure sure
I'm not a windows person so that's not something I really care about
but I should keep that in mind with windows users sending files around
a
good points
k
anyway, with reduce and splitOn, i now have a "oneliner" for each day
part 2 uses
*
instead
.e()
converts to a
List<Char>
b
oh I was going to ask
why do you need that?
k
you can't convert a string to a set
oh
ok, intellij was autocompleting too slow so i thought you couldn't
b
great I'm stealing your sumby
👆 1
never think about that one
j
Go with sequences my friends 🙂