- Alarm problems
- Have someone call me to check if I have woken up
- Made a dumb typo which took long to find
I decided to switch to Kotlin as I felt that Kotlin would be more powerful.
I went with making the solutions in Kotlin Worksheets mostly to get rid of the fun main(){}
overhead and easy display of intermediate results
- Used input of day 1
- Make a file for the next day in advance with some imports and a start.
- Worksheet doesn't display exceptions
- Noticed debugger freezes if a function outside the worksheet is called
- Have a secondary file
help.kt
to temporary copy parts of the code into
- Have a secondary file
Also made a tentative IntComputer
- Input was csv style
- Make csv (comma (
,
) separated values), ssv (semicolon (;
) separated values) and wsv (whitespace/\s/
separated values)
- Make csv (comma (
- An integer-string had a
\r
at the end- Make
String.getInt()
,String.getInts()
and similar extension functions
- Make
- Worksheets failed to execute
map
andsumBy
properly in some cases?- => Make all future solutions in normal Kotlin code
- Didn't read problem statement well enough
- => Listen to my gut when it says "huh, that's weird" instead of of just assuming it's a design decision to keep the questions easy
- Struggled a bit too much with set (and map) operations
- Make helper functions
- Make operator overloading for sets and maps
- Imports for
abs
don't listabs(Int)
.- => Pick
abs(Double)
inkotlin.Math
. This will pick the right overload anyway - Add
import kotlin.Math
to the template
- => Pick
*[x] 2D point operations (Point = Pair<Int,Int>
)
*[x] RDLU
to point
*[x] Distance calculators
*[x] Iterable<Point<T>>.getClosest()
and similar
*[x] Make an RLE encoder and decode
*[x] FoldMap: map but with previous value/folding value
* This would allow the input to be RLE decode and then foldmaped with the +
operator to give all points
* Realized this is scan
so renamed
No looking up, just gut timing but question is too easy to really get results.
Looked up some timings to verify it would be a bit of a harder problem.
Initially I felt like I was gonna need topoSort but wasn't needed
- Missed the
,
's in the input *[x] add agetAlphaNum()
and similar *[x] maybe addgetIntsLines() = getLines().map{it.getInts()}
and similar - Forgot to call the recursive formula .. (OOF)
- Thought I couldn't use groupBy so for part 2 I even wrote a regex to grab continuous chunks of numbers and then test if any had length 2
- I could cause the input would also need to sorted.
*[x] Add a
blocks
method *[x] addisSorted
*[x] add convolutions =>zipWithNext
and windowed exists
- I could cause the input would also need to sorted.
*[x] Add a
- Need more sleep
- Mental error about
scan
when trying to extract modes- make a scan that updates state and returns separately
- "No i dOnT ThInK I NeEd aN ErRoR If iM TrYiNg tO OvErRiDe aN OpCoDe"
- add an error
- Use typealiases in tentative things.
- Graphs
- Run functions twice, first on test, then on actual data. Should show off by one errors faster
- Add associateIndex
- getPermutations
- make the IntComputer io and yield more clean
- quick input naming
- Forgot reduce existed
- List.printLines maybe? errr .map{println(it)} is quite good
- Grids...
- Point steps
- GGD and similar
- Clean the template and make the functions runblocking by default
- Grids
- directional points
- list of points to Bounds
- Bound iteration
- text printer
- mod int (used for dirs) (how will this be used?)
-
Clock()
- Unused
==
is hardly visible
- Shouldn't have used multiple threads, just ignore player input.
- Should have used a conflated channel and send updates each change in ball and paddle pos.
- grids
- better display for grids?
-
clock()
- Int division rounds to 0, not down. WTF
- binary search thingies
- Maybe start using Long as default
- NICE
- maybe even more clock functionality
- a way to convert from point to neighbour id and back
- list of char/char array to string is hard
- for part 2 i think I got a more difficult input.
- Maze simplifiers
- Path algos
- So IntelliJ just removed y trailing spaces, which were kinda needed. lost 5 minutes and 17 points due to that. Something to remember for next time
- StrictEntityGrid gives me a bounds. I should have used that...
- PathFinding algorithms could be useful
- Make Point an actual class
- Convolutions, forEach(unordered/Ordered)Pair/
- Some fancy lists
- cyclic list
- bi list (list for pos and neg indexes)
- py list? (wrapper? that allows neg index to count from back, like cyclic)
- default list
- Grids
- a lot of freedom wanted yet many quick build-ins. Maybe builder?
- (quad)grid
- door grid
- gated-grid = grid + doors
- hex-grid
- triangle grid
- Path calculation
- closest, furthest
- 3d grids?
- sum query?
- max query
- binOp query
- Graphs (and grids are graphs)
- BracketStack
- Bounds
- (stepped) Toposort
- eventqueue
- ticking game system // for turnbased combat or similar
- add a lot of
...Indexed()
- sequences
- python itertools ish
- pure intcomputer