#AdVENt of Code

1 messages · Page 12 of 1

distant kindle
#

it works fine but it doesn't work for those ones

sullen fiber
#

||floor?||

distant kindle
#

ground

sullen fiber
#

what

distant kindle
#

.

sullen fiber
#

oh

#

ok

#

||so to ur code, outside group = touches walls?||

#

idk if this is too much of a hint ||my solution basically just did a scan across the board and kept track of wall parity||

distant kindle
#

ill just stop here

#

i dont really feel like working on this further

#

i wanna eat and od other stuffs

#
def resolve_pipe_destinations(pipe : Char, x : Int32, y : Int32) : PipeDouble | Nil
  case pipe
  when '|'
    { {x, y - 1}, {x, y + 1} }
  when '-'
    { {x - 1, y}, {x + 1, y} }
  when 'L'
    { {x, y - 1}, {x + 1, y} }
  when 'J'
    { {x, y - 1}, {x - 1, y} }
  when '7'
    { {x, y + 1}, {x - 1, y} }
  when 'F'
    { {x, y + 1}, {x + 1, y} }
  when '.'
    nil
  end
end
#

how terrible is this

sullen fiber
#

if its not my solution its bad

#

💯

distant kindle
#

thats unironically so real

sullen fiber
#

its not in uiua so its bad

#

@tranquil vapor rate

distant kindle
sullen fiber
#

oh does that tell u like

#

how to change direction

distant kindle
#

it just gives the next point

sullen fiber
#

thats kinda real

#

i made it into a formula cus i didnt want my uiua to be ugly

distant kindle
#

i didnt know of a better way to know which of the two points a pipe connects to is the one i need to take

steady fog
#

yes

sullen fiber
#

of who

distant kindle
#

no

steady fog
#

ven

#

@distant kindle you are ven

sullen fiber
#

wait

#

holy shit

native pewter
#

r u lacking neurons

distant kindle
sullen fiber
distant kindle
sullen fiber
#

are u doing 2 simultaneous walkers

steady fog
#

@distant kindle@distant kindle@distant kindle

distant kindle
#

yeah

#

i walk into both directions from start at once

#

one step per loop step

#

until they meet

sullen fiber
#

i was gonna do that too

native pewter
sullen fiber
#

so i could put them in threads

distant kindle
#

THREADS

sullen fiber
#

but the input is tinyyy

distant kindle
#

i didnt use threads wtf...

#

i just found it easier this way cause otherwise ur steps are gonna be like

S12
703
654
#

instead of

S12
103
234
sullen fiber
#

yea i just got 8

#

and /2

distant kindle
#

ohhh thats real tbh

#

idk why i didnt think that way

sullen fiber
#

i should use spoilers

steady fog
#

vapwill be vaporized

sullen fiber
#

i fogro

distant kindle
#

wtf yeah thats so much easier than mine 😭

#

its joever

sullen fiber
#

joe is here

distant kindle
#

i will go eat

#

my solution today was incredibly ugly

sullen fiber
#

mmm food

distant kindle
#

hardest pic ive seen in a while

#

why are they mushrooms

native pewter
#

what

sullen fiber
#

it looks like batman scarecrow

native pewter
#

halloween concert

sullen fiber
#

god i dont have the time to make large inputs this week

#

: ( ( ( (( (

#

maybe tmr will be easy and i can pump out a few at the library

distant kindle
#

ATT HE LIBRARY

native pewter
#

oh right youre like in fl or wtv

native pewter
#

library goes hard tho

distant kindle
#

that is true

tranquil vapor
#

fix the todo

sullen fiber
#

I wish I could code on phome

tranquil vapor
#

YOU CAN

#

termux so good

sullen fiber
#

Doubt

#

I'll check it out maybe

hazy sinew
#

DO NOT FLOOD FILL

native pewter
#

bouta flood fill your a-

distant kindle
#

yeah I did flood fill

hazy sinew
#

||did u just x2 the grid||

distant kindle
#

no

#

the image u replied to shows why flood fill doesn't work

#

cause there's that one 0

sullen fiber
distant kindle
#

what's that supposed to mean

#

idgi

solemn python
#

actually doing d10p2 w/o cheating rn

#

||Extended the input vertically||

sullen fiber
#

Part 10

distant kindle
#

do u mean like || u multiply all coordinates by 2 so that there's proper gaps between pipes when they're touching ||

distant kindle
#

that was my idea but i was kinda too lazy to try

solemn python
#

||all the Xs are artificially added points, and I made it connect the pipes correctly||

#

||ok ive successfully duplicated all points, now to figure out how the hell to flood fill||

steady fog
#

@t.y.y

#

@solemn python tyminky

solemn python
#

@steady fog@steady fog

#

||after copying the first floodfill algo from wikipedia I have successfully done shit||

#

||. = non-pipe in original input, x = non-pipe after extending input, + = flood-filled part||

steady fog
solemn python
#

||ok now + is only the flood-filled tiles that were in the original input, and = is flood-filled tiles that weren't, so I should just be able to subtract the total non-pipe tiles beforehand with the amount of +s hypothetically||

sullen fiber
#

Real

sullen fiber
distant kindle
#

floodfill is super easy with recursion

solemn python
#

because I have no clue how it worked

sullen fiber
#

Recursion fear

solemn python
#

now I do

#

learning experience

proper totem
#

recursion is one of the things that's like "wow that's really neat" and then once you try using it more you realize "wow this actually sucks how can i make a loop"

tranquil vapor
#

it depends

#

a lot of things are so much easier with recursion

#

some others arent

solemn python
#

recursion actually works pretty well in rust with this specific example

sullen fiber
#

Recursion always works well when ur not recursing too much

solemn python
#

I just store the current input in a variable that can be accessed from any level of the recurion function

sullen fiber
#

Tbh

proper totem
#

a lot of stuff is easier with recursion yeah but depending on your lang/implementation you're limited by the stack length

solemn python
#

and then I don't have any cloning issues like I did before

distant kindle
solemn python
#

also my recursive function returns nothing so that helps

distant kindle
#

nono

#

i didnt even solve pt2

#

and im not gunna

solemn python
#

YOP

sullen fiber
#

Make if I can on phone

proper totem
#

I was using recursion for p1 today but in node recursion didn't work today since max stack length is only like 3000 calls in js

distant kindle
#

huh how do u do recursion in pt 1

solemn python
#

p1 recursion?

#

seems overcomplicated

distant kindle
#

yeah recursion for pt1 seems like one of those aforementioned cases where a loop is better

proper totem
#

I was doing a full search because initially i assumed that since you didn't know what S was it could be connected to multiple possible loops and you had to find the "real" loop

#

and then I decided to be smart and actually look at the input

sullen fiber
#

True

#

That would have been so mean

proper totem
#

The fear you'd feel if your S looked like this```
.|.
-S-
.|.

distant kindle
#

it tells u it's one single closed loop

#

:p

proper totem
#

yes but

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

that is also, still, one single closed loop

#

you just don't know what S is without checking first

solemn python
#

177 lines of code blobcatcozystars

#

not super fast but meh who cares its the fun way to do it

#

smart solutions are for nerds

proper totem
#

i do think the way you did it is more satisfying

solemn python
#

yeah

proper totem
#

i like the visual solutions

solemn python
#

don't tempt me to make this compile to wasm just so I can visualize it easily

sullen fiber
#

Ooo u give me the best idea

proper totem
#

||i just wanted to see pretty flood fill||

solemn python
#

LOVE

#

now I feel the need to do that

#

😠

proper totem
#

my ||flood fill|| loop became super cursed in order to make it be non-blocking

#

so the canvas could update

#

it's not that cursed I guess but using requestAnimationFrame as a while loop kinda gross xd

tranquil vapor
#

i should make it not do diagonally

#

would probably look better

#

OH GOD

#

I DID NOT OPTIMISE THIS FOR LARGER GRIDS

#

why is this so satisfying wtf

steady fog
#

guh that's cool

#

@tranquil vapor Im doing day 10 in c++

#

do you love

sullen fiber
#

||Me figuring out how to formula the corner pipes||

steady fog
#

goemyty

distant kindle
#

insane

solemn python
#

horror

#

Is that for solving or large input

steady fog
solemn python
steady fog
#

you

solemn python
#

vap do be writing an essay

sullen fiber
#

Basically ||I kept track of my direction as a number 0 right 1 up 2 left 3 right called d, and I got the index of the corner pipe in "J7FL" called it m, and the new direction after moving into a corner pipe is ((-1)^m - d) % 4||

#

Idk if that's right u might have to swap the subtraction terms

sullen fiber
steady fog
#

why does vscode try to run all my language extensions at once

#

can it only run them when necessary

sullen fiber
#

Yes good ones usually only spin up when they see the file in the project or a file type gets opened

steady fog
#

would they automatically stop

#

when the file is closed

sullen fiber
#

I don't think so

steady fog
#

guh

solar tide
solemn python
#

fear the wasm

#

wasm is so fun

steady fog
#

NO

#

INSANE

proper totem
#

is that your session cookie

steady fog
#

doing zig today blobcatcozy

solemn python
#

so it can fetch input

proper totem
#

what if I wrote wasm in wasm

#

like the actual asm opcodes

#

would be fun blobcatcozystars

solemn python
#

wasm has a verbose format so I mean

#

yeah

#

could be interesting

steady fog
#

GOGOGOGOGO

solemn python
#

anyways d11 time

#

darn

proper totem
#

nooooo

#

terrible

solemn python
#

had my hopes up this would take 2 seconds then they did that

#

smh

steady fog
#

ogh my god

#

im looking at how to read a file in zig

solemn python
#

I honestly have no clue how to start this

#

I initially went "oh just use pythagorean theorem" but no you can't do that

#

hm ok I have an idea but

#

hm

steady fog
#

ok it reads the file

#

good

solemn python
#

WAIT A MINUTE

#

ok fuck this lmao

#

if my hypothesis is correct

real hinge
#

Today is pathfinding for real

steady fog
#

oh god

#

this is evil

real hinge
#

What if galaxies collapse

#

Game doesnt tell anything then ig its fine

#

Anyway looks fun

steady fog
#

what if i collapse you

#

i wonder if others are gonna do my idea i have

#

for expanding the rows/cols

#

might kill mantika not usrer

hazy sinew
#

my wifi broke

#

so i took long

#

😭

steady fog
#

zig is evil

hazy sinew
#

its super easy ||the path is just the manhattan distance and so you take the amount of columns that is in between two galaxies and add them to the path||

solar tide
#

is my interpretation of the example correct about 36 pairs
1 galaxies (1 #) = 2 galaxy
when the universe was expanded, they doubled so as I believe, so this is now:
1 galaxies (1 #) = 4 galaxy

so 9 galaxies * 4 galaxy = 36

hazy sinew
#

works for part 2 as well

#

galaxies are constant

#

what do u mean galaxies * galaxy

#

its just 9 galaxies

steady fog
#

i love finding some random github issue with the answeri need

#

zig has a matrix function

solemn python
#

ok p1 done

#

and of course p2 is the same old "now fuck you, be smarter about it" crap

steady fog
solar tide
teal mountain
#

today wasn't too bad but i spent about 5 minutes working out why the fuck "pairs" weren't galaxies with every other galaxy

solar tide
#

the only confusing part for me is where does 36 come from

teal mountain
#

yeah that's exactly what i mean

solar tide
#

I haven't started yet

steady fog
#

today is easy just im struggling with the lang

solar tide
#

can you explain this, eage probably is afk

teal mountain
#

universe expansion does not change the amount of galaxy

#

just the amount of space between them

steady fog
#

yea

teal mountain
#

the pairs are done ||for i, j where j > i||

#

so ||galaxy 1 is paired with 2 .. 9
galaxy 2 is paired with 3 .. 9
galaxy 3 is paired with 4 .. 9||

#

etc

#

you get to ||8+7+6+5+4+3+2+1|| = 36 pairs that way

steady fog
#

day-11-zig.zig:7:32: error: type '[][]const u8' does not support array initialization syntax
var universe = [][]const u8{};

#

Die

solemn python
#

every unique combination of galaxies, ignoring ordering

steady fog
#

im going insane

proper totem
#

I was stuck on part two for so long because of an off by one error cri

solar tide
#

oh got it

#

thanks @teal mountain @solemn python

#

the puzzle phrasing is a bit off for me but this is it

proper totem
#

thank you jetbrains for being smart

solar tide
#

does rust have an itertools crate

real hinge
teal mountain
#

that's really good actually lol, i wonder how that works

#

is it AI or something

proper totem
#

they do have something like copilot but it's an additional license that I don't have

#

so I don't think that would be it in this case

teal mountain
#

although i guess you would be doing something like that when rotating a matrix

solemn python
#

ok today isn't ot bad

solemn python
#

just add "itertools", then use itertools:IterTools; and then you can call .combinations(2) on any iterator to get the pair combinations

#

anyways today isn't bad at all tbh

proper totem
#

once you don't do the ||lazy parse of keeping everything in a 2d array|| it's pretty easy

solar tide
#

did p1

solemn python
#

nice

steady fog
#

my bones are soaking

teal mountain
solemn python
#

||i love pooping from xmin..xmax||

#

||but I just stored the indexes of blank columns/rows, then after finding galaxies I add <amount of empty to the left> * 999,999 to the coordinates in both directions||

steady fog
#

my pc made an evil noise

real hinge
solemn python
#

first of all that isn't a method

steady fog
#

@real hinge work

real hinge
#

.chunks(2)

solemn python
#

that just pairs them up

real hinge
#

Javascript rotten my brain

solemn python
#

which is a very different thing than combinations

real hinge
#

How

real hinge
solemn python
#

combinations draws a line between every possible pair

real hinge
#

Do you mean like
1,2
2,3
3,4

#

Oh

#

It gets all combinations

#

Okay fair

solemn python
#

well for 3 galaxies
1,2
1,3
2,1
2,3

real hinge
#

I thought it combined 2 values trol

solemn python
#

actually that has a repetition

real hinge
#

Op

solemn python
#

idk how combinations work, thats why I used a lib lmao

steady fog
#

guh

solemn python
real hinge
#

Just 2 for loop no?

solemn python
#

idk

#

probably

steady fog
#

ok zig is too cursed for this

solemn python
#

rust is rotting my brain

#

I had to write a JS for loop

steady fog
#

im having issue with expanding the blank lines

#

cause it causes indices to change

solemn python
#

and stared at my invalid syntax for a few minutes before remembering parentheses exist

solemn python
#

and added that to the insert index

#

¯_(ツ)_/¯

steady fog
#

that would probably work

solemn python
#

guhhhh

#

AND I FORGOT ABOUT IN VS OF

#

this is concerning

steady fog
#

thread 38123 panic: index out of bounds: index 11, len 10

solemn python
#

thats a lot of threads

steady fog
#

yes

#

day-11-zig.zig:18:18: error: no field or member function named 'replaceRange' in 'error{OutOfMemory}!array_list.ArrayListAligned([]const u8,null)'

#

what

solemn python
#

GUHHHHHH CORS

#

fuck cors

#

won't let me fetch inputs

real hinge
solemn python
#

what

real hinge
#

You did wrong

solemn python
#

what

steady fog
#

mantika is a genius

#

oh guh this wont work

#

nvm itll work

#

finally

#

i got it adding expansion

real hinge
#

the boring lesson started

#

lets start working on aoc

steady fog
#

@real hinge you love zig

#

it's so strict with compile time and runtime

real hinge
#

nop

real hinge
#

@steady fog you love

steady fog
#

best

sullen fiber
#

Omg

#

It's so late

#

Time to set my alarm so I'm not late to the library

#

Today is such a layup for uiua can't wait

#

@hazy sinew global #52 did it in Uiua

solemn python
sullen fiber
#

Oh I read "now" at the end somehow

#

Help

solemn python
#

yes I've been using javascript/typescript for years, I just got so used to rust syntax for a bit

solar tide
sullen fiber
#

Me in js when I wanted traits

warped dust
#

we need betterscript

solemn python
#

isn't that just typescript

solar tide
#

no

warped dust
#

typescript is just java with types

solar tide
#

coffeescript is the real king 👑 🚀

solemn python
#

Also *javascript

warped dust
#

java.

sullen fiber
#

Web script with good runtime

#

Soon

steady fog
#

I hate typescript

warped dust
#

coffeescript is actually kinda onto something

sullen fiber
#

Prototype chains were a mistake

warped dust
#

YES

steady fog
#

rininininiininini

solar tide
#

coffeescript is kinda dead now

#

civet is good though

sullen fiber
#

instanceof should be O(1)

warped dust
#

you love they only realised that on es6 and added classes but its just more prototypes

solemn python
#

All of javascript was a mistake
At least typescript makes it mostly tolerable

#

That's my experience

warped dust
#

javascript was literally made in 10 days

solemn python
#

@sullen fiber make uiua compile to wasm and script with that

warped dust
#

by one guy

sullen fiber
#

It does

solar tide
#

gonna make my own programming language

warped dust
#

HEY DID YOU KNOW IN AN ALTERNATE TIMELINE WE WOULD HAVE SCHEME ON BROWSERS

sullen fiber
#

Its in rust and the Uiua online pad uses wasm

solar tide
#

as any redpilled aoc player does eventually

sullen fiber
#

You love

warped dust
#

FUCKING SCHEMEEEEEEEE

#

I NEED

solemn python
sullen fiber
#

I wish sharedmemory was still real

#

It makes me so sad

steady fog
#

steal your memory

warped dust
#

In 1995, Netscape hired Brendan Eich with the promise of letting him implement Scheme (a Lisp dialect) in the browser. Before he could get started, Netscape collaborated with hardware and software company Sun (since bought by Oracle) to include its more static programming language, Java, in Navigator. [...]
By then, Netscape management had decided that a scripting language had to have a syntax similar to Java’s. That ruled out adopting existing languages such as Perl, Python, TCL, or Scheme. To defend the idea of JavaScript against competing proposals, Netscape needed a prototype. Eich wrote one in 10 days, in May 1995. [...] In early December 1995, Java’s momentum had grown and the language was renamed again, to its final name, JavaScript.

#

scheeeeeeeeeeeme

#

kill netscape

#

nvm they died already

#

kill them again

sullen fiber
#

Thank GOD

warped dust
#

YOUR MOM

steady fog
#

I'm going to shave rinis enamel

warped dust
#

scheme has very simple syntax which means you could easily compile even more things to it

steady fog
#

WHAT IS SCHEME

warped dust
#

lisp

steady fog
#

oh it's lisp

#

nop

#

absolutely forget it

#

lisp has nothing good

warped dust
#

lisp has macros defined as lisp functions

#

thats like the most extensible you could ask

real hinge
#

WHY IS IT SO BIG

warped dust
#

im right

real hinge
#

it worked on example

warped dust
#

@sullen fiber im right

#

we must go to the past and kill bread eighch

sullen fiber
warped dust
#

lisp's data type is literally lisp syntax

sullen fiber
#

So they only allow lisp syntax

warped dust
#

whar

#

i mean lisp is cracked at making macros for itself

sullen fiber
#

Can't make html in lisp

#

BAD

warped dust
#

can

sullen fiber
#

HOW

real hinge
#

DIEDIEDIEDIE

steady fog
#

you will still not have solved when I'm up

real hinge
real hinge
hazy sinew
#

i got destryoed today

#

woke up at 5.40, sick and extremely dehydrated, had an arch linux moment (wifi randomly stopped working at 6:02), so after not realizing for 5 minutes i had to reboot

#

ended up with a 20min run

#

to prove this, i did column.filter { it != '.' }.isEmpty() instead of column.all { it == '.' }

real hinge
#

today was easy

#

thankfully

tranquil vapor
real hinge
real hinge
#

@tranquil vapor do aoc

tranquil vapor
#

soon

real hinge
#

You didnt even do yesterday

real hinge
#

Do

warped dust
#

i gave up best choice ever

distant kindle
#

avent of code time

#

jumpscare

native pewter
distant kindle
#

dont slap

native pewter
#

ill

#

dung fella

eternal marlin
#

advent of code players when i vent into their ad

hazy sinew
#

i have a feeling day 23 or 24 is gonna be interdimensional travel

distant kindle
#

yea

native pewter
#

only took me an hour!

distant kindle
#

noob

#

i havent started yet but it seems really easy

native pewter
real hinge
#

@tranquil vapor do aoc

distant kindle
#

lmao part 2 is troll

#

part 1 was easy

real hinge
#

part2 isnt so bad too

#

WHY ARE YOU ON ALT

distant kindle
#

but i have to get a new idea for part 2 blehhhjolly

real hinge
#

did you walked the nodes in part1

distant kindle
#

i just inserted new rows/cols in part 1

#

then did math on the indexes

real hinge
#

oh

distant kindle
#

i doubt i can just insert 1000000 rows

real hinge
#

yeah I did same

distant kindle
#

or can i

real hinge
#

DONT

#

PLEASE

#

theres other way

distant kindle
#

how much memory will it take

real hinge
#

idk didnt try

#

but at least few gbs probably

distant kindle
real hinge
#

so char array

distant kindle
#

|| just walk and count how many empty rows/cols u cross ||

#

ig

real hinge
#

100 char per row if we say 100 bytes

#

100* 10000000

#

dont even want to calculate

real hinge
#

|| I just stored all empty row and column indexes in some array and added to result by adding 99999999 (1 billion - 1) per row, column ||

#

do day 10 part 2 ehen

#

@distant kindle

distant kindle
#

annoying

#

i will just not use an enum

#

literally same function for both parts

real hinge
#

Now 10 p2

distant kindle
#

nop

distant kindle
#

||

pairs.each do |p1, p2|
    i1, i2 = [p1[0], p2[0]].sort
    j1, j2 = [p1[1], p2[1]].sort

    steps1 = steps2 = -2

    (i1..i2).each do |i|
      steps1 += map[i][j1] == BlankLine ? 2 : 1
      steps2 += map[i][j1] == BlankLine ? 1000000 : 1
    end
    (j1..j2).each do |j|
      steps1 += map[i2][j] == BlankLine ? 2 : 1
      steps2 += map[i2][j] == BlankLine ? 1000000 : 1
    end

    sum1 += steps1
    sum2 += steps2
  end

||

real hinge
steady fog
#

ven loves zig

#

zig is so cursed

distant kindle
#

wait why did i use bigint

#

int64 is enough

steady fog
#

why did you

distant kindle
#

3ms too slow

#

we need to optimise @real hinge

steady fog
#

OPTIMIZE

#

ven help me

native pewter
distant kindle
real hinge
distant kindle
#

you only do part 2 for input

#

cheating

native pewter
real hinge
#

I am too lazy to make funtion work for both parts

#

but its pretty much doing same stuff

distant kindle
real hinge
#

wait

#

I think I d

#

include_str! embeds file to binary right

distant kindle
#

yes

real hinge
#

good

#

my code is faster

sullen fiber
real hinge
#

except you used uiua

sullen fiber
#

I did it better cus I had to in part 2 tho

#

Except I'm doing twice as much work as I need cus idk how to not in uiua

#

😭

#

Idk how to only get like one half of a table

steady fog
#
try row.insert(char + insertedCol, '.');```
distant kindle
#

i embedded it as string and it made it slower

#

sane

steady fog
#

@distant kindle YOU

#

why

steady fog
#

ven is so mean

#

mantika is nice

distant kindle
#

freya is nice

steady fog
#

yop

real hinge
#

you guys wouldnt believe what freya said in my dms

native pewter
native pewter
hazy sinew
#

this video came out 8 months ago and i just randomly stumbled upon it

#

bro this channel is so good

#

🔴 Learn graph theory algorithms: https://inscod.com/graphalgo
⚙ Learn dynamic programming: https://inscod.com/dp_course
💡 Learn to solve popular coding interview problems: https://inscod.com/50problems_course
⌛ Learn time and space complexity analysis: https://inscod.com/complexity_course
🔁 Learn recursion: https://inscod.com/recursion_course
NB...

▶ Play video
sullen fiber
#

@warped dust an old person came up to me and asked if I was writing APL

distant kindle
#

are u

sullen fiber
#

No it's UIUA

#

But it's very much like APL I think maybe

#

Idk APL but it looks the same

distant kindle
#

how old is old

#

help what is this

#

how do people code in this

native pewter
#

if they know apl, theyve gotta be a god programmer

sullen fiber
#

They're prob in their 70s

#

Yea we talked about assemblies and compilers and rust

sullen fiber
sullen fiber
tranquil vapor
#

vap u should learn apl

#

use apl tmrw

sullen fiber
#

FEAR

#

no thank u

#

uiua better

#

oml

#

i cant use perf on github codespaces 💔

#

its so over

real hinge
#

use COBOL

#

@sullen fiber

sullen fiber
#

NO

sullen fiber
#

@proper totem im writing a wavefunction collapse thing for the aoc

#

might make it easier to generate

#

ngl i didnt look up how wave function collapse works exactly but i watched some videos on CDCL last night and imma assume its the same thing

real hinge
tranquil vapor
#

what the hell is this

sullen fiber
#

STOP

real hinge
tranquil vapor
#

manti probably uses this

real hinge
#

yop

tranquil vapor
fallow fern
#

terrible

#

explode

#

i dont do aoc horrible

solemn python
solemn python
fallow fern
#

no

solemn python
#

yes

fallow fern
#

too many projects to work on

#

no time for dumb exercises

real hinge
#

insane

#

aagamer doesnt read

sullen fiber
fallow fern
sullen fiber
#

but it uses the name as like an analogy

solemn python
fallow fern
#

see i just focus on starting more

sullen fiber
#

its like a tile map generator, where you put constraints on how tiles can be touching

tranquil vapor
solemn python
fallow fern
#

i know but now i get pings for everything here

#

tro

tranquil vapor
#

aagamer is the average vencord user who doesn't read existing messages

fallow fern
#

nop

tranquil vapor
fallow fern
#

yes i did

tranquil vapor
#

blehhhjolly insane why are u still here

fallow fern
#

and then got pinged again 2s later trolley idc

tranquil vapor
#

HAHAHAHA

solemn python
tranquil vapor
#

@real hinge make a bot that monitors member list in this channel and pings aagamer whenever he leaves

fallow fern
#

STOPPPP

sullen fiber
#

true

#

but like

#

dont do it via message creat

sullen fiber
#

do it via message edit

fallow fern
#

NO

#

you are horrible

tranquil vapor
#

wait there's even an api method for adding members to threads

#

ve channel.addMember

ionic cargoBOT
fallow fern
tranquil vapor
#

yop

real hinge
#

but then he wouldnt get pinged

tranquil vapor
#

ve void channel.addMember("373833473091436546")

ionic cargoBOT
tranquil vapor
sullen fiber
#

undefined?!?

real hinge
#

now do setTimeout

solemn python
#

who was that

sullen fiber
#

oh void

solemn python
#

Oh aa

tranquil vapor
#

setInterval u mean

real hinge
#

yes

#

trol

native pewter
#

@fallow fern did you know

fallow fern
#

did you know

solemn python
#

I knew

real hinge
#

@fallow fern hello

fallow fern
#

STOP

tardy ore
#

AdVENt of Code

#

@fallow fern

fallow fern
#

HORRIBLE

tranquil vapor
#

LMAO stop bullying aa

#

@fallow fern

native pewter
sullen fiber
#

Why is America on left but Biden in right

#

Ok this image is amazing

native pewter
#

marlboro vs trans people

#

fight to the death

tardy ore
#

marlboro jumpscare

solemn python
#

And Britain is just on a whole other level of freedom

steady fog
#

@solemn python tyman country

solemn python
steady fog
#

@solemn python fix

solemn python
#

Fix

sullen fiber
#

Tonight will be impossible

steady fog
#

good

sullen fiber
solar tide
#

meow

#

I'm gonna eat but new puzzle is gonna be live in a minute blobcatcozystars

proper totem
#

get ready gamers

steady fog
#

@solemn python @sullen fiber @real hinge @hazy sinew @proper totem

#

hurry

solemn python
steady fog
#

HURRY

#

cause

sullen fiber
#

Ok fine I'll read before I go to sleep

real hinge
#

I am on way to school

#

Explode

steady fog
#

ok im not doing cobol

#

refuse

solemn python
#

so much story

#

guh

solar tide
#

another pipe like puzzle again?

solar tide
real hinge
#

I didnt get the exact problem

#

But doesnt seem hard

steady fog
#

im using V lang

solemn python
#

FUCk i just spilled my drink on my laptop

proper totem
#

i dislike this one

real hinge
#

Just calculating possibilities I think

solar tide
#

what does contiguous group of damaged springs mean?

solemn python
#

consecutive

#

is a better way to put it

solar tide
#

actually that paragraph alone doesn't make sense to me

solemn python
#

nice markdown ven

#

i escaped it smh

solar tide
#

is ok

steady fog
#

mantika moment

proper totem
#

part two is either going to be incredible easy or going to kill you with math

solemn python
#

what if I do this the stupid way

#

this doesn't seem horrible to bruteforce

#

but thats also probably not p2-proof

real hinge
#

Just brute force trol

proper totem
#

I'm not sure how you would not brute force this one

real hinge
#

You will think p2 later

proper totem
solemn python
#

input lengths aren't constant tho

#

so idk

steady fog
#

@proper totem hi

proper totem
#

hewooos

steady fog
#

spoob

proper totem
#

brute forcing this shouldn't be too resource intensive though

sullen fiber
#

This one is cracked

proper totem
#

there's not too many solutions

sullen fiber
#

That's true

#

Ok goodnight

solar tide
#

you finished it already?

real hinge
#

He said he'll just look at problem

steady fog
#

@real hinge j

real hinge
#

H

steady fog
#

i cant do this

#

hurting too much

#

tomorrow maybe

solar tide
#

have some sleep guys, don't stress it

hazy sinew
#

whats the math for part 2

solemn python
#

there
1 blocked message
now I can do my AoC peacefully without remembering leaderboards or people who are good at programming exist

#

anyways im bruteforcing it but im doing it the looping way so I don't have 893024903890432 allocations

hazy sinew
#

😭 😭 😭

steady fog
#

I have a fever

solar tide
real hinge
#

okay now that its time to write code

#

I am thinking

#

ho wdo you even brute force this

proper totem
#

bleh i know what i need to do but it is difficult to visualize this one in code

real hinge
#

1 inner loop for every '?' ?

#

actually it wouldnt cause so much iteration ig

proper totem
#

not really just spoilers just thinking out loud ||if it was just the ???? that needed to be worried about my current solution would work but you also need to worry about the existing broken springs||

#

||which makes the logic to fill things more complicated maybe? maybe I'm making things more complicated than they need to be||

#

bleh i have math finals tomorrow

#

I should be studying for those instead of spending all night on this

#

will come back later

real hinge
#

aoc more important

#

ignore maths

solemn python
real hinge
#

you will faile

solemn python
#

nop

#

the teacher said if we actually try and get lower than total grade, she will just put in our total grade so it doesn't go down

proper totem
#

I have ignored maths for most of the semester so the exam tomorrow is my hope to get my grade up a bit

teal mountain
#

i would much rather be doing the other kind of dp

solemn python
#

ok my thing works on the example, time to add --release and wait

#

oh --release is only 1.5s lol

hazy sinew
#

did u just cache it

solemn python
#

the debug test had me worried

solar tide
#

I'm going to do some funky memo shit

solemn python
#

dang

#

I tried the stupid way

#

on the second example line its taking forver

#

yeah um thats not feasable

#

i had to try ok

#

time to pull out my calculator and do some math

real hinge
solemn python
#

i don't know enough math theory for this 😭

#

Ti84s are so fun

real hinge
#

I am gonna die

#

its outputting 87 for 1 possibility input

solemn python
#

ok well I started on something

#

but my hypothesis is that ||if I can calculate the amount of possibilities of situations given the 1,2,2 grouping, I can just do some quick subtraction for the answer||

delicate crane
#

I can't figure out doing this outside of brute forcing

#

I found a nice NodeJS threading lib and am just gonna wait for the bruteforce

solar tide
#

||dyanmic programming||

real hinge
#

??????#?#?#?..???#?. 6,2
this line alone requires 40 million checks

#

this is bad

#

it increases factorially

solar tide
#

are you bruteforcing

#

oh when was I added here

real hinge
#

8 seconds

#

good enough ig

#

wait

#

part2

solar tide
#

let me try mine

#

HAHAHA lmao

#

well i guess you could make your bruteforce smarter ||cache the answers||

#
adventofcode/2023/12 on trunk [!?] is 📦 v0.1.0
λ time ./target/release/day
Part 1: 7633
Part 2: 23903579139437
./target/release/day  0.04s user 0.00s system 98% cpu 0.041 total
solar tide
#

I'm the anti bruteforce

#

well I did one in my crystal sol but ok

real hinge
#

guh ig I can just iterate through the dots and do the calculation logic

#

but I dont remember those from high school

#

too lazy to look up

#

I am thinking about brute forcing part2 too

#

but uhuuhuh

proper totem
solar tide
#

coolio

#

I should remove all my input.txts and gitignore it

real hinge
#

nop

solar tide
#

yes

#

Eric doesn't want people to put their inputs in source control

real hinge
#

who is eric

native pewter
#

eric cartman from south park

solar tide
hazy sinew
#

Good morning

#

time to write clean code and push it

#

and forget whatever happened at 6 am

real hinge
hazy sinew
#

I would like to post a picture but some people dont like such things in this chat

hazy sinew
#

I just know that its 11.40 and im tired

distant kindle
#

there are some "LGB" communities

warped dust
#

lesbian, gay, trans and vee

solar tide
#

lgtv

hazy sinew
#

although im personally a samsung user

sullen fiber
#

Lesbian gay trans vagi

steady fog
real hinge
#

@tranquil vapor part 2 is impossible

tranquil vapor
#

false I solved it

real hinge
#

need to make 10^30 big number comparisons to brute force

real hinge
real hinge
tranquil vapor
#

answer is 765

real hinge
#

your answer is too low

hazy sinew
hazy sinew
real hinge
#

I doubt it would work even if I cache the results

#

also I doubt memoization would work in my solution

tranquil vapor
#

and source?

solar tide
#

@tranquil vapor

#

same for puzzle text

#

I removed generating readme which contained the puzzle text in my aoc tool

sullen fiber
#

The reason is so clones are harder to make

#

Eric's reaction to me making an input generator for every day:

solar tide
#

would it be 1:1 accurate

native pewter
#

honestly with this day im so lost i got no idea explod

real hinge
#

doing it with brute force way is somehow easy

#

problem starts at part2

native pewter
#

idek how id brute force this shit Shion_Dizzy

hazy sinew
#

but it works for some reason

tranquil vapor
#

whats part 2

#

send in spoiler

hazy sinew
hazy sinew
#

||note the length of the answer||

tranquil vapor
hazy sinew
hazy sinew
#

just a "stop trying to bruteforce"

#

not even a cool story

#

except day 10

#

and the early days

solar tide
#

these leaderboard people are insane

hazy sinew
#

day 4, 5, 6, 8, 11, 12 are all haha gotcha cant bruteforce this one and then it takes 1 second to bruteforce on unmodified part 1

solar tide
#

it used to be in 5 minutes but now someone does it in 7 seconds

hazy sinew
#

on part 1 there is a LOT of time to be saved still

real hinge
sullen fiber
#

7 seconds 😭

real hinge
#

I check entire thing at once

hazy sinew
#

wtf bro

#

i have an or check in the code so i cant spoiler it

solar tide
hazy sinew
native pewter
#

i love ||

solar tide
#

oh lmao there was a pipe in your message

#

you could've just put it in a codeblock then surrounded it with spoilers

hazy sinew
#

||check only the first character, if its . then just drop it and go recursively, if its # then check if its delimited by a . at the end correctly and call recursive again for the next char||

#

i rewrote it to use hyper neutrinos refactored approach

hazy sinew
#

||```kotlin
a || b

#

see

tranquil vapor
#

u need to put ZWSP between the || lmao

#

discord moment

hazy sinew
#

nah i got a better solution

#

||```kotlin
!(!(a && a) && !(b && b))

tranquil vapor
#
infix fun <T> T?.OR(other: T) = this ? this : other

thing OR otherThing
native pewter
#

nutty

hazy sinew
#

certified kotlin moment

tranquil vapor
#

insane

hazy sinew
#

ternary doesnt exist in kotlin

#

? and : is used for elvis operator

tranquil vapor
#

explode

#

kotlin sucks

hazy sinew
#

nullable?.function()?.otherFunction() ?: nullCondition

#

youre basically outsourcing the null to the end

native pewter
#

thats insane

hazy sinew
#

wait shit

tranquil vapor
#
infix fun Boolean.OR(other: Boolean) = if (this) this else other
infix fun <T : Object> T?.OR(other: T) = if (this != null) this else other
native pewter
#

me when 0 or true

#

is 0

hazy sinew
tranquil vapor
#

right

#

i forgot kotlin cringe and only uses || for bools

hazy sinew
#

also why T : Object

hazy sinew
#

i dont think null is an Object

tranquil vapor
#

primitives?

#

you cant compare primitives to null

hazy sinew
#

youd have to do

infix fun <T : Object> T?.OR(other: T) = if (this != null) this else other
tranquil vapor
#

yes

hazy sinew
#

but why tho

#

this is just ?: written with 2 different characters of the same length

#
infix fun <T : Object> T?.OR(other: T) = this ?: other
sullen fiber
#

Ok library timd

#

Holy crap this is Uiuable

tranquil vapor
#

U CANT JUST SAY THIS EVRY DAY

native pewter
#

wee woo

sullen fiber
#

But it .... It's Uiuable 🙁

hazy sinew
#

somebody should solve advent of code using a breadboard and a bunch of CD4011 NAND gates

#

someone in our school made a calculator using only logic gates

sullen fiber
#

Ok will

hazy sinew
#

surely advent of code is doable too

hazy sinew
sullen fiber
#

I wanted to use my CPU asm but it's only 8 bits

#

And I didn't have time to make it 32 bit

#

Or however many id need to address the damn input

delicate crane
#

Github mobile

sullen fiber
#

github.

hazy sinew
#

folders for each day.

sullen fiber
#

SHIT UP

delicate crane
sullen fiber
#

i just commit the example inputs

#

i get the inputs thing but puzzle text doesnt make any sense

native pewter
sullen fiber
#

my part1 requires 5589352 iterations...

#

i have to find the math way guhh

solemn python
#

I've been trying

#

I think I might have a way but I need a bit more time to figure it out

sullen fiber
#

i thought of a more optimal way but its still so bad

#

requires too much code

solemn python
#

I just found how to calculate the possibilities for the 1,1,2 part (hint: a lot)

#

Now how do I get that number down to 4 lol

sullen fiber
#

yea i realize thats also what this article covers

#

it doesnt account for narrowing from partial solves

#

||but its kinda interesting i wonder if i can just iterate through the total known solves, the number is super small||

solemn python
#

Wdym ||known solves||

sullen fiber
#

||like, imagine if all you had was ??????????, basically a completely empty row that you must solve from scratch. the number of possible solves here is much smaller than 2^n. i wonder if you can just iterate through possible solves and count which ones match the known slots||

#

||btw if u dont wanna parse thru that whole article, basically the formula is nCr(n - r + 1, p) where n = len("#....?#"), r = sum(groups), p = len(groups)||

solemn python
#

Yeah I got that part