#AdVENt of Code

1 messages · Page 4 of 1

hazy sinew
#

hop on kotlin

native pewter
#

im good thanks

real hinge
#

hop on java

tranquil vapor
#

I will

#

will you send me money if i do today in java @real hinge

real hinge
native pewter
#

@real hinge pay me? pretty please

real hinge
#

I am poor

#

not asking for money is first rule of talking with turks

native pewter
#

should i assk for rakiya then

#

nvm thats balkan

real hinge
#

what is rakiya

native pewter
#

i forgor muslims dont alcohol

#

😭

tranquil vapor
#

send me 20 cents (average monthly wage in turkey) @real hinge

real hinge
#

I can stay hungry for 2 weeks

hazy sinew
real hinge
hazy sinew
#

when you were eight or when windows 8

real hinge
#

I

hazy sinew
#

when i was 8 i had opensuse

real hinge
#

haram

hazy sinew
#

so true

real hinge
#

opensuse is weird distro to start tbh

#

or actually you didnt say you started with it

hazy sinew
#

it was on my dads computer

real hinge
#

anyway using opensuse at 8 is weird

real hinge
hazy sinew
#

my first computer had ubuntu

hazy sinew
#

i had opensuse, ubuntu, windows 10, windows 11, ubuntu, arch

real hinge
#

I teached my dad how to use whatsapp web recently

hazy sinew
real hinge
#

thats very nice tbh

hazy sinew
#

they still use java 5 in some projects

real hinge
hazy sinew
#

they have java 17 projects with java 5 dependencies

#

i had to update some

#

its hell

real hinge
#

I dont get that

#

at least use java8

#

or 11

#

some lts version

#

why 5

hazy sinew
#

because dependencies that lost support at java 5

real hinge
#

arent there some new ones for java 8

hazy sinew
#

well yea but maybe some function name is different, removed, deprecated, logic changed
there is a script to update java 5 to java 8 but it doesnt always work

real hinge
#

hmm

#

considering the work

#

fair

hazy sinew
#

it pays decently but its SOOOO annoying

#

so much object converting

#

reading a table from a database means converting it to a badly written spaghetti class structure with a bunch of silly converter functions that are either named convert or convertToObjectname or toObjectName with capitalization differing in the same class from function to function and no naming standards, some start with uppercase, some dont, sometimes its TimeSeries, sometimes its Timeseries

#

its so inefficient

tranquil vapor
#

windows is better tbh at least you can run it on ur pc

hazy sinew
#

and the manager doesnt wanna switch to kotlin for new projects because it means "the team would have to learn kotlin" when theres interop and by using java they are just farming technical debt to the point where converting from a database table to a json file should be 30 seconds, but instead is 2 days

hazy sinew
tranquil vapor
#

they should make IslamOS

#

i'd use it

hazy sinew
#

translate the linux kernel to arabic

tranquil vapor
#

TRUE

#

whats "kernel panic" in arabic

hazy sinew
#

actually rewrite it in holy c with { being inshallah and } being alhamdullilah

tranquil vapor
#

ذعر النواة

hazy sinew
#

print إن شاء الله "Hello World" الحمد لله

#

to solve day 2 of aoc you do
input.readLines() إن شاء الله red will be less than 13 إن شاء الله green will be less than 14 إن شاء الله blue will be less than 15 الحمد لله الحمد لله الحمد لله

#

someone needs to make this

real hinge
#

I would use too

real hinge
#

if its working dont touch it

hazy sinew
real hinge
#

in that case

#

touch as less as possible

hazy sinew
#

i would just do the projects in kotlin but actually doing the task isnt the issue, its converting the objects and kotlin might cause more compatibility issues

real hinge
#

I doubt it would be problem

hazy sinew
#

they do but theres probably gonna be some incompatibility because it uses java 5 and maybe even java 1.x sometimes and i dont think kotlin supports java 1

real hinge
#

yeah that might be a problem

hazy sinew
#

lolcat unironically best linux command

#

hacking nasa using lolcat

tranquil vapor
#

bruhhh

#

i spent WAY too long on part 1

#

then part 2 i did in 2 minutes

#

i hate || 2d arrays ||

warped dust
#

rate my erlang

tranquil vapor
#

i cry

warped dust
#

god it was so horrible in it

tranquil vapor
#

WHY SPOILER FAIL

#

discord markdown parser so bad

warped dust
tranquil vapor
#

discord come on

#

|| ```rb
banana

warped dust
warped dust
tranquil vapor
#

LOL

#

discord

warped dust
#

put zwsp :3

tranquil vapor
#

|| i solved part 1 by doing a nested for loop from row-1..row+1 and col-1..col+1, so basically checking the square around it. so i just added a check for "*" and then wrote to hashmap with coords as key and then in that kept track of how many nums already saw it and the sum ||

#

so easy

#

but part 1 was pain

#

mainly cause i was dumbbbbb

daring marlinBOT
tranquil vapor
#

chomp chomp chomp chomp

daring marlinBOT
tranquil vapor
#

CHOMP

somber smelt
#

what does chomp do

warped dust
#

||for each line, i made a list of the part positions and number positions with their lengths, then for each line again i filtered out numbers based on if any part on the top or bottom line was >= pos - 1 and <= pos + len||

#

||which for part two i was forced to invert my logic||

warped dust
native pewter
#

WHY is copy ctx button lazy

#

im gonna

tranquil vapor
#

its rightTrim / trimEnd

somber smelt
#

oh ok

warped dust
#

no its just newline

tranquil vapor
#

@split heart run ```rb
puts "banana".chomp "ana"

split heartBOT
#

Here is your rb(3.0.1) output @tranquil vapor

ban
tranquil vapor
#

ban @warped dust

#

@split heart run ```rb
puts "banana".chomp "na"

split heartBOT
#

Here is your rb(3.0.1) output @tranquil vapor

bana
tranquil vapor
#

oh it only removes first

#

not all

#

my solution does so many out of bounds array accesses

native pewter
tranquil vapor
#

rust fans will cry

warped dust
#

.get(i) returns Option

solemn python
warped dust
#

[i] panics

tranquil vapor
#

so real

#
rini.get(12).unwrap();
solemn python
tranquil vapor
#

rate

solemn python
#
rini.get(12).expect("index out of bounds");
``` better
tranquil vapor
#

wait

#

what happens if u unwrap an Option<Option<*>>>

solemn python
#

whats the * mean

tranquil vapor
#

does it unwrap fully or only the outer one

solemn python
#

only outer

#

you would have to .unwrap().unwrap()

tranquil vapor
#

/run ```rs
println!("{}", Some(Some("banana")).unwrap())

split heartBOT
#

@tranquil vapor I received rs(1.68.2) compile errors

error[E0277]: `​Option<&str>`​ doesn't implement `​std::fmt::Display`​
 --> file0.code:2:16
  |
2 | println!("{}", Some(Some("banana")).unwrap())
  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `​Option<&str>`​ cannot be formatted with the default formatter
  |
  = help: the trait `​std::fmt::Display`​ is not implemented for `​Option<&str>`​
  = note: in format strings you may be able to use `​{:?}`​ (or {:#?} for pretty-print) instead
  = note: this error originates in the macro `​$crate::format_args_nl`​ which comes from the expansion of the macro `​println`​ (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error

For more information about this error, try `​rustc --explain E0277`​.
chmod: cannot access 'binary': No such file or directory
/piston/packages/rust/1.68.2/run: line 4: ./binary: No such file or directory
tranquil vapor
#

ah yea

#

/run ```rs
println!("{}", Some(Some("banana")).unwrap().unwrap())

solemn python
split heartBOT
#

Here is your rs(1.68.2) output @tranquil vapor

banana
tranquil vapor
#

funny

native pewter
solemn python
#
rini.get(12).unwrap_or_else(|| panic!("index out of bounds"));
``` even better actually
tranquil vapor
#

terror

tranquil vapor
#

but ig that might be undesired

#

xd

#

but also why cant it print Options

#

can debug print option

#

/run ```rs
dbg!(Some("banana"));

split heartBOT
#

@tranquil vapor I only received rs(1.68.2) error output

[file0.code:2] Some("banana") = Some(
    "banana",
)
solemn python
#

might be unintended to reveal the inner workings of the language in a simple print statement ¯_(ツ)_/¯

#

formatting a string or a number is normal, but Options/Results are rust construct

solemn python
#

not something someone would expect to see without deliberately trying to format it that way

tranquil vapor
#

i was gonna say it seems useful for debugging

#

then i remembered dbg! exists

#

and yeah dbg! does print option

#

i wish posix had a third channel
stdout
stderr
stddebug

#

writing debug log to stderr is kinda cursed

solemn python
#

i love evcxr

#

its really odd to have a repl for a compiled & statically typed language but its also so useful

tranquil vapor
#

wtf is a 0u8

#

and why is that not a syntax error

solemn python
#

0 + u8 = explicit type cast

tranquil vapor
#

OHH

solemn python
#

"0" defaults to i32 I believe

tranquil vapor
#

i doint like that syntax

#

u8(0)

#

better

solemn python
#

that just looks like a function

tranquil vapor
#

0 as u8

solemn python
#

thats also valid syntax though I believe that would create 0i32 and then convert it to u8

daring marlinBOT
solemn python
#

it gets linted

daring marlinBOT
harsh marsh
#

lmfao

tranquil vapor
#

this is NOT clean you are a SICK PSYCHO

solemn python
#

kotlin devs have gotten a bit too adicted to extension functions

#

I love extension functions as much as the next person but come on

tranquil vapor
#

this is an official jetbrains repo btw

harsh marsh
#

mom can we have pipe |> syntax?
no, we have pipe syntax at home
pipe syntax at home:

solemn python
#

@tranquil vapor you love ((number.start().checked_sub(1).unwrap_or(number.start()))..=(number.end()))

warped dust
#

to debug print

#

the error message literally told you

warped dust
#

truest

tranquil vapor
warped dust
#

gouges your eyeballs out to eat them like lil grapes

#

now you wont 😊

sullen fiber
#

FEAR

warped dust
#

so goooood

sullen fiber
#

i just thought of a good solution

#

im giving up on that last attempt

#

idk what went wrong but

#

doing convolutions was fun

warped dust
#

soon theyll be convulsions

native pewter
#

u on de floor

proper totem
#

making large input for today could be slightly annoying

#

don't super want to do it cri maybe will do later

tranquil vapor
#

large input?

#

oh

#

could just go the lazy route and concat the normal input a bunch of times

#

shuffle the lines

native pewter
#

i mean you could just put random chars and make . slightly more likely

proper totem
#

the input has to be a square, a gear can only have at max two parts next to it (can be less, not more)

#

i guess could put the input in a 2x2 square

somber smelt
#

I still haven't done todays, no idea where to go after making a matrix

native pewter
#

use a hashset

somber smelt
#

I don't see how a set is applicable

native pewter
#

||use it to keep track of what fields are adjacent to symbols||

#

idk how to help much more without revealing basically the entire solution

somber smelt
#

This one is straight up not fun lmao

warped dust
#

skill issue

native pewter
#

felt like it was ok

somber smelt
#

building Android is more fun

sullen fiber
#

that would be more fun than actually solving this one

native pewter
#

hm can numbers be next to two symbols?

#

it doesnt say anything in the text but i dont think my solution would work if that was allowed

native pewter
sullen fiber
#

yes.,

native pewter
#

hell

sullen fiber
#

IT WAS KINDA FUN

#

i made l ike

#

a convolution

sullen fiber
#

its actually so easy to do in uiua

native pewter
#

thats fun

warped dust
sullen fiber
#

IM GONNA MAKE MINESWEEEPER IN UIUA

#

@warped dust you love that window works on any tensor so u can use it to ez convolve

warped dust
#

oh my god i needed that in erl so much

sullen fiber
#

||now i just have a bitmask for digits that are touching symbols||

#

||IDK HOW TO GET THE NUMBERS FOR THE DIGITS||

warped dust
#

||I did the same thing at the start, what you have to do is search for parts and then store what numbers they touch||

sullen fiber
#

OH MY GOD

#

i know what i must do

#

sike

#

unsike

#

yea i know what to do

warped dust
#

||yeah what i did was store the numbers AND their lengths in digits, then do bounds check on all numbers in same and adjacent rows||

#

kinda want to make this in uiua now

sullen fiber
#

doing that sucked a lot tbh and also somehow didnt work for some numbers

native pewter
#

least complicated uiua program

warped dust
#

regex is prohibited

#

huh why is the 4th day all the way up

#

wtf i thougth vap already did it

#

vec

#

vec vec

#

what..

#

what do you mean list

#

split("\n").collect::<Vec<_>>()

sullen fiber
solemn python
#

You could technically use an array because inputs are fixed size

sullen fiber
#

my uiua strechted my brain too much

#

and it hurt

#

i gave up

#

but im gonna do it fr now

#

cant wait to see how painful part 2 is

warped dust
#

bro actually got encephalitis

sullen fiber
#

WTF

warped dust
#

braim strech

sullen fiber
#

fake

#

it really was stretched tho like it felt like i was coming off of LSD or something uiua is fucked up

#

dont do uiua stay in schol.

warped dust
#

i dropped out to do uiua

sullen fiber
#

imma start building a uiua library

#

of functions that i use multiple times

#

in diff days

warped dust
#

the sindresorhus of uiua

sullen fiber
warped dust
#

vap really said iseven

#

isnumber

sullen fiber
#

sindresorhus was just trying to make javacsript more readable

#

truly a visionary

warped dust
sullen fiber
#

i thought it was copy on write in js

warped dust
#

nope

#

cows

#

theres even tests 😭

native pewter
sullen fiber
#

@warped dust uiua main branch has stack

#

which is dumpid but as a single symbol

warped dust
#

Stack = dumpid

sullen fiber
#

LONGGGG

#

too long

#

ngl i dont really get how dumpid came first

#

why would u need to filter ur whole stack thru a function before debug printing

warped dust
#

e=dumpid

#

they should make the inverse of dump clear the printed lines

sullen fiber
#

i like that i can see the lift but its not connected cus i havent fixed it yet

warped dust
#

wait true

#

im forgetting aoc lore

sullen fiber
#

SMH

sullen fiber
#

I DID PART 1 @warped dust

#

!@#$ER%WTYGFHNB

#

finally omfg

#

that was kinda fun today

#

it was not fun at all last night

#

i should do these in the morning tbh..

#

uh i can explain it in a video maybe

#

yea not really it uses ||convolutions||

#

which is basically when you ||sweep across something like a grid, and change the value of a cell to something based on its surrounding values||

#

||i did a convolution on the grid to get 1s where digits are touching symbols, and 0s where digits arent||
||then i made another grid replacing digits with the full number value, and non-digits with 0s||
||then i multiplied the two grids together and summed the values for part 1||

#

omg i love part 2

sullen fiber
#

now i have to ||gear the numbers that the gears touch||

#

wait no im goated

sullen fiber
#

exac.ty

solemn python
#

I actually ||checked characters surrounding numbers, not the other way around||

sullen fiber
#

yea same

#

wait

#

||do numbers only ever get touched by 1 symbol max???||

solemn python
#

From a quick glance I think so

sullen fiber
#

wow

#

that opens the door to a wonderful optimization

#

that i will do after i do this in the dumb way

#

i wanna try to generate a large input with wave function collapse or smth

sullen fiber
#

@warped dust currently fighting for fill windows to be a thing

warped dust
#

HOW

sullen fiber
#

it only makes sense if the windows have an odd shape,, but

#

if the windows have an odd shape, then each window has a center

#

so fill windows (on odd shaped windows) would center the windows around each element, using the fill value as a default value beyond the edge boundaries

#

wanna convolve with 0s beyond the matrix? fill0windows3_3

#

also @warped dust @warped dust @warped dust

#

latest uiua has epic thing

#

putting ' before something will surround its whole syntax subtree ()

#

wait i lied he made it to something else in the release

warped dust
#

quotes you

sullen fiber
#

oh it ' splits a line and '' unsplits a line

#

without changing the parse tree

warped dust
#

trol

sullen fiber
#

yea same

#

thats kinda how u have to do it rn

warped dust
#

that doesnt make sense though

#

for fill to have this behaviour

sullen fiber
#

behold: Trim and Border
||```
Trim ← ↘1_1↘¯1_¯1
Border ← ⍜(Trim); ↯⊙: +2△.: # Takes border element and matrix

warped dust
#

but itd be cool if there was something

sullen fiber
#

true

#

it would be weird for fill to make windows function differently

#

but yea i wish there was smth

warped dust
#

pad when

sullen fiber
#

true

#

nice

#

did part 2

steady fog
#

vap will vaporize

sullen fiber
#

part2 takes like

#

a minute or two to run

warped dust
#

fastest uiua program

sullen fiber
#

tbh i could have done 1 kernel pass but i do 2

warped dust
#

my pt2 was like visibly slower but its still really fast

#

i had to make searching less efficient

#

we must make uiua for the beam

sullen fiber
#

||1 to mark the gears, and 1 to calc gear ratio||

warped dust
#

the BEAM

sullen fiber
#

i gotta optimize this now

warped dust
#

iwill never get tired of calling it thE BEAM

#

the FUkiNG BEAM

#

VIRTUAL PUTER

sullen fiber
#

virtal

#

self

warped dust
#

okay i will work on beam now

#

i was going to a couple hours ago but it suddenly became my mission to kill tommy tallarico

sullen fiber
#

wha r

warped dust
#

hbomberguy

#

actually

#

@eternal marlin HEY

#

GET YOUR ASS IN HERE

sullen fiber
#

some youtube thing

#

ok

warped dust
#

theres this video essay he made on the roblox sound he tries to find out who made it but it quickly goes to show how much the people in control of things bend history to attribute themselves and and

sullen fiber
#

oh interesitng

warped dust
#

its two fuckin hours long

sullen fiber
#

wt.f

#

large video model when

#

summarize thisvide please

#

create supercut

warped dust
#

tommy tallarico constantly lies about his achievements and it seems no one ever bothered checking them
he says hes "the first american to work on sonic", the "world record holder of person to work on most games in their lifetime", a lot of things really
and it seems each time people ask him about them even those specific things seem to get bigger (like the amount of games he's worked on, despite not working on games at all in years. and not even the first amount was marginally correct. actually he doesnt work on anything, he's just the ceo of some company (SOME companies (oh he commited crimes by lying about his company to inverstors (did i say he got a total of like 20 million dollars raised for the company, to sell a product that was never made. because he doesnt even acutally have the people to make it (yeah he lied about some big people working on the company when they actually left shortly)))))

wait fuck thats too many parenthesis already

#

IM SAYING ITS INSNAE

sullen fiber
#

DAyum

warped dust
#

he said he was record holder of.. 7 guinness records
when its actually 3
the other ones are because guinness had to reword their records after finding out they werent really accurate

actually hbomber himself got two of those records down by asking guinness about it, and they themselves basically said they couldnt confirm

#

and honestly it just goes to show how capitalism actually works

#

aanyway beam

solemn python
eternal marlin
warped dust
#

oh nvm they're the same speed

solemn python
#

Mine is 94.5ms for part 1

eternal marlin
warped dust
#

um no

solemn python
#

118 for part2

#

Which is understandable considering the amount of multiplication

eternal marlin
# warped dust um no

no but it was actually the editor who ended up getting them taken down in the end so like close enough

warped dust
#

cuz setting up an actual erlang thing has a lot of boilerplate

steady fog
#

KILL Rini KILL

warped dust
#

m okay

#

i think most of the time is the node booting up

#

or that my cpu is 10 years old

#

which is still like insane cuz erl is dynamically typed and not native

#

rust so sloww

steady fog
#

ow

#

i just made a thing that deafened me

sullen fiber
#

GOOD

proper totem
#

the voices in my head got the better of me and I've started working on day 3 in asm

#

i have 25 minutes to finish it cozy

solemn python
#

the difference between release and debug mode is crazy

#

rust moment

warped dust
#

almost like debug builds have optimisation flags turned off

#

two seconds is insane though

#

wtf

proper totem
#

simply become javascript

#

@solemn python you have a github repo right nvm i checked your github

warped dust
#

tyman will pacman -S erlang-nox and benchmark my scripts on their machine

solemn python
#

but yeah I have a repo

#

don't judge my overcomplicated setup ok

#

I have to spend the time waiting for puzzles doing something trolley

proper totem
#

spooky
evidently maybe a me issue since discord scraped it fine but weird

solemn python
#

huh

#

are you on a network that doesn't like the domain or something

proper totem
#

oh yeah my router's isp likes to block random things let me check

solemn python
#

it is a pretty new domain so I wouldn't be surprised if I was blocked by a random ISP

proper totem
#

you hate to see it

solemn python
proper totem
#

oki i set up a bypass for it

sullen fiber
#

looking into generating a large input for this one

proper totem
#

you know what I will do

sullen fiber
#

and almost went down a rabbit hole of the field of constraint problems

steady fog
#

im using dlang today

#

permission to murder rini?

sullen fiber
#

@warped dust CONVOLVE 2 AT ONCE

warped dust
#

MALWARE

#

also 8 minutes left

#

what lang what lang

solemn python
#

7*

sullen fiber
#

uiua

#

uiua uiuai

#

uaiuai

#

ua

#

ia ui

#

iau

#

i

warped dust
#

I ALREADY DID IT

sullen fiber
#

oh yea true

#

golf script

warped dust
#

yaop

sullen fiber
#

trust

#

then APL

#

then BQN

#

both of those look scary to me

#

@warped dust im gonna PR uiua

solemn python
#

can't wait to see this essay being typed out

sullen fiber
#

to show funciton signatures on aliases in the LSP

proper totem
#

List of repos for people participating who are active in this channel/server (this is very much a low effort list, if you want to be on it just ping)

warped dust
#

Please don't repeatedly request this endpoint before it unlocks! The calendar countdown is synchronized with the server time; the link will be enabled on the calendar the instant this puzzle becomes available.

solemn python
#

lmao

#

he knew

sullen fiber
#

eric axoltl

sullen fiber
sullen fiber
#

oh lmao

solemn python
#

nice one

proper totem
#

and I lost the list because discord timed me out and cleared the undo buffer

#

bleh I'll get the list later

sullen fiber
#

its in mod chat

proper totem
#

oh true

solemn python
#

I got the template ready watching

real hinge
#

@steady fog do todays puzzle for me

steady fog
#

nop

real hinge
#

I am goijf ro school

steady fog
#

dont

solemn python
#

after this day I might setup an example testing template so its easy to copy paste in the future

sullen fiber
solemn python
#

yesterday I used tests but it was very badly formatted and setup

real hinge
solemn python
#

anyways see everyone after this is done

#

👍

proper totem
sullen fiber
#

oh true

warped dust
#

my ass choosing the lang last minute

#

sikei can do it any time

steady fog
#

GO RINI GO

#

GOOOOO

sullen fiber
#

gs

warped dust
#

which which

solemn python
#

oh dang p1 seems easy af

warped dust
#

i will not read the thing before i choose a language

#

i need to choose the worst language for it

steady fog
#

GOOOOOOOOOOOOOOOOO RINI

sullen fiber
#

warped dust
#

@steady fog WHICH

steady fog
#

Do it in D lang with me

warped dust
#

vote now

steady fog
#

D lang d Lang

warped dust
#

im forbidden from doing dlang ever

#

fawn wont let me

steady fog
#

kill fawner

#

can i kill fawner

warped dust
#

okay golfscript it is

#

oh FUCK

steady fog
#

WHAT

real hinge
#

Todays seem easy

steady fog
#

ok i got input Now

real hinge
#

Why today is really easy compared to other days

steady fog
#

something big is coming

warped dust
#

nvm its so easy

steady fog
#

:)

warped dust
#

@sullen fiber GIVE ME A HARDER LANGUAGE

real hinge
#

Guhh aoc balance died

sullen fiber
#

LOL

steady fog
#

im having to google how to do x in dlang

real hinge
warped dust
#

FUCK YEAH

#

any ppc emulators

real hinge
#

Idk

warped dust
#

that would be funny

steady fog
warped dust
#

FUCK X86

steady fog
#

chomp

real hinge
#

It doesnt even have division instruction

harsh marsh
#

damn I got top 100 today (for the gold)

warped dust
#

i will do it using only intel extension instructions

#

shit like zbcnmksl

real hinge
harsh marsh
#

i think that's the first ever top 100 i've gotten lol (my account goes back to 2015... although i've only done most of them for two years)

steady fog
#

insane

sullen fiber
#

not so bad

harsh marsh
#

yea

#

283/75

sullen fiber
#

FIRE

harsh marsh
#

part 1 took so long because i mixed up my variable names in the loop lmfao

sullen fiber
#

same but it was cus im bad at math

harsh marsh
#

i feel like it's less competitive this year than in the past?

#

mmm actually nvm

solemn python
sullen fiber
#

this is the perfect uiua problem

#

cant wait to see how others did part 2

warped dust
#

I HATE ARM ASSEMBLYT

#

fuck it we uiua

solemn python
#

I think im just going to hashmap all the cards with their indexes & winning number counts and then analyze from there

#

my brain really doesn't want to conceptualize this problem lmao

real hinge
#

(will see tonight)

steady fog
warped dust
#

god bless the lines being all same length

#

perfect for uiua

sullen fiber
#

REAL

#

FUCK BOXES

solemn python
#

well part 1 of parsing shit done

#

now how the hell do I actually do shit with that

sullen fiber
#

FEAR

solemn python
#

aaaaaaaaa

steady fog
#

trying to figure out how to convert array of strings to ints in dlang

#

guh

steady fog
real hinge
#

By charcodes blobCatCozy

proper totem
steady fog
#

oh

#

i was trying to cast

#

i think

warped dust
#

god pt1 was so easy on uiua

steady fog
#

rono

#

WHY cant i strip the string

#

guh

warped dust
solemn python
#

how the hell am I supposed to debug this

delicate crane
#

_.reject(section.split(' '), _.isEmpty)
we stan lodash

solemn python
#

ok maybe a recursive function isn't the right way to do this actually

#

huh

harsh marsh
#

python ||py f = open("input.txt", "r").readlines() u = 0 # points c = [1] * len(f) # "c"ount of cards for i, l in enumerate(f): s = l.split() w = set(map(int, s[2:12])) # winning numbers m = set(map(int, s[13:])) # our hand k = len(w & m) for j in range(k): c[j + i + 1] += 1*c[i] if k: u += 1<<(k-1) print(u) # part 1 print(sum(c)) # part 2||

steady fog
#

virus

#

please use sane variable names NOW

harsh marsh
#

NO

delicate crane
delicate crane
harsh marsh
#

lol i will start to when they get difficult >.>

#

the comments i just put in

#

was going for speed :3

delicate crane
steady fog
#

f56

solemn python
#

i never actually set the struct field I was supposed to set

solemn python
delicate crane
#

||```py
f = open("input.txt", "r").readlines()
points = 0 # points
cardCount = [1] * len(f)
for i, l in enumerate(f):
s = l.split()
winNums = set(map(int, s[2:12])) # winning numbers
handNums = set(map(int, s[13:])) # our hand
k = len(winNums & handNums)
for j in range(k):
cardCount[j + i + 1] += 1*cardCount[i]
if k:
points += 1<<(k-1)
print(points) # part 1
print(sum(cardCount)) # part 2

sane(ish) variable names for @harsh marsh's solution
harsh marsh
#

ya

#

though i wouldn't use camelCase in python

#

or map(int in any sane code

solemn python
#

I do want to improve my solution moderately because my data structures are horrible and also I may or may not have circumvented the borrow checker by cloning Vecs and Hashmaps

delicate crane
harsh marsh
#

wait wait i did even int() them you can just compare the strings

sullen fiber
#

PART 2 ON UIUA

#

SO CRACKEd

harsh marsh
#

i think i was thinking that i might need to have the actual values for part 2 so might as well parse it right the first time

sullen fiber
#

im gonna translate my uiua into js to make a silly golf again

solemn python
#

part 2 with cloning slow af

sullen fiber
#

true my uiua is faster

solemn python
#

I'm fairly sure my current code clones a vec for every single accumulated card lmao

sullen fiber
delicate crane
harsh marsh
#

huh

steady fog
#

I CANT FIGURE OUT HOW TO PARSE STILL

#

fksdnjgmerkgergnergwerngberg

harsh marsh
#

D is so silly

steady fog
#

i cry

teal mountain
#

hello friends

rose latch
#

I just muted every channel except for the css channels

#

lmao

solemn python
#

actually you know what

#

I am going to leave my solution as is for now then optimise it later, but keep my old solution in a different file

#

as much as I don't want to retroactively change my solutions, my current code is horrible in rust terms

teal mountain
sullen fiber
warped dust
#

IM SAYING

sullen fiber
warped dust
#

is there flatmap

#

something that works like it

delicate crane
warped dust
#

wiat

sullen fiber
#

deshape

warped dust
#

i dont need

teal mountain
warped dust
#

wait im cracked

sullen fiber
#

also stack oriented

warped dust
#

wait im not cracked

rose latch
sullen fiber
#

i had this matrix

#

and i had to stare at it for like

#

a good 10 minutes

#

to actually figure out what to do

#

i knew i could do it in linear time

warped dust
#

yop im trying to scan

warped dust
hazy sinew
sullen fiber
#

same i was trying to scan

#

but i actually needed to fold

#

cus fold lets you have ur own accumulator

teal mountain
#

i was contemplating doing it in kt this year but i'm trying to win on my uni lb

hazy sinew
#

so py?

teal mountain
#

typescript

hazy sinew
#

how is ts better than kt

sullen fiber
teal mountain
#

it isn't, but it's what i have more experience with

sullen fiber
#

uiua overhead got my part1 at 200ms still

teal mountain
#

i only picked up kt about 6 months ago

steady fog
#

i love kotlin

hazy sinew
#

i spent the summer making a utils lib

#

now anything that involves a grid in theory i should win but i keep throwing

sullen fiber
#

i wanna do this in ASM now

#

jk i dont wanna parse in asm

hazy sinew
#

day 4 was super easy too but it took me 14min and 16min

teal mountain
#

input parsing in c is bad enough vap

sullen fiber
#

yea. .. ,

#

parsing in uiua wasnt so bad today

teal mountain
sullen fiber
#

oh u just floored

hazy sinew
#

cuz its early day and not weekend

sullen fiber
#

lmaoaoao

#

i did it a little sillierly

hazy sinew
#

tbh i shouldve placed global today

#

if i didnt fuck up parsing id have part 1 in 2mins

warped dust
#

whyd u partition @|

solemn python
warped dust
#

fork take drop

solemn python
#

It's not really possible to compare the two

warped dust
#

and you BOXED.

sullen fiber
#

true

#

had to box

#

HAD TO

warped dust
#

SHAME ON YOU

hazy sinew
#

in part 2 i ||did the multiplication first so in example 2 ended up going to 3 4 5 6 instead of 3 3 4 4||

sullen fiber
#

GRRR

#

ur right

#

but

#

i hate mixing up calc logic

hazy sinew
sullen fiber
#

and parse logic

hazy sinew
#

for aoc

sullen fiber
#

i have to keep my parse logic separate from my calc logic

#

or else i explode

warped dust
#

i lvoe writing everything in a single line and then enver remembering what i did

steady fog
#

kill rini kill rini

teal mountain
#

it's funny, i got rid of my point doubling logic from part 1 thinking i didn't need it, then for part 2 i wrote it again because i think i did need it, and then i realised i didn't

sullen fiber
#

LMAO

hazy sinew
#

took me 15 mins to figure out (total of 16 😭 )

teal mountain
#

the part 2 algo is like 5 lines of code but it took me like 8 mins to understand

#

the problem descriptions are kinda convoluted this year

#

to fight against ai/chatgpt shit i think

sullen fiber
#

writing uiua is like having a train of thought

#

fr

solemn python
hazy sinew
#

(as lists obviously)

solemn python
#

I mean in AoC terms a more dynamic language and a faster compiling one seems better

hazy sinew
#

have u seen the kotlin stdlib

#

all the data manipulation functions

#

u can do every day in 1 line in kotlin

teal mountain
#

my whole part 2 algo (aside from parsing)
||```ts
for (const [i, card] of cards.entries()) {
const points = card.numbers.filter(n => card.winning.has(n)).length;

for (let j = 0; j < points; j++) {
cards[i + j + 1].copies += card.copies;
}
}

return cards.reduce((a, b) => a + b.copies, 0);

and this took me 10 mins to figure out
sullen fiber
#

i think julia is like that too

#

stdlib is cracked

#

for aoc

steady fog
#

day-04-dlang.d(41): Error: no overload matches for strip(a)

#

??????????

teal mountain
#

silly

sullen fiber
#

i clicked and forgot

teal mountain
#

what uiua does to a mf

sullen fiber
#

help

steady fog
#

wtf i dont understand

solemn python
#

By the end of AoC your brain will think only in multidimensional arrays

hazy sinew
#

i think i did
||

for(i in parsed.indices) {
    val matches = parsed[0].intersect(parsed[1]).size
    for (j in 1..matches)
        cards[i+j] += cards[i]
}

||

steady fog
#

WHY CANT I STRIP THE STRING

solemn python
#

uiua will consume your mental patterns

#

The voice in your head will be uiua symbols

sullen fiber
#

good

#

this is what i want

#

im genuinely hoping this helps me with thinking of things from an optimization perspective

hazy sinew
solemn python
#

You haven't been using uiua

sullen fiber
#

TRUE

hazy sinew
#

my grid is a Map<Point, T> and thats mostly what i use

#

and lists

#

for the input

solemn python
#

Also I'd argue a list is just an array but different

hazy sinew
#

shut up

sullen fiber
#

yea same

#

array user

#

⚠️ ⚠️

hazy sinew
#

well how else do u save the lines

solemn python
sullen fiber
#

sorry did u say you use strings?

steady fog
#

im having a stroke

sullen fiber
#

⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️

steady fog
#

@warped dust fix

hazy sinew
#

but using arrays for logic not parsing is a death sentence (i did it today and it cost me the global leaderboard)

solemn python
# steady fog <@1079479184478441643> fix

Ideally, they should be lying on their side with their head and shoulders slightly raised and supported with a pillow or item of clothing. After this, try not to move them. Loosen any tight clothing, such as buttoned-up shirt collars or scarves. If they are cold, use a blanket or coat to keep them warm.

#

Hopefully that fixes your stroke

steady fog
#

i give up

sullen fiber
#

part 1 or 2

steady fog
#

i literally

#

cannot strip the spaces from this string

solemn python
#

lmao

#

That's your issue??

sullen fiber
#

can u use regex?

steady fog
#

day-04-dlang.d(43): Error: no overload matches for `strip(a)` day-04-dlang.d(43): Candidates are: /usr/include/dlang/dmd/std/algorithm/mutation.d(2686): strip(Range, E)(Range range, E element) if (isBidirectionalRange!Range && is(typeof(range.front == element) : bool)) /usr/include/dlang/dmd/std/algorithm/mutation.d(2693): strip(alias pred, Range)(Range range) if (isBidirectionalRange!Range && is(typeof(pred(range.back)) : bool)) /usr/include/dlang/dmd/std/string.d(3488): strip(Range)(Range str) if (isSomeString!Range || isRandomAccessRange!Range && hasLength!Range && hasSlicing!Range && !isConvertibleToString!Range && isSomeChar!(ElementEncodingType!Range)) /usr/include/dlang/dmd/std/string.d(3513): strip(Range)(auto ref Range str) if (isConvertibleToString!Range) /usr/include/dlang/dmd/std/string.d(3572): strip(Range, Char)(Range str, const(Char)[] chars) if ((isBidirectionalRange!Range && isSomeChar!(ElementEncodingType!Range) || isConvertibleToString!Range) && isSomeChar!Char) /usr/include/dlang/dmd/std/string.d(3602): strip(Range, Char)(Range str, const(Char)[] leftChars, const(Char)[] rightChars) if ((isBidirectionalRange!Range && isSomeChar!(ElementEncodingType!Range) || isConvertibleToString!Range) && isSomeChar!Char) /usr/include/dlang/dmd/std/algorithm/iteration.d(479): instantiated from here: `MapResult!(__lambda12, Take!string[])` day-04-dlang.d(43): instantiated from here: `map!(Take!string[])` Failed: ["/usr/bin/dmd", "-v", "-o-", "day-04-dlang.d", "-I."]

#

wtf does that even mean

sullen fiber
#

dlang jumpscare

hazy sinew
#

dlang more like deletelang

sullen fiber
#

ong

proper totem
#

List of repos for people participating who are active in this channel/server (this is very much a low effort list, if you want to be on it just ping me) (this list uses discord usernames and not mentions because automod silly)

@hazy sinew https://github.com/eagely/adventofcode
@delicate crane https://github.com/CodeF53/AdventOfCode
@high lintel https://codeberg.org/fawn/aoc23
@proper totem https://github.com/katlyn/aoc/tree/2023
@real hinge https://github.com/mantikafasi/advent-of-code-2023
@warped dust https://codeberg.org/rini/aoc/src/branch/2023
@somber smelt https://github.com/FieryFlames/AdventOfCode
@solemn python https://git.myriation.xyz/Ty/advent-of-code-2023
@solar tide https://github.com/taskylizard/adventofcode
@sullen fiber https://github.com/Vap0r1ze/aoc/tree/2023
@tranquil vapor https://codeberg.org/Ven/AdventOfCode
@native pewter https://github.com/voidfill/aoc-2023
@steady fog https://github.com/zt64/advent-of-code
@teal mountain https://github.com/aetheryx/aoc

hazy sinew
#

activing

#

u spelled my name wrong

teal mountain
#

epic

proper totem
#

fixed (i'm editing lots of stuff so it won't show up right away)

steady fog
#

THERE

#

i had to type cast

sullen fiber
#

oh shit

#

@teal mountain i forgot who u were

solemn python
#

I was about to say I was proud to be the only non-githuber on the list

warped dust
sullen fiber
#

hi

harsh marsh
#

impl of my python solution in D... I hope to never use this language again

import std.stdio, std.conv, std.array, std.algorithm, std.range.primitives;

int main() {
    auto lines = stdin.byLineCopy().array();
    int points = 0;
    auto cards = new int[lines.length];
    cards[] = 1;
    foreach(i, string line; lines) {
        auto split = line.split();
        auto winning = array(split[2..12].map!(to!int)).sort!();
        auto hand = array(split[13..$].map!(to!int)).sort!();
        auto matches = setIntersection(winning, hand).walkLength;
        if (matches) {
            points += 1 << (matches-1); // Part 1: earn 2^(matching-1) points
            cards[i+1..i+matches+1] += cards[i];
        }
    }
    writeln("Part 1: ", points);
    writeln("Part 2: ", sum(cards));
    
    return 0;
}
teal mountain
solemn python
#

But now I suppose I can say im proud to be the only selfhoster on the list

warped dust
#

selfhosting git so lame

steady fog
harsh marsh
#

yes lol

#

they are the same

solemn python
hazy sinew
warped dust
#

who gonn sign up to contribute

steady fog
#

im splitting by chars

#

|

sullen fiber
solemn python
sullen fiber
#

email them patches

solemn python
#

I have registrations disabled regardless

warped dust
#

congratulations! your projects are not open source

#

do you realise how stupid it is

solemn python
hazy sinew
#

congratulations! your server died and you lost all your projects

harsh marsh
teal mountain
warped dust
#

oooo contributors oooooooo you fear them

solemn python
#

I just like having it

harsh marsh
#

yeah its like numpy index syntax you can set/add to a whole slice of an array

steady fog
solemn python
#

For more contribution-worthy stuff I use codeberg

steady fog
#

its weird if i try converting to int in the same map function it doesnt work but in another map it does

warped dust
#

then What Is The Point

hazy sinew
steady fog
#

oh

#

OH

#

ok

#

got it

hazy sinew
#

its op sometimes

harsh marsh
#

not really sure

#

there was a section on 2-D arrays but I didn't need it

hazy sinew
#

like that day where you had to check if 2 ranges contain eachother at the start of 2022 you just parsed them into ranges and did parsedInput.filter { first in second || second in first }.size

sullen fiber
#

fire

#

Range in Range is fier

hazy sinew
#

and for the other part its first.start in second || first.end in second

steady fog
#

oh i dont even

warped dust
#

HOLY SHIT

steady fog
#

i dont even need to convert to int

warped dust
#

IM CRACKED?

steady fog
#

no youre not

sullen fiber
#

FR

#

CRACKED

#

CRACKED

harsh marsh
warped dust
#

AAAAAAAAAa

#

im not

steady fog
#

my time is awful

#

kill

hazy sinew
#

if one of the elves decided to buy a lotto ticket with duplicate numbers i wouldve cried because .intersect wouldnt work by itself

solemn python
#

I didn't bother checking if there were duplicates, I just assumed there were just in case

delicate crane
hazy sinew
#

i didnt even think of duplicates, got 13 for test and submitted

solemn python
steady fog
#

@harsh marsh can you help me with mine

solemn python
steady fog
#

im getting a really small number

#

3

hazy sinew
#

day 4?

warped dust
#

wait im almost cracked?

steady fog
#

no rini

sullen fiber
#

i just realized

steady fog
#

you are not cracked

sullen fiber
#

my uiua isnt linear time

#

it almost is

solemn python
warped dust
sullen fiber
#

yop linear.5

steady fog
#

why am i getting 3

hazy sinew
steady fog
#

no

hazy sinew
#

does cards[] = 1 initialize all elements to 1

steady fog
#

probably

#

im just on part 1

warped dust
#

¯61264676597997600

#

@sullen fiber is this correct

proper totem
sullen fiber
#

WTF

hazy sinew
#

wtf is walklength

sullen fiber
#

NEGATIVE CARDS

steady fog
#

thing

proper totem
#

staff not impacted by automod when™️

steady fog
#

walkLength must be the number of matches?

#

maybe

hazy sinew
#

what about .size

steady fog
#

doesnt eixst

hazy sinew
#

goofy lang

solemn python
steady fog
#

@solemn python tyminky

solemn python
#

He even has cargo watch running with auto copying answers

#

And auto submission

hazy sinew
#

did u check if hand and winning are correct

solemn python
#

My setup feels inadequate now wahhgone

steady fog
#

like reading properly?

hazy sinew
#

no auto submit tho

hazy sinew
steady fog
#

ye

hazy sinew
#

ok i think its gotta be a skill issue then

steady fog
#

yop

#

so it only counts 2 matches in the first one

#

Card 1: 41 48 83 86 17 | 83 86 6 31 17 9 48 53

#

but theres 4

hazy sinew
#

print the set intersect

steady fog
#

["83", "86"]

hazy sinew
#

did u parse " "

#

before single digit nums

#

print hand and winning

steady fog
#

card 1:
winning: ["41", "48", "83", "86", "17"]
hand: ["83", "86", " 6", "31", "17", " 9", "48", "53"]
match: ["83", "86"]

real hinge
#

@steady fog i did day 4

steady fog
#

guh

hazy sinew
#

maybe ur intersect caps at the size of the second set

real hinge
#

part 2 was kinda horror

hazy sinew
#

invert them

#

or its just broken

teal mountain
#

also single digit

real hinge
#

@tranquil vapor I am sorry I installed rust to your vps

#

I had no choice

solemn python
steady fog
#

wh

hazy sinew
#

LMAO

steady fog
#

im too sleep deprivated to know what that means

solemn python
#

It gets 83 86

#

Which are next to each other

hazy sinew
#

it gets the longest consecutive match

solemn python
#

But not the ones that aren't next to each other

steady fog
#

oh

hazy sinew
#

for i in hand
if winning.contains (i)
matching++

real hinge
#

true

steady fog
#

guh guh guh guh

#

oh

#

that works

#

ok i can sleep now

#

someone will figure out why that wasnt working

#

really weird why that method didn't work

#

nvm I figured it out

#

the sorting was the issue

warped dust
#

@sullen fiber reverse will be deprecated in favour of foldjoin:[]

sullen fiber
#

LAMFDOSGHBNJ

glacial abyss
#

css will be deprecated in favour of java

real hinge
#

@steady fog make grays gold

real hinge
hazy sinew
#

help how to do day 4 in 1 line

#

i did part 1 now part 2 but theres a cards list

real hinge
hazy sinew
#

override fun solvePart1(input: File) = input.rl().map { it.substringAfter(": ").split(" | ").map { it.split(" ").filterNot { it.isBlank() } } }.sumOf { 2.pow(it[0].intersect(it[1]).size) / 2 }

real hinge
#

use a language that has ;

glacial abyss
steady fog
real hinge
steady fog
#

mantika help im starting to like dlang

real hinge
#

NO

#

WAIT

sullen fiber
steady fog
#

it's like C++ but sane

real hinge
#

@steady fog remember java

steady fog
#

jarva

real hinge
#

remember sysout println

steady fog
#

yes

#

@real hinge what lang should I do for day 5

real hinge
#

what else can you use

steady fog
#

assembly

real hinge
#

dont even try assembly