https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
advent-of-code
  • l

    Luke Armitage

    12/07/2022, 3:29 PM
    don’t want to look at today’s 🧵 and have it spoiled, so i’m just gonna ask those who have finished it something in this 🧵 :
    c
    j
    +4
    • 7
    • 13
  • d

    Dan Fingal-Surma

    12/08/2022, 5:40 AM
    What a pain
    k
    x
    +32
    • 35
    • 90
  • m

    Monster Brain

    12/08/2022, 11:53 AM
    I'm currently using IntelliJ Idea - Edu version for doing the AOC. Most of my work mates are using Android studio by default and it would be a barrier for them to join AOC, by installing other IDE. I made a small project in Android Studio, with unit test configured to read input txt from resource folder. Hope it is helpful. (Any suggestions to make it better are welcome) https://github.com/monsterbrain/advent-of-code-android-studio-template
    e
    • 2
    • 2
  • k

    Ksenia Shneyveys

    12/08/2022, 2:00 PM
    🔥 Get ready for a very special Day 8 of Advent of Code! Kotlin Project Lead and competitive programming champion @elizarov will be joining us for today’s livestream. Let’s dive into Kotlin and solve the puzzle together. Don’t miss it!

    https://www.youtube.com/watch?v=6d6FXFh-UdA▾

  • a

    AbolfaZl RezaEi

    12/08/2022, 9:24 PM
    I just completed day 5, and I realized that day 5 input was one of the hardest inputs that you can have to parse and read in the challenges.. especially the column things in the beginning...🥴
    c
    f
    +2
    • 5
    • 5
  • m

    Marcin Wisniowski

    12/09/2022, 5:32 AM
    Part 1 (initial)
    m
    b
    +35
    • 38
    • 138
  • j

    Jakub Gwóźdź

    12/09/2022, 6:34 AM
    A question about example in day9: 🧵
    c
    r
    +6
    • 9
    • 20
  • k

    Ksenia Shneyveys

    12/09/2022, 1:28 PM
    🎄 Tune in to our today’s livestream with @ilya.gorbunov, one of the engineers working on Kotlin’s standard library, for a fun chat – and the solution to today’s puzzle, of course!

    https://youtu.be/ShU9dNUa_3g▾

  • a

    Alex LO

    12/09/2022, 4:12 PM
    👋 Hello, team!
  • j

    Jonathan Kolberg

    12/10/2022, 2:48 AM
    Is there a way to get something like this
    abstract class AdventDay(input) { abstract fun test(input: Something): Int }
    so that Something is either List<String> or Sequence<String> or String? And you can decide in the implementation which one you choose?
    k
    m
    m
    • 4
    • 4
  • d

    Dan Fingal-Surma

    12/10/2022, 5:15 AM
    Mutable state machine for me again 🤣
    s
    m
    +31
    • 34
    • 129
  • b

    Brian Hartvigsen

    12/10/2022, 7:57 AM
    Does everyone have super large monitors to take screenshots of their code windows with and I'm the only one typing away on a 15" laptop, or is there a plugin or something that generates pretty screenshots?
    m
    p
    +3
    • 6
    • 7
  • k

    Ksenia Shneyveys

    12/10/2022, 12:59 PM
    🎁 Get into the holiday spirit and join us for Advent of Code Day 10! Tune in now for a livestream hosted by the amazing @Sebastian Aigner, with special guest Nicole Terc!

    https://www.youtube.com/watch?v=KVyeNmFHoL4▾

  • m

    maiatoday

    12/10/2022, 2:13 PM
    Has anyone built any visualisations with Desktop Compose?
    o
    • 2
    • 2
  • n

    Neil Banman

    12/10/2022, 9:19 PM
    Can anyone who has implemented JMH or kotlinx.Benchmark answer a question for me? Documentation for kotlinx.Benchmark beyond the Readme seems to be nonexistent, and the Readme is out of date, incomplete, and assumes more knowledge of Gradle than I have. There don't seem to be any YouTube videos about it and discussion in the kotlinlang Slack is old and minimal. I tried to figure it out and finally got to the point where I could create an annotated Benchmark class without the linter screaming at me. And then... nothing. I have no idea how to actually run the benchmark! How do I do that?
    e
    • 2
    • 8
  • x

    xxfast

    12/11/2022, 5:41 AM
    That was easy thanks to kotlin's lambdas
    b
    m
    +42
    • 45
    • 149
  • d

    Danish Ansari

    12/11/2022, 7:53 AM
    So, I’m currently at day 5, can I just hardcord the inputs only for stacks? 😅 Parsing the input seems to be a nightmare 👻 Edit: I parsed it
    p
    x
    +2
    • 5
    • 8
  • k

    Ksenia Shneyveys

    12/11/2022, 1:19 PM
    ❄️ Day 11 of Advent of Code is here! Join us as we discuss the puzzle of the day with @Olaf Gottschalk.

    https://www.youtube.com/watch?v=1eBSyPe_9j0▾

    a
    a
    • 3
    • 3
  • k

    Kroppeb

    12/12/2022, 5:16 AM
    The fastest way to code part 2 with my utils, was to make it off by one (having it take a step from 'initial' to all possible first locations) but the path of part 2 was only 1 cell shorter than part 1 so they were giving the same value and I thought intellij was just bugged and running my part 1 code instead of part 2
    d
    r
    +22
    • 25
    • 117
  • k

    Ksenia Shneyveys

    12/12/2022, 12:25 PM
    ⭐ Join us for the final livestream of Advent of Code in Kotlin! Day 12 will be hosted by the wonderful @Sebastian Aigner, with guest @Dave Leeds, who creates cartoons about Kotlin. Don’t miss out on today’s fun at 5 pm UTC!

    https://www.youtube.com/watch?v=tJ74hi_3sk8▾

    e
    s
    +2
    • 5
    • 4
  • n

    nkiesel

    12/12/2022, 7:30 PM
    Tonight we will cross the 50% mark!
  • n

    Neil Banman

    12/12/2022, 7:41 PM
    Not mine, but I definitely relate: https://www.reddit.com/r/adventofcode/comments/zjwovn/so_youre_trying_to_get_onto_the_leaderboard_huh/
    s
    m
    • 3
    • 2
  • k

    Kroppeb

    12/13/2022, 5:12 AM
    mfw json
    s
    j
    +21
    • 24
    • 81
  • c

    Charles Flynn

    12/13/2022, 1:39 PM
    Think i’m misunderstanding a rule from today… 🧵
    e
    d
    • 3
    • 12
  • l

    Luke Armitage

    12/13/2022, 7:21 PM
    if i put my input for day 12 in a thread, can people take a look and tell me if i'm losing it? 🧵 to avoid spoilers
    j
    m
    +3
    • 6
    • 13
  • d

    David Whittaker

    12/14/2022, 5:25 AM
    Wow do I love Kotlin!
    k
    m
    +23
    • 26
    • 80
  • f

    Fredrik Rødland

    12/14/2022, 2:13 PM
    hm - the test set work for part 2, but not my input - any obvious low-hanging hints I probably have forgot? 🧵
    j
    • 2
    • 3
  • a

    Alyssa Burlton

    12/14/2022, 4:26 PM
    So I revisited Day 13 to commit some crimes against Kotlin today. I wondered what would happen if instead of parsing the input "properly" (which I did on the day, and took me far too long), I instead turned it into some Kotlin code with simple string replacements and then tried to dynamically load the result into the running process (like calling
    eval
    in Python). TL;DR is that it works, but it ain't pretty 😂 Details in 🧵
    r
    e
    r
    • 4
    • 9
  • p

    Paul Woitaschek

    12/14/2022, 10:30 PM
    Here comes today’s solution 😁
    Screen Recording 2022-12-14 at 23.28.02.mov
  • n

    nkiesel

    12/14/2022, 10:52 PM
    One Q related to day 13: was there ever a discussion of adding support for the spaceship operator <=> for compareTo in Kotlin?
    v
    e
    e
    • 4
    • 9
Powered by Linen
Title
n

nkiesel

12/14/2022, 10:52 PM
One Q related to day 13: was there ever a discussion of adding support for the spaceship operator <=> for compareTo in Kotlin?
v

Vampire

12/14/2022, 11:06 PM
Yes, just Google it
For example first result: https://discuss.kotlinlang.org/t/why-doesnt-kotlin-provide-a-spaceship-operator/322
n

nkiesel

12/14/2022, 11:07 PM
Searched in youtrack before asking, but yes, should have searched further. Sorry for the noise
v

Vampire

12/14/2022, 11:29 PM
Don't worry. 🙂
e

ephemient

12/15/2022, 1:13 AM
you can use
compareTo
as an infix function since Kotlin 1.6: https://youtrack.jetbrains.com/issue/KT-9730
n

nkiesel

12/17/2022, 5:00 AM
yeah, I did that. But I had some code for AoC which contain like 10 calls of compareTo in 25 lines, so thought that <=> would just make it a bit prettier
e

elizarov

12/17/2022, 6:32 AM
@nkiesel Something is clearly very non-optimal in your code. This kind of code would better be rewritten, new operators will not help here.
n

nkiesel

12/17/2022, 11:43 PM
Code is at https://github.com/nkiesel/AdventOfCode_2022/blob/main/src/test/kotlin/Day13.kt if you want to take a peek. And assuming we would not use the symbols for the override, I have 6 invocations. Most are because I call other compareTo in my compareTo implementations
and yes, my code is clearly non-optimal...
View count: 5