Is there any good solution for running this on wor...
# advent-of-code
m
Is there any good solution for running this on worksheet mode? Perhaps just copy the
part1
/
part2
methods and import
Utils.kt
?
m
What is worksheet mode, what are part1/part2 methods, and which Utils.kt? I guess you meant to post this somewhere else 🙂
m
Worksheet mode is an Intellij feature that evaluates statements / results continuously
The part1/part2/utils are provided on the official jetbrains advent of code template.
m
Ah, thanks for the explanation. I’ve never heard of worksheet mode, a quick google search suggests that it’s a Scala thing. Not using the template. It’s surely great, but I already have one repo for all the seasons and multiple languages, I do not have the time to upgrade it now. 🙂
b
You mean ij scratch files?
m
I guess worksheets and scratches are a similar thing: https://www.jetbrains.com/help/idea/kotlin-repl.html#scratches-and-worksheets
b
Ah, worksheets are in beta (i.e. new). Explains why ai haven't heard of them 😀
Thanks for the link
m
For me, a worksheet is a file with a special filetype
ws.kts
that gets run / continuosly evaluated. It’s great for iterative coding, pretty common to work this way in clojure / scala.
n
I had never heard of them before. They seem to work fine with my current repository. Just create a new worksheet, IJ handles the one gradle config, and I'm off.
m
Yeah, I think the worksheets/scratches don’t like to have something reading the filesystem (the
.txt
files with the test input or the input given to you by the puzzle), on interactive mode. That is the only thing not working. I’m just fine creating a
listOf("A X", "B Y")
etc for the puzzle, and I’ll deal with sanitising the input on the main program
(perhaps none of what I wrote makes sense for you if you’re not using the kotlin advent of code template, apologies in this case for the spam)