#advent of code 2025

1 messages · Page 1 of 1 (latest)

terse edge
#

@native maple @verbal parrot @dusky frost @quartz aurora

#

@whoever else

verbal parrot
#

i hope i won’t quit this year’s aoc after day six fr

terse edge
#

u wont

#

i wont let u

native maple
#

i forgot i still cant talk in programmning

native maple
#

im like very busy tomorrow i probably wont do it as soon as it comes out

cloud iron
dusky frost
#

thx

cloud girderBOT
verbal parrot
#

typescript is this way —> ts

feral valve
#

i think i want to do it in ocaml this year

quartz aurora
#

I'm just gonna do golf python again, if I have time

cloud iron
#

I did code it in pure browser javascript

dusky frost
#

I'll probably start on wednesday since I'm in poland

pale stirrup
#

im doing kotlin but no java stdlib

frigid socket
#

AI ✨ of code

#

i forgot about AOC

#

i’ll do a language a day but only good languages

#

@native maple for a day i should do it in Apple Shortcuts for the laugh

fallen lily
#

@terse edge @native maple @frigid socket c++ or c#

#

not sure which lang i want to use yet

pale stirrup
#

use the one you're less familiar with

fallen lily
pale stirrup
#

advent of code 2025

fallen lily
#

anyone made a leaderboard yet

pale stirrup
#

leaderboards carry over

terse edge
#

@native maple iM gonna use kotlin

#

I spent all my time working on actual projects that arent icy or a rust aoc framework

pale stirrup
#

soon

#

it approacheth

verbal parrot
brazen salmon
#

@native maple

terse edge
#

just kotlin

#

Maybe i will solve it in random lang after kotlin

#

but prob not

verbal parrot
terse edge
brazen salmon
#

@native maple

verbal parrot
#

i have c in my list i hope i wont get it fr

terse edge
#

lol

brazen salmon
#

advent of faint

terse edge
#

I just some random high schools lb

#

none of them completed 2024

pale stirrup
#

T-1:00

terse edge
#

woo

#

30s to wait 😭

#

i used a really stupid method for p2 at first

molten bolt
#

Meow

terse edge
#

oh its wrong

verbal parrot
#

WHAT

Gleam doesn't have loops

fallen lily
verbal parrot
fallen lily
fallen lily
#

I have a years worth of util classes already

rugged kiln
#

Ive "done" last year in kotlin

#

Quite comfortable working with it

rugged kiln
#

Even though im not doing this year, i hope 2/3 of the days wont be grid-based

terse edge
#

dude wtf is this

#

why can i not solve p2

fallen lily
#

Why husk

#

Can't start with number

terse edge
#

now i wait 5 mins

fallen lily
#

How would you tell the difference between 2l long literal and 2l identifier

terse edge
#

5 mins COOLDOWN AGAIN

#

AAAA

#

its so over

#

i think I know what the issue was

#

and its really stupid

#

and not my fault

#

totally

#

If this is gonna be wrong im gonna crash out

#

noT enough

#

i thought this means ||"be careful not to count the 0 multiple times when rotation > 100"||

#

ok good to kown part 2 took everyone 40 minutes

verbal parrot
#

i’ve been trying to solve it in gleam for the last hour why is ts so hard 😭

#

what if i just do it in python and then rewrite in gleam fr

terse edge
verbal parrot
terse edge
#

can i solve this in untyped lambda calculus

#

yes

verbal parrot
#

i did it in python and it works with the example but not with the actual numbers 💔

pale stirrup
#

got p1 in seconds and took forever on p2

terse edge
#

fuck intellIj

#

ok im like really far behind on all the lbs now 😭

pale stirrup
#

thats p2

verbal parrot
#

oh okay

#

i solved it yay

#

turns out for some reason the text i pasted was trimmed out 😭😭😭

native maple
#

done in elle
||```rs
use std/prelude;

fn solve(string[] lines, bool p2) {
pos := 50;
hits := 0;

for line in lines {
    if line.is_empty() { continue; }

    way := line[0];
    step := i32::parse(line += #cast(string, 1));

    for _ in 0..(p2 ? step : 1) {
        pos = (pos + (way == 'L' ? -1 : 1) * (p2 ? 1 : step)) % 100;

        if pos == 0 {
            hits += 1;
        }
    }
}

return hits;

}

fn main(string[] args) {
lines := io::read_to_string(args[1]).split("\n");
$dbg(solve(lines, false));
$dbg(solve(lines, true));
}

#

@terse edge whats ur solution

pale stirrup
#

what's the empty line detection for

native maple
#

my ide automatically inserts a newline at the end of the file when i save any file (if there isnt one already) and i cant turn that off

pale stirrup
#

guh

native maple
#

oh it still works without the check

#

curious

#

i lied

#

i can turn it off

#

awesome

#

yeah code style consistency

#

@terse edge is that the vercel logo 😭

#

I BEAT EAGELY IN DELTA TIME

brazen salmon
native maple
#

i set it to rust syntax highlighting

brazen salmon
#

oh

terse edge
#

not original sol

#

i did +/- diff for p1, tried that for p2, realized i misunderstood the task and dId the +1 loop

terse edge
#

havent changed the favicon

terse edge
native maple
#

doing it in elle is surprisingly easy lol

terse edge
#

its a modulo correcting for negative numbers

native maple
#

feels just like python just a little more ass to work with strings

terse edge
#

@native maple aoc will unlock at 10 for me

#

after dec 7

brazen salmon
#

-# rosiepie

native maple
#

it unlocks at 5am for me still

terse edge
#

cause ill be In utc + 5

#

until jan 4

native maple
#

insane

#

why did you take so long on p2

native maple
terse edge
#

I vibecoded p1 and the ai failed to do p2

terse edge
#

probably if i read the entire text i would realize what was asked

#

will do that tomorrow

native maple
#

probably if you dont vibecode it you can get a decent time lol

terse edge
#

i was joking

native maple
#

so was i smh

terse edge
frigid socket
#

Ban Eageler

terse edge
#

p2 took a while for a lot of ppl

terse edge
native maple
#

i did both parts in like 20 mins i think?

terse edge
#

you read the task fully im guessing

#

cause u werent in a rush

native maple
#

yeah because im working in elle

terse edge
#

i read count every 0 pass and assumed it meant "count all the rotations that will cause at least one 0 pass"

native maple
#

there could totally be a random thing that completely throws me off and it just doesnt work or it takes 5 years to solve or segfaults or all of the above

#

so i have no reason to go fast

frigid socket
#

is it just me that cant login with gh

#

to AOC

#

failed to authenticate. (access_token request returned 429 Too Many Requests)

native maple
#

worked fine for me

frigid socket
#

insane

#

ill just use reddit oauth

vague knoll
#

going well so far

native maple
frigid socket
#

ok worked

#

i am doing day 1 in swift

brazen salmon
frigid socket
brazen salmon
#

Rust

frigid socket
#

no rust in my house

#

i will rpobably do a day in rust yk but iiwii

brazen salmon
#

Rust

terse edge
frigid socket
terse edge
vague knoll
#

i might do rust on a later day

terse edge
#

im gonna keep doing kotlin

#

even tho intellij crasheS every 2 minutes

vague knoll
#

I'll probably use higher level langauges as the challenges get harder

#

rn I'm trying to open a file in assembly

#

I've never done it before 😭

#

maybe I should've made it easier by embedding the text in the binary

frigid socket
#

i am making a Dial class

#

JAVAAAA

#

(not java)

vague knoll
#

the hardest thing i found about assembly is debugging it

#

maybe i should use a debugger ui instead of gdb

native maple
#

you should do it in bqn

brazen salmon
#

license Elle under oql @native maple

native maple
#

what is oql

frigid socket
brazen salmon
#

opinionated queer licence

frigid socket
#

listening tay @brazen salmon

frigid socket
#

okay so imd one @native maple

terse edge
terse edge
native maple
frigid socket
#

eagely ban eta wen

native maple
#

bun0 ban eta when

terse edge
#

theyre the same thing

#
1. The above copyright notice and this permission notice shall be included in all copies or modified versions of the Software.

2. The User is one of the following:
a. An individual person, laboring for themselves
b. A non-profit organization
c. An educational institution
d. An organization that seeks shared profit for all of its members, and allows non-members to set the cost of their labor

3. If the User is an organization with owners, then all owners are workers and all workers are owners with equal equity and/or equal vote.

4. If the User is an organization, then the User is not law enforcement or military, or working for or under either.
#

@native maple use this

native maple
#

that's just MIT lmao

terse edge
#

its not

#

its mit but it cant be used by google micrsoft discord

native maple
#

oh i see

terse edge
#

and whatever other evil companies

native maple
#

that's awesome

terse edge
#

im gonna use this

native maple
#

ok but companies can still get around that

vague knoll
#

assembly has atrocious dx

#

how can you get away with this in 2025

native maple
#

microsoft can open a non profit organization funded by microsoft and use this in their code

terse edge
terse edge
native maple
#

true

terse edge
#

and if they have to gO thruogh the effort of opening a non profit just to use my software thats already enough damage done

vague knoll
#

i don't think the millitary is gonna use your bad code

terse edge
#

LMAOO

#

the software shall be used for Good, not Evil. the original author of the software retains the sole and exclusive right to determine which uses are Good and which uses are Evil.

frigid socket
#

okay i think i got it right @native maple

#

Eagely is Evil

terse edge
vague knoll
#

true...

terse edge
frigid socket
#

Evil Eageler

#

i harass all NixOwos Users

terse edge
#

@native maple what does this mean Users of this work are obligated to freely provide public access to AI scripts written to be used by this work.

terse edge
#

"any of their subsidiaries"

vague knoll
#

This license is granted to everyone except for YOU, PHIL (bullied me at school)!!

frigid socket
#

my example passes but not my real input

#

okay i was using my reddit inputs

terse edge
#

@lusty atlas the leaderboard persists across years

#

its still up

frigid socket
#

part 2 might be easy tbh

#

That's not the right answer; your answer is too high. If you're stuck, make sure you're using the full input data; there are also some general tips on the about page, or you can ask for hints on the subreddit. Please wait one minute before trying again. [Return to Day 1]

terse edge
#

i wasted 40 mins on it

#

cause I misunderstood

frigid socket
#

it's ||every time the dial goes through 0 i do count += 1||

#

right

terse edge
frigid socket
#

yeah i figured that out

#

i think i found issue

#

this shouldn't happen (it started at 0)

vague knoll
#

I haven't even got file reading to work yet

frigid socket
#

finally works

#

That's not the right answer. If you're stuck, make sure you're using the full input data; there are also some general tips on the about page, or you can ask for hints on the subreddit. Because you have guessed incorrectly 4 times on this puzzle, please wait 5 minutes before trying again. [Return to Day 1]

#

kill yourself

native maple
frigid socket
#

yeah ik im shitposting 😭

#

i finished p1

native maple
#

awesome

frigid socket
#

now im killing myself over p2

#

it runs on my example but not on my real inputs

vague knoll
#

I MANAGED TO READ THE FIRST CHARACTER

frigid socket
#

WOOOOOOO

#

i am reviewing logs

#

@terse edge i am AI generating examples and it works

#

but not on my real input

#

im gonna kms

terse edge
frigid socket
terse edge
#

run this

#

see if it matches

frigid socket
#

yeah

#

it doesn’t match on my input tho

#

i’ll look again tonight or something

vague knoll
#

maybe spoiler it?

terse edge
#

and its the harder but faster approach

frigid socket
#

true

quartz aurora
#

I should set my alarm so I can do aoc before work

#

Won't be able to do it until pretty late tonight

terse edge
#

@native maple why do u have srcht mirror

rugged kiln
#

Why is there only 12 days this year

verbal parrot
# rugged kiln Why is there only 12 days this year

It takes a ton of my free time every year to run Advent of Code, and building the puzzles accounts for the majority of that time. After keeping a consistent schedule for ten years(!), I needed a change. The puzzles still start on December 1st so that the day numbers make sense (Day 1 = Dec 1), and puzzles come out every day (ending mid-December).

rugged kiln
#

Ohhh makes sense

terse edge
verbal parrot
#

that's just donations...?

verbal parrot
#

(p1 spoilers) functional programming is kinda fun but i feel like im doing it so unidiomatic

native maple
brazen valley
#

p2 is where it gets more funny

brazen valley
#

sony, spotify, jane street

#

all sorts of companies sponsor this

verbal parrot
brazen valley
#

I just finished it

vestal owl
#

||```js
@Initialize {
let file = ObjFile_Create(OBJ_FILE_TEXT);
let res = ObjFile_Open(file, GetCurrentScriptDirectory() ~ "./inputs/1.txt");
if (res == false) {
RaiseError("failed to open the file");
}

let rotation = 50;
let zeros = 0;

let lc = ObjFileT_GetLineCount(file);
ascent (line_idx in 1..lc) {
    let line = ObjFileT_GetLineText(file, line_idx);

    if (line[0] == 'L') {
        rotation += atoi(erase(line, 0));
        zeros += floor(rotation / 100 + 0.0001);
    } else if (line[0] == 'R') {
        if (rotation == 0) {
            zeros--;
        }
        rotation -= atoi(erase(line, 0));
        zeros += floor((100-rotation) / 100 + 0.0001);
    }

    rotation += 1000;
    rotation %= 100;
}

RaiseError(zeros);

}

#

i hate how it's actually feasible with danmakufu

#

tho still prefer scratch

#

i like how there is a different "for loop" for ascending and descending ranges

native maple
#

what language is this

verbal parrot
#

oh my god yesss

vestal owl
vague knoll
#

is this actually quite challenging?

#

even in a high level language?

vestal owl
#

it's a custom commonly used bullet engine

#

and has its own language

vestal owl
vague knoll
#

oh, there's a part 2?

#

i'm still on part 1

vestal owl
#

bruuuuuuuh

vague knoll
#

it's quite hard to do things in asm

#

or rather, quite slow

vestal owl
#

wait you do asm?

#

damn based

vague knoll
#

it's not particularly hard to grasp the concepts

#

i don't really do asm much, I just learnt a little bit

vestal owl
#

btw do you link with libc or no?

vague knoll
#

no

vestal owl
#

mad respect

vague knoll
#

😭 i'm just doing this because i thought it would be fun

vestal owl
#

dw i bet it'll get easier for the next days for you

vague knoll
#

calling C functions from asm would be a challenge of its own lol

vestal owl
#

cuz you'll have your number parsers and printers and shit by then

vague knoll
#

I did find out a bit about that

vestal owl
#

well good luck

vague knoll
#

thank you

#

i'll need it

#

tbh i think i will switch to c if it gets too hard

#

or maybe some more interesting high level langauges

verbal parrot
#

alright it's time to spin the wheel for tomorrow

vague knoll
#

what the hell is coffeescript doing thhere

verbal parrot
vague knoll
#

you have basically three different versions of js on there blobcatcozy

verbal parrot
#

i mean coffeescript is kinda a different language no?

#

anyways i hope dart isn't horrible

#

all i know about dart is flutter

#

sure why the fuck not

vague knoll
#

also if you went with objective c have fun writing it on a non apple platform blobcatcozy

#

(unless you are an apple user 👎👎)

vague knoll
#

i guess maybe it's usable with openstep

#

or something

#

i never worked that out

native maple
#

idk i didnt find it hard and my solution is like 10 lines

#

ok i lied its like 30

feral valve
#

ocaml
||```
let emod a b =
let r = a mod b in
if r < 0 then r + abs b else r
in

let times = ref 0 in
let dial =
String.split_on_char '\n' input
|> List.map (fun line ->
let line = String.trim line in
(line.[0], String.sub line 1 (String.length line - 1) |> int_of_string))
|> List.fold_left
(fun acc (char, count) ->
let new_acc =
match char with
| 'L' ->
times :=
!times
+
if acc = 0 then count / 100
else if count >= acc then ((count - acc) / 100) + 1
else 0;
emod (acc - count) 100
| 'R' ->
times := !times + ((acc + count) / 100);
emod (acc + count) 100
| _ -> assert false
in
new_acc)
50
in

native maple
#

@feral valve @terse edge global variables

lusty atlas
#

bro i just brute forced this shit

#

i tried doing it with math but i'm too dumb

lusty atlas
lusty atlas
#

fire

verbal parrot
#

NO

feral valve
verbal parrot
feral valve
#

add uiua, lean, idris

lusty atlas
feral valve
lusty atlas
#

yeah, 0.003315seconds

verbal parrot
lusty atlas
native maple
native maple
feral valve
feral valve
verbal parrot
lusty atlas
#

case in point: yapping about elle in this thread

native maple
#

its.. not like i have anywhere else to talk about it?

#

im sorry but i didnt create this problem i just want to talk about elle

lusty atlas
#

your own server, dms, etc

native maple
#

is it strictly prohibited to talk about it here

#

i barely send like 100 messages a month about it anyway im too busy to work on it as much as i used to

#

it always feels like my presence here is directly against you and i dont get why i cant just live in peace

#

is what im doing that much of a threat or annoyance to the server lol

vague knoll
#

to be clear people are allowed to talk about their personal projects in that channel... right?

lusty atlas
#

yes if it's not all they ever talk about

#

rosie has always treated programming like it's her personal blog/talk channel and that is just annoying

#

anyway let's keep this channel advent of code related

fallen lily
#

Time to do AOC day 1 clueless

lusty atlas
#

pretty easy today still

#

definitely harder than last year day 1 though

fallen lily
#

got the first one first try blobcatcozy

lusty atlas
#

horror font

fallen lily
#

guh

#

wrong gif

fallen lily
#

||v7310||

#

||^6047||

#

||v6689||

feral valve
#

this is mildy cursed ngl

fallen lily
feral valve
fallen lily
#

Cursed

#

I'm doing kotlin this year because cmake scares me, but I want to do c++ as well

#

Hopefully my grid class will be helpful this year

#

Maybe I'll throw rust on top of that trolley

vague knoll
#

also makefile is easy for simple things

#

(with no deps)

fallen lily
#

But the issue comes with the fact that I do most of my dev on my windows laptop and Linux desktop 50/50

#

I can run makefiles on windows

feral valve
#

just raw dog clang++

fallen lily
#

But then the deps become an issue

fallen lily
vague knoll
#

just running compilers directly is easy though too yeah

#

they link for you

#

so convinient

fallen lily
#

I even have a script to generate compile commands.json from a makefile on winfows blobcatcozy

vague knoll
#

instead of using proper cmake presets i have a script to run cmake -B build with the correct args

#

unrelated but i just remembered blobcatcozy

fallen lily
#

I use that on linux

#

It doesn't support windows

#

Compile with -Mj then run this blobcatcozy

$ErrorActionPreference = "Stop"
[System.IO.FileInfo[]] $paths = Get-ChildItem -Path dist -Filter *.json -Name -Recurse -ErrorAction SilentlyContinue
if ($paths.Length -eq 0) {
    Write-Error "No compile_commands.json files found in dist directory."
    exit 1
}
$paths = $paths | ForEach-Object { "dist/$_" }
"[$(Get-Content $paths)]" -replace '.{2}$', ']' > .\compile_commands.json
#

Cursed but works

vague knoll
#

i don't speak pwsh

#

what is this "we have find at home"

fallen lily
#

It's cursed

#

Fun fact! You can't pipe binary data

#

Powershell hard wraps text in pipes at 80 characters

#

(the issue on their repo says this is fixed but it still didn't work for me)

vague knoll
#

seems nice how it can have types? then again what if you doing with your shell scripts

#

tbf i don't really use plain shell scripts often

fallen lily
#

Also the lsp is pretty good

vague knoll
#

i would probably just write a script and run it with node

feral valve
#

i wish Ocaml had a print anything function

native maple
lusty atlas
#

using languages like C where you can't just print anything made me realise how good we have it in languages that do

native maple
#

rate this solution
||```sh
sed -e 's/(.)(.)/\1 \2 lEx/' input_1.txt | tr LR '01' | dc -e '[s_l_%s%l%l%[l_+]s0>]sR0sZ50sP[s@s&l&2_1+l@*lP+100lRxsPlP0[lZ1+sZ]s"="lZpsZ]sE[?lXx]sXlXx'

lusty atlas
#

amazing

#

@hollow oasis @ionic flare today is very uiuable btw

hollow oasis
#

oh my god

#

ok

#

ill do it

#

i havent checked the problem yet but what i hate about doing aoc in uiua is that parsing is soooooooooooooooooooooooooo bad

verbal parrot
quartz aurora
#

Order of magnitude of the answer is technically a spoiler, though a very tiny one

verbal parrot
quartz aurora
#

But the order of magnitude is usually the same

hollow oasis
#

kill me

cloud iron
#

i hate p2 because i'm stupid and also i'm doing it in javascript which does those kind of things

#

i think my first one is sane, but i don't even want to see my second solution anymore

fallen lily
#

you will use TypeScript

cloud iron
fallen lily
#

yeah

#

that too

fallen lily
quartz aurora
#

I'm on 120 bytes, but don't have time to optimize it

cloud iron
#

and it shouldn't show anything

verbal parrot
cloud iron
#

just the link to the input

verbal parrot
#

isn’t it?

cloud iron
#

it's safe

terse edge
#

rosies elle blog is the direct cause of multiple people starting their own compilers and learning abuot it

vestal owl
vestal owl
#

almost all istructions are like 3-4 letters long anyway

vague knoll
#

kind of niche

#

i don't think there are many implementations of lsp for asm

vestal owl
#

tho i should get back to it at some point

ionic flare
#

HOLY

#

AOC

#

I FORGOT

vestal owl
cloud iron
#

Omg this is cursed

#

I swear i'm just gonna do it in assembly

#

At least i'll have sane integer division

ionic flare
#

Use bigint

vague knoll
vestal owl
ionic flare
#

C'mon

vague knoll
#

😭

#

but if you want

vestal owl
#

but danmakufu is funnier and requires less mental toll

vague knoll
#

do it in roblox studio

vestal owl
terse edge
vestal owl
#

quite literally

#

lua cured my depression and uiua gave it back

vague knoll
#

i think there are also extra features? but i think there's an open source lua fork / implementation which has the extra features they use anyway

vague knoll
#

i wish there was a luau to lua compiler

hollow oasis
#

@lusty atlas CBT ||```
P ← ⨬¯∘ =@R ⊙⋕ °⊂ # parse number
S ← ⬚50 (◿100+) # spin the dial
C ← ⊢ °⊚ # count zeroes

C S&rlP &fo "day01/input.txt"

native maple
#

@terse edge @terse edge bqn soon

cloud iron
# vague knoll i have spent like hours on part 1

Wot
I have spent minutes on part 1 if not seconds
But on part 2 my most naïve solution had a flaw then i overcomplicated it then i did some shit then i did cursed stuff and then i gave up, did go to reddit and literally saw the solution i wanted to do but written in some cursed ass way that was unreadable and noticed that for debugging i was working on a slice of 150 of the inputs and that's why values where crazy so i closed reddit, refixed my whole thing like i wanted to do it and then it worked, but i won't send it here until it's written in a way where there isn't thousands of if for special casing
Because i literally went the if spam way to basically represent all code paths instead of like actual nice logic

terse edge
#

lang

#

was gonna do esoterics but meh

vague knoll
#

I was trying to warn you

cloud iron
vague knoll
#

just use a bigint

vestal owl
vague knoll
#

😭

#

rn my int parser seems to be yielding -1 idk how

vestal owl
vague knoll
#

I think that's kind of against the spirit of aoc

#

idk though this is my first time

cloud iron
vague knoll
#

uh.. not really

cloud iron
vague knoll
#

well, you can just convert any number to a bigint

#

and back

#

and you can also parse a bigint from a string

#

and bigint constants just have n added to the end

cloud iron
#

Number begone then, welcome BigInts

#

Floats are a mistake, fixed point is more precise

vague knoll
#

js is strange the Number constructor returns NaN if invalid, BigInt constructor throws a SyntaxError

ionic flare
#

That's just floats

#

NaN is a number

vague knoll
#

it should return null

ionic flare
#

Bad

#

That's two types

vague knoll
#

nah ok ig it does make sense, apart from the fact Number should probably just throw an exception too

ionic flare
#

No because number has NaN

#

NaN is a Number

vague knoll
#

yeah i realise but it doesn't feel like great design

#

though it certainly is javascripty design

ionic flare
#

Floats are a good deal older than js

vague knoll
#

like how out of bounds indexing returns undefined (idk of any other language that does this apart from lua blobcatcozy )

ionic flare
#

Lua does doesn't it

#

True

vague knoll
#

javascript likes to make errors silent but deadly

#

though it is convinient sometimes

ionic flare
#

Errors as values as a service

vague knoll
#

like what if you want to support writing NaN and be able to distinguish things which are actually invalid

terse edge
#

js

vague knoll
#

of course the solution to all problems is discriminated unions

#

that would be even better than exceptions

native maple
#

i have an idea

vague knoll
#

how did i even do this

#

oh

#

put some debugging code in the wrong function, now it prints every number as a char

#

ok, if i add my debugging code to the right place it stops the infinite loop

#

maybe i should keep the debugging code then

#

(it actually makes the program exit too early)

hollow oasis
#

dude i typed smth stupid into uiua and it crashed ym computer

#

fuck off

fallen lily
#

guhhhhhhhhhhhhhhhhhhhh

#

why is intellij debugger not working

#

istg

terse edge
#

imma do an nvim config for kotlin

#

but not today

fallen lily
#

iirc the kotlin lsp is still half baked

#

GUHHHHHHH JETBRAINS

hollow oasis
#

i cant use my computer

fallen lily
#

EXCEPTION BREAKPOINTS WORK

#

LINE BREAKPOINTS DONT

terse edge
fallen lily
#

neither do i

terse edge
#

is the nvim java lsp good

fallen lily
#

but i can't get anything better without losing feature i rely on

fallen lily
#

be warned

#

it is a pain in the fucking ass to setup

terse edge
#

i can imagine

#

they use codeberg

#

i have to use their software now

feral valve
fallen lily
#

i dont use mason

#

(but when i did it still was a pain)

feral valve
#

i have everything configured with nix except for nvim lol

fallen lily
#

same blobcatcozy

#

but i install all the lsp servers via nix

fallen lily
#

intellij should add a feature that requires semicolons in kotlin

pale stirrup
#

nop

#

bad

fallen lily
#

yop

#

zoot would love

pale stirrup
#

i hate semicolons

fallen lily
#

i dont 🥰

pale stirrup
#

does nothing but make writing code annoying

feral valve
#

yeah i'm removing semicolons

vestal owl
#

greatest decision of my life

fallen lily
#

@pale stirrup rate

#

very cursed

pale stirrup
#

very

#

oh hey we got the same input i think

fallen lily
pale stirrup
#

also i think you forgot you're using kotlin

fallen lily
#

why?

pale stirrup
#

you could change that if chain to a when statement

fallen lily
#

i only ever think of when as switch

#

like that?

#

oh wait

#

i think i can simplify even more

pale stirrup
#

if you look at my solution you can simplify quite a lot

#

||```kt
part2 {
var current = 50
var count = 0

turns.forEach { turn ->
    val prev = current
    count += abs(turn) / DialNums
    current += turn % DialNums
    if (prev != 0 && current !in 1..<DialNums) count++
    current = (current + DialNums) % DialNums
}
count

}

fallen lily
#

i think i'm going to keep it here

feral valve
fallen lily
#

it's mostly the same as yours except for me not ||modding current by DialNums||

fallen lily
pale stirrup
#

i just put it in a constant

pale stirrup
fallen lily
#

jvm uses annotations

pale stirrup
#

i said normal languages

fallen lily
#

i can get behind the python hate

#

but not the js/ts 🥲

pale stirrup
#

I've used both for years im allowed to make fun of them

fallen lily
cloud girderBOT
# fallen lily you can find the cursed code for @UseFile here https://github.com/sadan4/Advent...

Solution.kt: Lines 21-32

private fun <T> generateInput(fn: KFunction<*>): T {
    val fileName = (fn.findAnnotation<UseFile>() ?: UseFile("input.txt")).fileName
    val f = File("src/main/kotlin/solutions/y$year/d$day/$fileName")
    val ret: Any = when (fn.parameters[1].type.jvmErasure) {
        File::class -> f
        String::class -> f.readText()
        List::class -> makeLines(f.readText())
        else -> throw RuntimeException("Unsupported type: ${fn.parameters[0].type.jvmErasure}")
    }
    @Suppress("UNCHECKED_CAST")
    return ret as T
}
cloud girderBOT
# fallen lily and @Solved here https://github.com/sadan4/AdventOfCode-kotlin/blob/main/src/mai...

Solution.kt: Lines 43-63

val time = measureNanoTime {
    try {
        ret = fn.call(this, args)
        try {
            val expected = fn.findAnnotation<Solved>()?.answer;
            if (expected != null) {
                if (ret?.toString() != expected) {
                    didPart1Fail = "Expected $expected, but got ${ret?.toString()}";
                } else {
                    didPart1Fail = "OK"
                }
            }
        } catch (e: Throwable) {
            ret = "Error checking part 1:\n${e.stackTraceToString()}"
            didPart1Fail = "ERR";
        }
    } catch (e: Throwable) {
        ret = "Error running part 1:\n${e.stackTraceToString()}"
        code++;
    }
}
fallen lily
#

wait

#

the class doesn't need to be generic

#

i get they type from the function

#

guhhhh

fallen lily
#

because the methods are inherited

vague knoll
#

and then accidentally add them when writing python/go/kotlin, but oh well

fallen lily
vague knoll
#

protip use semicolons in asm to do multiple things in the same line

mov rax, SYS_WRITE; mov rdi, STDOUT
#

(do not view this with syntax highlighting

fallen lily
#

@vague knoll what language are you using this year?

feral valve
#

there's none for me on desktop either

vague knoll
#

i already said quite a lot of times and people pobably think i'm boasting but assmebly

#

it's not a good idea

#

getting late and i still haven't finished part 1

fallen lily
vague knoll
#

the problem is its just really easy to make mistakes which are really hard to debug

fallen lily
vague knoll
#

my parser suddenly gives up in the middle of the file and idk why

fallen lily
#

Tbh why not just use c with no libs or smth

pale stirrup
#

crazy how something as simple as
||kt part1 { var current = 50 turns.count { turn -> current += turn current % DialNums == 0 } }||
is still so much assembly

fallen lily
#

Would seem like the same level of challenge, but a lot less infuriating

vague knoll
#

not really

#

c is super easy

pale stirrup
#

oh you just haven't gotten past input parsing?

#

would check out

vague knoll
#

well it was working... but i notice it stops working in the middle of the file

vague knoll
#

obvs in a big program no gc makes things harder

#

but for simple programs it is pretty easy generally

fallen lily
#

Tbh I never really considered memory for AOC

#

Just malloc and don't worry about free

vague knoll
#

that's actually not a bad idea though

#

in a short running program memory leak is fine

fallen lily
#

I mean if you know the lifetime of your program will be the same as the lifetime of your memory. Why worry about it

vague knoll
#

leaking everything is ultimate memory safety

fallen lily
#

Rust doesn't view memory leaks as unsafe iirc

pale stirrup
#

when the program runs in under a millisecond a memory leak means nothing

fallen lily
#

(for part 2)

pale stirrup
#

both parts of my solution run in microseconds

vague knoll
#

i bet my assembly solution is slower than jvm

#

i didn't put any effort into optimisation

fallen lily
#

Are there no optimizing compilers for assembly

pale stirrup
#

im not on the jvm trolley

vague knoll
#

watever

#

jvm kotlin same difference

fallen lily
#

Wing insane doing kotlin native

vague knoll
#

wing running on the kvm

#

(kotlin virtual machine)

fallen lily
#

I need my jvm reflection

pale stirrup
#

like its just a regular executable

fallen lily
#

I think I will make a c++ AOC thing soon™

vague knoll
#

but there is a real art to getting the code to break in the right place

#

which is hard when things just randomly happen in the middle of execution

#

i wish debuggers could travel back in time

pale stirrup
#

wonder how long it'll take until the puzzle is just solving a maze

vague knoll
#

hmm ig that's gotta be possible in theory

#

just like how in emulators you can reverse time to make playing a game easier

fallen lily
#

You can restart any stack frame that isn't interrupted by an async/await block

vague knoll
#

oh looks like gdb can do that

#

cool

#

but it's not like it can un-print stuff

#

or un-read a file

#

surely

#

or is it just magic

#

can it reverse aging too

fallen lily
#

gdb devs are wizards

vague knoll
#

this is a life saver

native maple
#

why is this so painful

vague knoll
#

the moment of truth... and it's too high

#

😭

fallen lily
#

Send code

#

I'm curious what asm AOC looks like

frigid socket
#

@fallen lily Satan.

#

I should try figuring out p2 when i get home

fallen lily
#

It's a bit annoying

#

@frigid socket what lang are you using

frigid socket
fallen lily
#

Evil

frigid socket
#

@fallen lily satan

#

Swift so good

vague knoll
#

do people push their aoc to github

#

or is that weird

#

this horror needs preserving

native maple
#

IM SOOOOO CONFUSED

#

WHAT THE FUCK IS WRONG WITH THE TS TYPE SYSTEM

vague knoll
#

lmao are you doing it with typescript types

native maple
#

WHY DOES THIS BREAK THE RECURSION LIMIT

#

ITS THE EXACT SAME THING

vague knoll
#

average ts code

native maple
#

??????????????

frigid socket
#

i should push my garbagecode

fallen lily
vague knoll
#

the code is too horrific

#

discord won't let me send it

#

it just vanished

fallen lily
#

@native maple are you doing what I think you're doing

vague knoll
#

whyyy

frigid socket
#

ill clean up later

#

1/ has my solution

fallen lily
#

Evil

vague knoll
#

?

#

lemme try without spoiler

#

thehe start of the file won't have any spoilers

#

it's just syscall declarations

fallen lily
vague knoll
#

ohh

#

maybe vencord bug

#

i can send this image...

#

can send from moonlight

#

but it doesn't embed 😭

#

what's a better file extension

fallen lily
#

Or .S

frigid socket
#

👺

vague knoll
#

😭

#

discord bad

frigid socket
#

AI ✨sm

vague knoll
#

i will just do txt

fallen lily
#

@vague knoll love?

vague knoll
#

open with reddit

#

oh

#

STDERR is defined to the same thing as STDOUT

#

there was a reason i did that

#

i don't think it's needed any more

native maple
#

ok well

#

safe to say i wont get the solution for the full input

#

@lusty atlas @terse edge rate

#

my favourite functional programming language

#

ok ive figured out a better way to do mod

quartz aurora
#

Huh, TIL python's int(str) strips whitespace

#

That'll save me several bytes

frigid socket
#

@native maple @vague knoll i think i will just impl a literal dial

#

||go up one and if it reaches 100 go back to 0||

vague knoll
#

are you stuck on it even thouigh you were using a high level language

frigid socket
#

yes

#

pt 2

#

it works on most examples but not my real input

#

tomorrow which lang should i do @vague knoll

#

not asm

vague knoll
#

actionscript

#

||turns out i overcomplicated my result - i guess you don' tneed to count all the times the dial goes past 0 without landing on it?||

frigid socket
#

you kinda need to do that

vague knoll
#

||well it was way too high when i did that||

#

||and it looked like in the example that isn't what's meant to happen?||

frigid socket
#

||part 2 right||

vague knoll
#

||noo part 1||

frigid socket
#

the kode tode cannot read

vague knoll
#

||did i do part 2 early||

frigid socket
#

||yes 😭||

vague knoll
#

lmaaoo

frigid socket
#

||@vague knoll loves||

frigid socket
#

||ig :snackstare:ive up @vague knoll||

quartz aurora
#

I'm currently down to 98 bytes, a very good number

#

||```py
v=50
n=m=0
for L in open(0):
for i in[L<'R']int(L[1:]):v+=1-2i;k=v%100<1;m+=k
n+=k
print(n,m)

frigid socket
#

@brazen salmon i am binary searching my input to see which is fucking with my results

fallen lily
#

i need that for my projects

#

cmake supports it

#

make supports it

quartz aurora
#

Yeah, build system that doesn't support globs is not usable

fallen lily
#

also no make backend kinda woozy

quartz aurora
#

That part I'm fine with

frigid socket
#

@fallen lily fix my solution

quartz aurora
#

The whole two-stage compilation model is just cringe

#

Though, it sounds like it's still two-stage, just with ninja as backend

quartz aurora
#

Both

vague knoll
#

don't get me wrong i love it when i don't have to list all my source files blobcatcozy

#

i finally figured out part 1

#

i figured out part 2 before part 1 😭

fallen lily
#

also guhhhhhhh

vague knoll
fallen lily
fallen lily
vague knoll
#

i've never seen any big projects using globs

fallen lily
quartz aurora
#

With some minor tweaks (and a much uglier output format) I'm down to 96 ||```py
v=n=0
for L in open(0):
for i in[L<'R']int(L[1:]):v+=1-2i;k=v%100==50;n+=k*1j
n+=k
print(n)

fallen lily
#

at most, there will be a couple dozen files

vague knoll
#

for me it just seems like a minor convinience on a small project

frigid socket
#

@vague knoll might try writing a js solution and see if it runs

fallen lily
#

more than a minor convenience to me

fallen lily
#

am i doing something obviously wrong or is clangd just insane

vague knoll
#

clangd is insane

cloud iron
vague knoll
#

i don't imagine writing makefiles really... scales

#

well, people try

#

linux blobcatcozy

fallen lily
#

tbh i dont them not having a make backend that much

#

its no globbing support that's a dealbreaker for me

cloud iron
#

they do scale well imo as long as project has very strong structure :copium:

#

maybe it doesn't scale that well... but i like writing makefiles tho

vague knoll
#

maybe not if you have as many deps as the average node or rust project

#

yeah they are elegant

cloud iron
#

yes about that, frick dependencies

vague knoll
#

idk what this person has against makefiles

cloud iron
#

like isn't this so nice
and i don't even need to do anything when i add new files

vague knoll
#

i'm using a makefile for aoc

#

i really just threw this together

#

i don't make use of LDFLAGS

#

it's always with -g

#

is delete_on_error even the correct name

#

well.. always use that thing whatever it's called

cloud iron
#

idk

vague knoll
#

it was so annoying when my codegen stuff had issues and only partially wrote stuff

#

because i was first echoing // THIS IS MACHINE GENERATED

#

idk maybe it's a skill issue

cloud iron
fallen lily
#

who needs a task runner

fallen lily
hollow oasis
#

@ionic flare what if under uncouple -> der couple

#

new symbol

cloud iron
#

gradle is cool, i support gradle

hollow oasis
#

ununder actually works???

quartz aurora
#

Gradle for c++ sounds cursed

hollow oasis
#

im going insane

cloud iron
#

but groovy gradle tho, i don't like kotlin gradle

cloud iron
pale stirrup
hollow oasis
#

im losing it

fallen lily
cloud iron
hollow oasis
#

😭

quartz aurora
#

It's if wingdings was a proglang

fallen lily
vague knoll
#

i want to sleep

#

howw...

quartz aurora
#

It's illegal

vague knoll
#

i'm dividing by 10

pale stirrup
#

day 2 in 4 hours and you're still not done

cloud iron
vague knoll
#

i've got the solution i just wanna print it

fallen lily
#

@vague knoll would you consider using godbolt cheating to do this

vague knoll
#

no

fallen lily
#

evil

ivory knot
fallen lily
#

what does this even mean woozy

#

how is a float even being used here

vague knoll
#

lol my part 1 solution immediately worked for part 2

#

😭

hollow oasis
#

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

vague knoll
#

because part 1 confused me and i made it harder than it needed to be which coincidentally was what they wanted for part 2

cloud iron
#

also my final solution after having cleaned up my horrible p2 code

vague knoll
#

my part 1 solution needed to be fixed so it actually worked for part 1

fallen lily
frigid socket
#

@fallen lily fix my solution

fallen lily
#

send code

frigid socket
fallen lily
#

there is no p2 code?

frigid socket
#

yes thrre is p2 code

#

Satan can’t read

#

actually my fn name is misleading

fallen lily
#

i only see p1

#

evil

frigid socket
#

it solves 1 and 2

fallen lily
#

split into 2 fns

frigid socket
#

look at Dial.swift

fallen lily
#

using a class for this is insane

#

you just need 2 ints

frigid socket
#

true

#

@fallen lily choose tomorrow’s lang

fallen lily
cloud girderBOT
# fallen lily ||https://github.com/sadan4/AdventOfCode-kotlin/blob/main/src/main/kotlin/soluti...

Code.kt: Lines 47-71 - :warning: Zero width spaces present
||```kt
override fun part2(input: TInput): Any? {
var cur = 50;
var zeroCount = 0;
val parsed = input.parseInput();
for (_i in parsed) {
var i = _i;
if (abs(i) >= 100) {
zeroCount += abs(i) / 100;
i %= 100
}
val old = cur;
cur += i;
val new = cur;
when {
// noop
old % 100 == 0 -> {}
new % 100 == 0
|​| new / 100 != old / 100
|​| new / 100 == 0 && new.sign != old.sign -> {
zeroCount++;
}
}
}
return zeroCount;
}

fallen lily
#

HOW ARE THERE ZERO WIDHT SPACES

frigid socket
#

inconsistent semicoloning

#

Satan must die

#

Sadan just got Slimed by Nin0.

#

listen

fallen lily
#

never

frigid socket
#

yk

#

DJ NiN0

fallen lily
#

i never pushed the better code

cloud girderBOT
#

Code.kt: Lines 43-67 - :warning: Zero width spaces present
||```kt
}

@UseFile("./input.txt")
@Solved("6289")
override fun part2(input: TInput): Any? {
var cur = 50;
var zeroCount = 0;
val parsed = input.parseInput();
for (_i in parsed) {
var i = _i;
if (abs(i) >= 100) {
zeroCount += abs(i) / 100;
i %= 100
}
val old = cur;
cur += i;
val new = cur;
when {
// noop
old % 100 == 0 -> {}
new % 100 == 0
|​| new / 100 != old / 100
|​| new / 100 == 0 && new.sign != old.sign -> {
zeroCount++;
}

cloud girderBOT
# fallen lily ||https://github.com/sadan4/AdventOfCode-kotlin/blob/main/src/main/kotlin/soluti...

Code.kt: Lines 43-67 - :warning: Zero width spaces present
||```kt
}

@UseFile("./input.txt")
@Solved("6289")
override fun part2(input: TInput): Any? {
var cur = 50;
var zeroCount = 0;
val parsed = input.parseInput();
for (_i in parsed) {
var i = _i;
if (abs(i) >= 100) {
zeroCount += abs(i) / 100;
i %= 100
}
val old = cur;
cur += i;
val new = cur;
when {
// noop
old % 100 == 0 -> {}
new % 100 == 0
|​| new / 100 != old / 100
|​| new / 100 == 0 && new.sign != old.sign -> {
zeroCount++;
}

fallen lily
#

guh

#

is the bot stupid

fallen lily
#

@frigid socket you love c++ path concat operator

cloud girderBOT
# pale stirrup ||https://github.com/wingio/advent-of-code/blob/2025/aoc%2Fsolver%2Fsrc%2Fcommon...

aoc/solver/src/commonMain/kotlin/solver/solutions/Day01.kt: Lines 13-19
||```kt
part1 {
var current = 50
turns.count { turn ->
current += turn
current % DialNums == 0
}
}

**aoc/solver/src/commonMain/kotlin/solver/solutions/Day01.kt:** Lines 21-33
||```kt
part2 {
    var current = 50
    var count = 0

    turns.forEach { turn ->
        val prev = current
        count += abs(turn) / DialNums
        current += turn % DialNums
        if (prev != 0 && current !in 1..<DialNums) count++
        current = (current + DialNums) % DialNums
    }
    count
}
```||
hollow oasis
#

im going insane do i actually have floating point precision problems

#

oh my god i cant read

#

no this is stupid phrasing

pale stirrup
#

where would floats come into play

molten bolt
#

Doing advent of code for the first time

#

im nervous

pale stirrup
#

why

frigid socket
#

im winging it

#

ill probably vibe code d1p2 @molten bolt

#

oh jkjk

#

i did use AI to generate some example inputs and solutions @pale stirrup

#

yk

fallen lily
#

this seems fast enough for me

#

oh

#

im just stupid

ionic flare
#

Okay

#

Der

#

Okay

plucky wind
#

google sheets
p1:
||```cpp
=REDUCE("50,0",split(A2,"
"), lambda(t, v, let(r, index(split(t,","), 1), count, index(split(t,","), 2),
distance, iferror(find("R",v),-1)*regexextract(v,"LR"),
newr, mod(r+distance, 100),
join(",",newr, count + (newr=0))
)))

p2:
||```cpp
=REDUCE("50,0",split(A2,"
"), lambda(t, v, let(r, index(split(t,","), 1), count, index(split(t,","), 2),
    dir, iferror(find("R",v),-1), distance, dir*regexextract(v,"[LR](\d+)"), 
    newr, r+distance, zero, if(newr>=100, floor(newr/100), if(newr<=0, not(r=0)+floor(abs(newr/100)))),
    join(",", mod(newr, 100), count+zero)
)))```||
fallen lily
#

c++ my beloved

fallen lily
terse edge
#

hi

fallen lily
#

I love not being able to do AOC until tomorrow