#AdVENt of Code

1 messages · Page 11 of 1

solemn python
#

Holy red colors

#

Who ate the codeberg server rack

proper totem
tranquil vapor
solemn python
#

evil

tranquil vapor
#

why is gnome term so ugly

proper totem
#

I'm glad it's happening and I don't want to be angy at open source devs because yeah but I also wish it would happen sooner xd

tranquil vapor
#

i switched to alacritty

#

way prettier

solemn python
tranquil vapor
#

shrimply contribute

proper totem
#

i would! but I cannot at the moment

warped dust
#

i think their issu is planning too much

proper totem
#

and so I will just be wishful

solemn python
#

I don't know go + I have barely a clue how AP works + if I do that then I will end up procrastinating on literally all of my responsibilities

#

Maybe at some point I'll ask in the matrix room if there's anything I could do to help, but not now

tranquil vapor
#

you can learn go in a day

tranquil vapor
#

i love super light blur

native pewter
solemn python
#

I am a konsole user because I am too lazy to figure out the cool emulators

#

Plus easy transparent blur

tranquil vapor
#

its so easy in alacritter

steady fog
native pewter
#

y

steady fog
#

linuh

sullen fiber
#

You still could it would just be more math involved

#

I think they did smth like that before

tranquil vapor
#

yeah someone said Chinese thingie theorem

#

but idk that algorithm and it seems complex lol

#

lazy

sullen fiber
#

Number theory moment

native pewter
#

OL

#

fuck

#

how did i open overlay

steady fog
#

@solemn python get ready

#

or die

real hinge
#

Moral of the story:use gpu

solemn python
steady fog
solemn python
#

this doesn't seem too bad Clueless

#

(that will come back to bite me later)

steady fog
#

oh my god im not doing bash today

#

nop

#

i was gonna do bash

real hinge
#

I get the todays problem but uhh

#

That visualization is kinda horror

#

So we need to create a equatiob

#

I am so sleeeeepy

steady fog
#

sleep

real hinge
#

Ij ust woke up

#

but its eaerly

proper totem
#

fun day

solemn python
#

hey today my example fetcher actually works

proper totem
#

||the size of today's inputs scared me but this was also probably one of the easiest days together with 6||

steady fog
#

hmm

#

im doing julia today

teal mountain
#

today was totally doable but i slept through my alarms so i had to do it half asleep

real hinge
#

I hate when rust goes "BORROW OF MOVED VALUE"

proper totem
#

simply steal it if you can't borrow it trol

real hinge
#

I know what I am doing idiot compiler

#

why do you care

hazy sinew
#

so much duplicate code 😭
||```kotlin
override fun solvePart1(input: File) = input.rl().sumOf { line -> generateSequence(line.split(" ").dropBlanks().map { it.toLong() }) { seq -> seq.zipWithNext { a, b -> b - a }.takeIf { it.any { diff -> diff != 0L } } }.fold(0L) { acc, seq -> acc + seq.last() } }

override fun solvePart2(input: File) = input.rl().sumOf { line -> generateSequence(line.split(" ").dropBlanks().map { it.toLong() }) { seq -> seq.zipWithNext { a, b -> b - a }.takeIf { it.any { diff -> diff != 0L } } }.toList().asReversed().fold(0L) { acc, seq -> seq.first() - acc } }```||
proper totem
#

simply just solve them in the same function and return an array blobcatcozystars

steady fog
#

@proper totem hi

proper totem
#

spoob

steady fog
#

spoob

proper totem
solemn python
#

yeah todays not bad at all

solemn python
#

pretty simple really

real hinge
#

I pass array as parameter

#

then use .last.unwrap

hazy sinew
#

so ill just keep it like this

solemn python
#

idk I had some borrow checker issues too but then I did things the smarter way and suddenly I no longer had a mutable borrow and an immuable one at the same time

#

crazy

hazy sinew
#

bro i accidentally clicked my mouse side button that takes you back on the website, and it made it appear like i didnt do part 2

#

even tho i did it 40 minutes ago

#

i got so scared bro

solemn python
#

ok pushed my code

steady fog
solemn python
#

ok

#

then do it

steady fog
#

soon

hazy sinew
#

i love waking up sick on my birthday at 5:40 am to do aoc

#

and then not placing on global leaderboard

solemn python
#

huh the maximum iterations I had to extend the array till 0s is 19 times

#

I was kinda expecting it to be more tbh

steady fog
#

crack my spine like a whip

proper totem
#

it is pretty neat how this one reduced today

solemn python
#

calculations go brrr

hazy sinew
#

mine takes like 16ms for both parts

solemn python
#

yeah there shouldn't be much difference between the two parts

#

because its just literally the same thing, different order

steady fog
#

julia is such a weird lang

solemn python
#

funny seeing how short it takes on the example input

proper totem
#

plus or minus more than the actual time

hazy sinew
#

nice tolerance

#

3 us +- 500us

proper totem
#

aaaa I just thought of a good way to do it in assembly with minimal memory allocations

solemn python
#

theres probably a better way but ive never really done this before so thats where my brain went

#

¯_(ツ)_/¯

steady fog
#

||so when im calculating diffs, should i first check if the calculated diffs is just zero, then stop?||

steady fog
#

oka

#

im kinda getting it

hazy sinew
#

he cached the positions at a specific index in the instructions

#

or smth

hazy sinew
#

smth like this

#

i already forgot

steady fog
#

how

#

doing this in julia is h

hazy sinew
#

delete julia

steady fog
#

soon

#

do you store each of the differences

#

a list of them all

hazy sinew
#

i generate the differences and then map them to the extrapolation

#

no variables 🙂

solemn python
#

i store all iterations of diffing in a hashmap

steady fog
#

i am too dumb

solemn python
#

because making smart people code is for overcompetitive nerds

#

||
test
||

#

||```rs
for j in (0..=i).rev() {
let diff = *sequence_map.get(&j).unwrap().first().unwrap();
let Some(modify_arr) = sequence_map.get_mut(&(j-1)) else { break };

modify_arr.insert(0, *modify_arr.first().unwrap() + diff);
}

steady fog
#

you are rusty

solemn python
#

and my sequences were reversed because thats just how i did it

steady fog
#

no way

#

i just solved it

solemn python
#

p1?

steady fog
#

i literally just moved around variables

#

yea

#

lol

solemn python
#

well p2 is really easy

#

have fun

steady fog
#

i just moved my operations around until i got example right

real hinge
#

okay done

#

part2 was pretty simple but I couldnt figure out how to reverse process for 20 minutes

steady fog
#

mantika moment

real hinge
#

did you finish

steady fog
#

part 1

#

somehow

real hinge
#

do part2

steady fog
#

a,

#

am

#

i thought replacing last() with first() would be enough

#

but nop

solemn python
#

yeah I failed my first attempt b/c of that

#

theres one more thing you are missing to reverse

#

well maybe 2 depending on your code

hazy sinew
#

i had to do .toList().asReversed() and then make it -

steady fog
#

i cant tell

real hinge
#

why was today easy

#

if today is easy tomorrow will be fear

steady fog
#

||```julia
for arr in lines
local diffs = diffs_of_arr(arr)
local num = 0

while true
    _diffs = diffs_of_arr(diffs)
    if all(diff -> diff == 0, _diffs)
        num += last(diffs) + last(arr)
        break
    else
        num += last(diffs)
        diffs = _diffs
    end
end

global total += num

end

real hinge
#

I went full recursion

steady fog
#

guh?

real hinge
#

||

fn find_next_value(numbers: Vec<i32>) -> i32 {
    let mut differences: Vec<i32> = Vec::new();

    for number in numbers.iter().zip(numbers.iter().skip(1)) {
        differences.push(number.1 - number.0);
    }

    if differences.len() > 1 && !differences.iter().all(|&x| x == differences[0]) {
        let diff = find_next_value(differences.clone());
        return numbers.last().unwrap() + diff;
    }
    return numbers.last().unwrap() + differences[0];
}

||

steady fog
#

wtf am i missing

#

@solemn python help

solemn python
#

i dont speak julia

steady fog
solemn python
#

I learned from the scratch card p2 solution that recursion is not very fun in rust

real hinge
#

**IF COMPILER LET ME **

solemn python
#

if you want flexibility with variables you should not be using rust

#

if you didn't use recursion though, you wouldn't need to clone because the structure would mean you could use references correctly

steady fog
#

idk how to do p2

#

guh

hazy sinew
steady fog
#

I know

#

I tried reversing arrays flipping signs using first item instead of last

hazy sinew
#

yes

#

try again

#

also i watched so much hyper neutrino should i just switch to python

hazy sinew
#

bro i just realized why i took so long for part 1

#

i was doing input.extractNumbersSeparated() to get the numbers but there were negatives so i had to do input.extractNegativesSeparated
i ended up just rewriting it completely

warped dust
#

use a reference

#

&[i32]

#

actually no u mutate it

#

how do you expect it to work

#

actually no

#

what

#

it literally works without cloning

#

the fuck do you mean

#

rustc literally hates you

#

manti got me questioning reality with how it didnt work when it literally works

hazy sinew
#

rust variable borrowing is stupid

warped dust
#

pointers so hard

#

look this one points right at your ass

#

how does it do that

hazy sinew
#

point at deez nuts

real hinge
#

wait it really works

#

I probably had another code that was breaking it which I removed later

#

@tranquil vapor do AOC

tranquil vapor
#

soon

#

is today again unbruteforceable

real hinge
#

also it is veeery easy

#

also how would you even not brute force

tranquil vapor
#

wdym

#

i didnt check exercise yet

real hinge
#

check

sullen fiber
#

Time to go eat

#

Then go library and do today

#

Hope I can sneak in some time to do more large inputs

hazy sinew
#

actually there probably is a math trick

#

but idk

#

can somebody please teach me chinese remainder theorem implementation

#

wtf is an inverse modulo

#

i understand what it does but not how to implement it

real hinge
#

@tranquil vapor do aoc

#

oh great discord memory leak strikes again

sullen fiber
#

Today so easy

#

So Uiuable

sullen fiber
#

Lol

sullen fiber
steady fog
#

@sullen fiber

sullen fiber
#

Modular multiplicative inverses

#

Hihi

hazy sinew
sullen fiber
#

Idk if that's real

sullen fiber
#

Part 1 rate

tranquil vapor
#

terrible

#

i will eat whoever designed ua

sullen fiber
#

U love my matrices

#

@hazy sinew I found the formula I think

sullen fiber
hazy sinew
solemn python
#

uiuo

steady fog
#

@solemn python@solemn python@solemn python

#

did you do any absolute value

#

in part 2

solemn python
#

No

steady fog
#

guhhhhhhhhhh i dont know how to doo

hazy sinew
#

bro have u still not solved part

#

2

steady fog
#

well i had to sleep

#

idk what i need to change in my part 1

distant kindle
#

solve my life problems @steady fog

steady fog
#

ookay

#

soon

hazy sinew
distant kindle
hazy sinew
#

or array

#

or whatever

hazy sinew
# distant kindle

find chinese remainder theorem for large numbers simple explanation

steady fog
hazy sinew
#

u probably have a list of lists for part 1 right

#

just do .reverse() and change nothing else

steady fog
#

idk how mine works

#

accidentally solved part 1

hazy sinew
#

bro chinese remainder actually kinda easy ngl

#

i fully understand it now

hazy sinew
#

if we get chirem problem this year i get leaderboard

hazy sinew
#

ew not kotlin

steady fog
#

I know

hazy sinew
#
for arr in [reverse(x) for x in lines]
    local diffs = diffs_of_arr(arr)
    local num = 0

    while true
        _diffs = diffs_of_arr(diffs)
        if all(diff -> diff == 0, _diffs)
            num += last(diffs) + last(arr)
            break
        else
            num += last(diffs)
            diffs = _diffs
        end
    end

    global total += num
end```
#

try this

steady fog
#

Im not home

#

unfortunately

#

you will test on your pc

hazy sinew
#

time to download julia

steady fog
#

yop

hazy sinew
#

it works

#

im insane

#

hardest p2 ever

#

i would use julia if it didnt require end keyword

#

and had interop with my kotlin utils

real hinge
#

take first element instead of last

#

and subtract instead of adding

steady fog
#

I diddd

sullen fiber
#

How does chinese remainder theorem help in today

#

Oh ur just talking Abt it

real hinge
#

ven still havnet did aoc

#

ven lost all of his motivation

sullen fiber
#

Did it say something like "the inverse modulo p"

#

Cus then it probably just was saying inverse, (under modulo p)

distant kindle
#

yall getting too comfortable with unspoilered spoilers

native pewter
#

tf today was dead shrimple

native pewter
#

oh nvm!

#

my ass is not beating 5 minutes

native pewter
#

yea,

#

easier than day one

sullen fiber
#

Today was easy was balls

#

Almost as easy as the quadtradic one

native pewter
#

this the big break before dijkstra

sullen fiber
#

Lmao

distant kindle
#

oh my god so much text again

#

is there a subreddit where people summarise the exercises in less words

native pewter
#

its just the steps

tranquil vapor
#

what...

#

part 2 was laughable

#

i just had to add like 4 lines for part 2

#

can literally even use the same loop as u do for part 1

#

i took like 20mins

daring marlinBOT
native pewter
#

i just did recursion

#

so plimpel

tranquil vapor
#

more complex

#

but less memory usage kinda

sullen fiber
#

How do you recursion this

#

Fire

rose latch
#

Im actually surprised how high I have gotten on the leaderboards here

#

damn

#

7th :)

steady fog
#

@real hinge go

real hinge
#

oh my god

#

what is this problem

steady fog
#

mantika moment

real hinge
#

its over

#

pathfinding for real this time

steady fog
#

so good

#

I accidentally made c++ memleak

#

crashed my desktop

#

how do i even make 2d array in c++

proper totem
#

these pipes are pain

#

i got a solution but ||recursion not allowed|| so it goes explod

#

oh my gosh

#

I made this so much more complicated for myself than I needed it to be

steady fog
#

im piecing it together slowly

proper totem
#

||there's only one possible loop that you're on so you don't need to recurse to check more paths you just need to follow the single path until you make the loop||

#

aaaaaaaaa

real hinge
#

rust borrowings are gonna make me kill myself

eternal marlin
#

ur prob just using rust wrong

real hinge
#

idc

#

"nooooo you can either use vector as mutable or not mutable!!!!!"

eternal marlin
#

u r definitely using rust wrong

#

@warped dust kill it

steady fog
#

day-10-cpp.cpp: In function ‘std::vector<Tile> getAdjacent(std::vector<std::vector<Tile> >&, int, int)’:
day-10-cpp.cpp:47:68: warning: no return statement in function returning non-void [-Wreturn-type]
47 | vector<Tile> getAdjacent(vector<vector<Tile>>& map, int x, int y) {}
| ^

#

this is mantika

real hinge
#

I think this is horrible

steady fog
#

im doing 2d array of pairs

#

Type to distance

#

i think this will work

solemn python
#

guh it works on example input but then seems to infinite loop on normal input

steady fog
#

C++ intellisense so slow to update

solemn python
#

this seems like a normal amount of loops to run

#

sure

#

ok I found my issue but it thinks the answer is 4

#

on normal input

#

wtf

#

I hate debugging aoc so much

steady fog
#

they call me a critter

solemn python
#

oh right

#

me being an idiot is coming back to bite me isn't it

#

I noticed the potential for overflow and ignored it

#

nice one

steady fog
#

I love

proper totem
#

part two ||is going to make me EXPLODE||

steady fog
#

do not

proper totem
#

||I guess it won't be too hard, i just got a good idea on how to do it||

steady fog
#

thank you

solemn python
#

you love to see it

steady fog
#

i do

solemn python
#

what the hell am I doing wrong aaaa

steady fog
#

error: Recipe day10 was terminated on line 42 by signal 11

#

What

#

oh segfault

#

funny

#

fixed

proper totem
#

i'm so confused

#

code works on every example

#

not on input though

#

and visually it works too

steady fog
#

i need a hint on p1

hazy sinew
#

AAAAAAAAAAAAAAA

#

@frank kraken whats ur progress on p2

real hinge
#

I dont know what I am doing

steady fog
#

same

#

i have a queue of tiles

proper totem
#

I have a solution that works on the examples

#

but cannot figure out what the heck is wrong

hazy sinew
#

BRO

#

||I tried flood fill for p2, but gave up. I then just looked at every coordinate that ISN'T part of the loop, and counted how many times |, J, L, or S appear to the left of it. If it appears an odd number of times, the given coord MUST be in the loop.||

#

guy from solution megathread

#

this is so smart wtf

steady fog
#

guh

proper totem
#

spoiler that smh

steady fog
#

i think my method would just get stuck in a loop

solemn python
#

finally holy hell

hazy sinew
#

have fun

solar tide
#

is today's day easy

steady fog
#

nop

solar tide
#

im yet to do

hazy sinew
#

no

solar tide
#

thinking might do it in rust

#

did yesterday's in go

proper totem
#

||I tried flood fill too, i have no clue why it wouldn't work, but i guess that proposed solution works too||

#

||bleh but flood fill is so much nicer of a solution||

steady fog
#

GUHHHHHHHHHHHHHHHHHHHHHHHHHH idk what to do

real hinge
steady fog
#

oh guh

#

i need to use pointers

#

for this

solemn python
#

ok I have a pretty decent idea honestly

steady fog
#

xcause it maeks a copy

solemn python
#

doesn't seem too hard but also this sucks

real hinge
#

guhhsince I use recursion this means by code isnt able to find a loop

#

at least loop long enough

#

max 265

steady fog
#

taking the address of a temporary object of type 'Tile'C/C++(clang-diagnostic-address-of-temporary)

#

jfhbhwebfwebf

hazy sinew
#

😋

#

this is one hell of a rollercoaster

steady fog
#

insane

#

guh i dont understqand

#

idk if i need to use pointer to a tile

hazy sinew
#

bro if you just look at this example and realize its day 10 you could instantly figure out that floodfill isnt the solution

steady fog
#

womp womp

#

wtf

#

C++ is confusing me'

hazy sinew
#

are u doing different language every day

steady fog
#

yes

#

im doing current_tile.dist = 200;

#

then i print all the tiles out

#

theyre all -1, the default value

solemn python
#

my input is literally a donut

proper totem
#

bleeeeehhhhhhhhh

steady fog
#

i ned to figure out gdb

hazy sinew
solemn python
#

ok well I had an idea but now i have no clue

#

guh

steady fog
#

see if im accidentally cloning the tile

hazy sinew
#

guys if your answer is around 700 stop using floodfill

steady fog
#

GUH its a different instance

proper totem
#

sdkcnskjdnckjsndckjsdkjcnskdncksjdckjsndkcskjdclkkjahkashdkjfhaksdjfhaksdfasdfasdfaksdjfhkjsdcajdskn

real hinge
#

@hazy sinew you will give your input and answer

#

I am having pain

steady fog
#

@real hinge will figure out how to use refeernces in c++

real hinge
#

pointer

steady fog
#

a

hazy sinew
#

bro #3 modeled his grid in double resolution

#

wtf

#

to make the holes between pipes of size 1

solemn python
#

hm I have a stupid idea

steady fog
#

& means take reference of right

#
  • is dereference
#

a

#

die discord

#

*

solemn python
#

have you never used rust before

steady fog
#

C++

#

also yes

solemn python
#

oh

steady fog
#

i hate rust

real hinge
#

guh have you never used pointers

steady fog
#

hardly

real hinge
#

pointers are just referances to original value

#

memory location

solemn python
hazy sinew
#

it works

#

but theres an easier way

solemn python
#

yes I saw it because you so kindly spoiled it for everyone a few pages above in this chat

proper totem
#

yes

hazy sinew
#

||count the number of "|LJS" that are on the path to the left of the point, if its odd then the point is inside the path||

solemn python
#

but I refuse to use that because id rather do my own way that isn't copying what you gave

steady fog
#
queue<Tile> tile_queue;

for (int i = 0; i < height; i++) {
    for (int j = 0; j < width; j++) {
        if (map[i][j].type == Tile::Start) {
            tile_queue.push(map[i][j]);
            break;
        }
    }
}

while (!tile_queue.empty()) {
    auto current_tile = tile_queue.front();
    current_tile.dist = 0;
#

setting dist to zero doesnt actually update the tile

proper totem
steady fog
#

maybe if i

#

currentTile->dist=0

proper totem
steady fog
#

ok it works

#

C++ is weird

hazy sinew
#

how do you guys determine what S is dynamically

#

i dont wanna push hardcoded solution to github

steady fog
#

oh my god the memory is corrupted

#

im setting dist to 5, it prints a 6

#

what

solemn python
#

I just check the 4 directions for a connected pipe

#

there will only ever be 2

#

just treat it as if it is a sort of + is what I do

steady fog
#

i just did this

for (int i = 0; i < height; i++) {
    for (int j = 0; j < width; j++) {
        if (map[i][j].type == Tile::Start) {
            tile_queue.push(&map[i][j]);
            break;
        }
    }
}
#

find start tile put it in the queuee

proper totem
steady fog
#

using vscode for C++ is funny

proper totem
#

||bleh i'm still annoyed that flood fill isn't the immediate solution that would have been so much nicer||

#

||but i will be content with the math solution because the geometry makes sense xd||

hazy sinew
#

true

hazy sinew
#

||double the grid size so x, y is now 2x, 2y and then floodfill normally without any edge conditions||

proper totem
#

yeah

steady fog
#

im so powerful

proper totem
#

||doubling the grid isn't entirely so simple because you then need to make sure that the pipe still connects everywhere in a sane way, which isn't too hard but it makes it trickier||

hazy sinew
#

wdym

#

||
say you have

S-7
|.|
L-J

it becomes

S.-.7
.....
|...|
.....
L.-.J

now to get the path instead of adding the cardinal neighbors you add the cardinal neighbors + 1
||

proper totem
#

yeah I was overcomplicating it

#

kinda want to make a visual version of this one

#

but effort

steady fog
#

im so Powerful

real hinge
#

I AM GONNA DIE

#

LIFE IS MEANINGLESS

#

LOOK I TRIED THAT

#

ANSWER WAS JUST ONE LESS

#

I DID WRONG CALCULATION

#

ATE MY HALF HOUR

#

part2 please dont be bad 🙏🏿

proper totem
steady fog
#

mantika

hazy sinew
steady fog
#

progress?

hazy sinew
hazy sinew
steady fog
#

funny

real hinge
#

those had values of 9000 ish and 3000 ish

steady fog
#

C++ plugin is soooooo slow

real hinge
#

I added them together and divided by 2

#

the problem was it was either one more or less trolldayruined

#

I thought I was in wrong way so gave up in that

hazy sinew
steady fog
#

NeBend

real hinge
hazy sinew
#

wtf is that

real hinge
#

distances

#

normally 11554 was supposed to go up

steady fog
#

wtf why isnt it fsjndfjsdhfbn

real hinge
#

and go all way down to start

#

but it didnt trolldayruined

hazy sinew
#

ur overcomplicating this

real hinge
#

thats where the wrongness came

#

anyway

#

doesnt really matter

steady fog
#

GUH

#

how do i stop a tile from going backwards

proper totem
#

you can ||keep track of the path you've traversed (depending how you're tracking that in the first place) and make sure that you don't backtrack that way||

hazy sinew
steady fog
#

wait

#

i forgot

#

i set default value to -1

hazy sinew
#

if ur loop is 3x3 then S is the 0th and the 8th step

real hinge
#

oh you meant by that

#

but it can be 13902 or 13904

steady fog
#

mantika is a genius

hazy sinew
#

can i test my code on someone elses input

hazy sinew
steady fog
#

oh wth its not even adding the pipe in the queue

hazy sinew
#

if so, its ||the amount of steps until the stack is empty +2||

hazy sinew
#

||6907 553||

proper totem
#

yop

#

err

#

yop to yes i did it

real hinge
proper totem
#

your p2 answer is wrong though

hazy sinew
#

what the correct answer

real hinge
#

anyway wth is part2

#

do I need to take every dot inside the loop

hazy sinew
#

every space inside the loop

#

dot or pipe

#

the loop itself doesnt count

hazy sinew
real hinge
#

everything then

proper totem
#

|| 541 ||

hazy sinew
#

wtf

#

whatever it works on my input so its correct ill push it

proper totem
#

can i have your input too

steady fog
#

fbshdfbhsdf i broke everything

steady fog
#

i am writing code most unholy

#

its going off the grid

#

OH

#

I MIXED X AND Y UP

hazy sinew
#

first >2h day

#

sadge

#

bro hyper neutrino and jonathan paulson got absolutely destroyed today

#

jonathan paulson was behind xiaowucl by like 50 points now hes behind by 350

solemn python
#

I'm fairly sure you are the only one here who cares about the global leaderboard at all

steady fog
#

im writing the most beautiful code

hazy sinew
#

not possible, youre not using kotlin

steady fog
#

true-

#

i wonder what day i should use kotlin

real hinge
#

@steady fog count free spaces

steady fog
#

guhhh

#

my code works on the example but not my input

#

@real hinge help

real hinge
#

fix

steady fog
#

idk how

#

will you process my input

#

tell me how close i am

hazy sinew
#

@proper totem

#

ik why ur input wasnt working

#

my S is an L

#

your S is a 7

real hinge
hazy sinew
#

im counting S as valid

proper totem
#

yop

steady fog
solar tide
#

do you want my input

proper totem
real hinge
#

13428/2

steady fog
#

mantika moment

#

?

solar tide
#

@real hinge :3

real hinge
steady fog
#

i get 187

#

as the max

real hinge
#

wrong

steady fog
#

how

hazy sinew
hazy sinew
#

i wish old computers without UTF support never existed so we could have actual pipes instead of 7FJL|-

proper totem
#

i did that blobcatcozystars

#

only in printing and not in my processing though

steady fog
#

oh found an issue

real hinge
#

guh my brain completely stopped

steady fog
#

sorry

#

i was counting diagonals

#

from the start

solar tide
#

I don't get this junk parts in part 2

steady fog
#

im slowly getting bugs fixed

#

oop

solar tide
steady fog
#

need to figure out where that top 4 comes from

hazy sinew
#

what are you cooking

hazy sinew
steady fog
#

im going to eat your shoelaces

hazy sinew
#

lets see if i can do this

steady fog
#

oh its like

#

1 ahead

#

weird

#

i am so old

#

GUH

#

SEGMENTATION FAULT

#

fnsdjfs wtf

#

now i got 7297

hazy sinew
#

ok i dont think i can lace the shoes of this polygon

#

im gonna go study graph theory now

steady fog
#

my code kinda works

#

but when the starting point is in a different spot it explodes

hazy sinew
#

i dont think you can eat the shoes of an integer grid

steady fog
#

im going to eat your shoes

hazy sinew
#

what part is this

steady fog
#

1

#

i am stuck

hazy sinew
#

whats ur problem

#

send code

steady fog
#

i dont know

#

okay

#

its a mess

hazy sinew
#

put it through a translator i dont speak 💩

steady fog
#

how

hazy sinew
#

why is it 200 lines

#

what did you cook

steady fog
#

lots of duplicate code

#

i need like a table of directions and matching offsets

#

Up = (0, -1) etc

#

actually

#

hm

#

i am mixing up x and y again i think

#

yea

#

i will try once more

#

stilll..

solar tide
#

i just made a Tile struct of news, start and outside bools then made a giant ass match case for it

#

how do I measure perf in rust

real hinge
#

this is just dumb

steady fog
solar tide
#

isn't this p2

steady fog
#

my code thinks these are connected

#

guhhh

solar tide
#

you don't have to spoiler it anyway

real hinge
#

how are there even valid tiles then

hazy sinew
#

bro i was tryna figure out why my neovim syntax highlighting wasnt working turns out the file is called day10.txt not day10.cpp

steady fog
#

txt

hazy sinew
#

cuz it was message(3).txt

steady fog
#

am i gonna need to like

#

make a map of tiles that can connect

#

or something

hazy sinew
#

i think this check is longer than all of my code for 2023 combined

#

why did you make a class for the tiles

steady fog
#

idk

#

felt like it

#

@hazy sinew will fix my code

#

I usually overthink it

solar tide
#

write it in rust

#

rust analyzer is so anal and good

hazy sinew
#

or is it fitted for your input

#

Segmentation fault (core dumped)

#
bool isConnecting(char cur, char nei, int dx, int dy) {
    bool up = dx == -1 && dy == 0;
    bool down = dx == 1 && dy == 0;
    bool left = dx == 0 && dy == -1;
    bool right = dx == 0 && dy == 1;

    switch (cur) {
        case 'S':
            return (nei == '|' && (up || down)) || (nei == '-' && (left || right)) ||
                   (nei == '7' && (up || right)) || (nei == 'F' && (up || left)) ||
                   (nei == 'L' && (down || left)) || (nei == 'J' && (down || right));
        case '|':
            return (nei == 'L' && down) || (nei == 'J' && down) || (nei == 'F' && up) || (nei == '7' && up) ||
                   (nei == '|' && dy == 0);
        case '-':
            return (nei == 'F' && left) || (nei == 'L' && left) || (nei == 'J' && right) || (nei == '7' && right) ||
                   (nei == '-' && dx == 0);
        case 'J':
            return (nei == '7' && up) || (nei == 'F' && up) || (nei == '|' && up) || (nei == 'L' && left) ||
                   (nei == 'F' && left) || (nei == '-' && left);
        case 'F':
            return (nei == 'J' && down) || (nei == '|' && down) || (nei == 'L' && down) || (nei == '7' && right) ||
                   (nei == '-' && right) || (nei == 'J' && right);
        case '7':
            return (nei == 'F' && left) || (nei == 'L' && left) || (nei == '-' && left) || (nei == 'J' && down) ||
                   (nei == '|' && down) || (nei == 'L' && down);
        case 'L':
            return (nei == '7' && up) || (nei == 'F' && up) || (nei == '|' && up) || (nei == 'J' && right) ||
                   (nei == '-' && right) || (nei == '7' && right);
        default:
            return false;
    }
}

#

have fun

steady fog
#

my input gave me an answer but it was wrong

hazy sinew
#

i think ur check is completely wrong

steady fog
#

maybe

real hinge
#

bleh I gave up on part2

#

I kinda wanted to go as much as I can with gold stars but its getting dumber

#

at least my way of writing

hazy sinew
#

u dont have to come up with everything by urself

real hinge
hazy sinew
#

||count the number of times you cross the pipe to the left, if your S is either L J or | then count the number of times you touch a L J | or S to the left, if your S is not L J or |, then count the number of times you touch a L J or | (no S) to the left. If the number is odd then you are inside the loop, if it is even the you are outside, this is because of winding/knot/graph theory or whatever, where if you have a simple loop that is just a circle/square, to get out you would have to cross it once, and if you are outside, you would have to cross it 0 times to get out. Because your pipes are 1 continuous loop in 2d space, they can be unfolded into a circle in 3d space (if you move segments of the pipe over/under eachother)||

proper totem
hazy sinew
#

tomorrow will be matrix multiplication

#

i already know

solar tide
#

love it when [13/13] [1377/1980] Codegen (bc+obj)

#

compiling crystal from source

real hinge
#

I dont get the logic behind it

hazy sinew
#

imagine this is your pipe system

#

you want to get all the points inside

native pewter
#

tf are they cooking today

hazy sinew
#

you see how orange is outside and blue is inside

#

||and you can see, if you go to the left of the orange point, it crosses 4 pipes, and if you go to the right it crosses 2 pipes, if you go to the left from blue it crosses 3 pipes and right of blue 5 pipes. because there are no knots in this pipe system, we can preserve the relative positions of the points and move the pipes to make them form a rectangle, notice how the blue point has exactly 1 pipe crossing until it escapes to the outside because its inside a rectangle and obviously needs to cross one of the sides in any direction to get out, and the orange point doesnt, or it can cross an even amount of points and still end up outside, so basically to switch states from inside to outside or vice versa, a point needs to cross exactly 1 pipe||

#

||which is why you can just count the number of L J and | to the left (after replacing S with the correct pipe) and add 1 to the area if its odd, and add 0 to the area if its even||

#

||when you are out of bounds of the grid, you will be guaranteed outside the pipe loop, so we are counting the number of steps we need to get there, and if its even it means we started already outside, if its odd it means we started inside the loop||

#

||make sure youre counting the pipes that belong to the loop not the junk pipes, so you basically have to calculate the loop path from part 1 again||

real hinge
#

I think I got the logic

#

lets try

#

I am checking both left and top but its giving big on example

tranquil vapor
#

IS IT PATH FINDING

tranquil vapor
real hinge
#

there is only one way it can go

#

but still uhhh

#

maybe

hazy sinew
hazy sinew
real hinge
hazy sinew
#

why is ur vps not on windows 10

real hinge
#

oracle said no

hazy sinew
#

why r u using a vps

real hinge
#

to solve aoc even when I am in university I am working on vps

hazy sinew
#

delete visual studio

hazy sinew
real hinge
#

ssd full

#

I was running libux on my sd card

hazy sinew
#

get a new ssd

real hinge
#

but it keeps getting corrupted

real hinge
hazy sinew
#

libux

real hinge
#

poor trolldayruined

hazy sinew
#

this seems like a terrible solution

#

how is it set up

#

are u paying for it or hosting urself

real hinge
#

it is working decently tbh

real hinge
#
  • using vscode remote ssh extension
#

I dont even notice difference

hazy sinew
#

why are u using vscode

real hinge
#

it feels like local

real hinge
hazy sinew
#

are you a paid actor by microsoft

real hinge
#

yes

#

I mean no

#

perhaps

tranquil vapor
#

vscode is the best wdym

#

why would she not use vscode

real hinge
#

WDYM SHE

tranquil vapor
#

sorry typo

real hinge
#

good

#

you scared me

hazy sinew
tranquil vapor
#

i hate Microsoft actually

#

but vscode is fire

hazy sinew
#

i dont understand how one can unironically use vscode

real hinge
#

idk man some people just want to write code normally

#

it doesnt have any bad sides

hazy sinew
#

ITS NOT NORMAL

real hinge
#

huge plugin support

#

how

#

which part

hazy sinew
#

IM A NORMAL PERSON USING VISUAL STUDIO CODE (IT HAS HUGE PLUGIN SUPPORT)

hazy sinew
#

neovim probably has better plugin support than vscode

#

so does any jetbrains produc

#

t

real hinge
#

at that point its just choice

#

intelliJ IDEs use billion gbs of memory

#

for simple stuff like JS I wouldnt use intelliJ

hazy sinew
real hinge
#

I also dont have any reason to use vim

#

vscode resource usage is fine

#

its pretty fast

#

and uhhh thats all I want

hazy sinew
#

me when i have to move my hand to my mouse and then use the scroll wheel to scroll down to the line i want to edit

real hinge
#

wdym

#

vscode has billions of keyboard shortcuts too

#

it even has vim extensions

hazy sinew
#

vim still better

#

vscode with vim extension is just vim but less efficient slower and bigger

real hinge
#

eh I dont really know

#

I never thought vscode was slow

hazy sinew
#

it isnt but there is no advantage to it

#

its slower than a terminal

tranquil vapor
#

jetbrains is very slow and bloated
vim is unusable for normal people who aren't on 10kg of adderal
vscode is perfect, smooth, lightweight, and very good ide features

tranquil vapor
#

yes? that's what an opinion is

#

im just telling u my opinion, ofc it's biased 😭

hazy sinew
#

vscode is very slow and bloated, is basically a text editor, doesnt even have a built in compiler
jetbrains is perfect, smooth, not too heavy and very good ide features
vim is perfect, smooth, lightweight, and very good ide features

tranquil vapor
#

okay that's ur preference

real hinge
#

how is jetbrains smooth

tranquil vapor
#

i disagree but that's fine

real hinge
#

everytime I open a gradle project I need wait at least 20 minutes

hazy sinew
#

pc issue

#

use vim

tranquil vapor
#

or just use vscode

#

which he prefers

#

why are we judging people for their ide choices

hazy sinew
#

were not juding people were judging ides

hazy sinew
tranquil vapor
#

omg can u just shut

#

noone cares just use what u want

real hinge
hazy sinew
#

let us cook 😭

real hinge
#

actually once loaded (after like 10 mintues) it doesnt really lag

hazy sinew
#

actually vim takes longer because you have to open terminal and enter the file name

tranquil vapor
#

timed u out for 5 minutes cause this is really not productive you're just shitting on other people's preferences

#

please just stop

#

this is advent of code, not insulting other people's ide preferences

#

anyway

#

did u solve yet @real hinge

real hinge
#

NO

#

only day 1

#

part 1*

tranquil vapor
#

DAY 1

#

INSANE

#

mantika so stupit he's still busy solving day 1

hazy sinew
hazy sinew
real hinge
#

not now

hazy sinew
#

u can cheese part 2 ||make a square exactly in the middle that is exactly 1/4 of the area of the actual grid, it will always contain every contained point and no outside points||

real hinge
#

oh m god

#

its finally done

#

determination (undertale referance)

#

thank @hazy sinew for idea

native pewter
sullen fiber
#

Is today good for uiua

tranquil vapor
#

no

#

its never good for uiua

sullen fiber
#

So that means it is

#

Ok Cool

#

Oh I looked at it

#

I don't think I wanna do this in Uiua

tranquil vapor
#

i hate this exercise omg

#

i will do it manually

sullen fiber
#

True

#

Wait I def want to do this in Uiua

#

@warped dust did u know when u copy arrays in Uiua they're copy on write

tranquil vapor
#

wait it seems harder than it is

#

i think

tranquil vapor
real hinge
sullen fiber
#

Yes they are

real hinge
#

VEN

#

STOP

sullen fiber
#

Everyone is but you

real hinge
#

the fall of vencord

#

nobody has motivation to live anymore

sullen fiber
#

I think imma actually get thru this years AOC

#

Would be the first

real hinge
#

I want do too

tranquil vapor
#

NO

#

VAP IS LYING

real hinge
#

but uoh we'll see

tranquil vapor
#

I WOULD NEVER USE UIUIUIUIDJASOIJFIOUJHWAHIFUJAJIOFWEJIOGEFW

sullen fiber
#

Uiui

hazy sinew
#

wee woo wee woo

sullen fiber
#

Uiuoo

real hinge
#

(day 39 solution in uiua)

sullen fiber
#

This is actually true

#

I don't think I can multithread my solution

#

I'm so sad

#

And I forgot the library opens at 12 on Sundays guhh

#

1 hour without AOC will kill me

solar tide
native pewter
native pewter
#

nonsensical argument at best

hazy sinew
solar tide
#

you are

tranquil vapor
#

AdVenT of Code

real hinge
#

very true

#

Ad Ven T

tranquil vapor
#

i (ad)vented amongustwerk

hazy sinew
#

advertisement ventilator of code

solar tide
#

you're smelly

hazy sinew
#

bro why are there no good graph theory courses

sullen fiber
#

Lectures and edited videos

#

YouTube and Wikipedia ez clap

#

im so glad uiua has an actual modulo operator

#

FUCK JAVASCRIPT

native pewter
#

what

hazy sinew
#

also imma start solving every day in kotlin and then in python

sullen fiber
#

I usually use them for foundational stuff and scour Wikipedia and some kinda stackexchange

#

My personal fav flow so far

#

part 1 in uiua is kinda real

distant kindle
#

part 2 is silly

sullen fiber
#

OH MY GOD PART 2 IS SO EASY

#

IM CRACKEd

distant kindle
#

yeah pt 2 seems not that hard once u think of smth

#

just a bit of thinking

#

i wonder if u can just brute force part 2 (check every single value individually) or if u gotta do it the smart way

sullen fiber
#

Checking if each individual point is inside the loop is prob harder lol

distant kindle
#

u might be right

native pewter
sullen fiber
#

oh my god the loop is ugly as shit

distant kindle
#

uhhh

#

why is this outside the loop?

#

its fully surrounded by loop chars

#

OH GOD

#

ok i got it

#

god this is hard

sullen fiber
#

Yay did it

#

That took a bit

distant kindle
#

looks like a dogf or smth

steady fog
#

pinch

sullen fiber
#

It's among u

distant kindle
#

i mean

#

thing

sullen fiber
#

Squint

distant kindle
#

yea

#

that

sullen fiber
#

Same thing

distant kindle
distant kindle
steady fog
#

do not

sullen fiber
#

Do u wanna know how I did it

distant kindle
# distant kindle ababababa how do i do this...

my current approach is just:
|| i have a recrusvie func visit_neighbours that marks all floor neighbours and visits their neighbours as well. then i find all floors that are on the outside and feed them into the func ||