#AdVENt of Code
1 messages · Page 4 of 1
im good thanks
hop on java
you asked the forbidden question to a turkish person
@real hinge pay me? pretty please
what is rakiya
send me 20 cents (average monthly wage in turkey) @real hinge
how do I
I can stay hungry for 2 weeks
why is windows your personality
It all started when I was 8
when you were eight or when windows 8
I
when i was 8 i had opensuse
haram
so true
it was on my dads computer
anyway using opensuse at 8 is weird
increadible dad
my first computer had ubuntu
he still uses it
i had opensuse, ubuntu, windows 10, windows 11, ubuntu, arch
I teached my dad how to use whatsapp web recently
my dad has been programming for like 25 years
thats very nice tbh
they still use java 5 in some projects

because dependencies that lost support at java 5
arent there some new ones for java 8
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
you have to look at a bunch of https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition type shit and figure out why theres an error
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
why is islam your personality
windows is better tbh at least you can run it on ur pc
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
good point
so true
translate the linux kernel to arabic
actually rewrite it in holy c with { being inshallah and } being alhamdullilah
ذعر النواة
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
you know what they say
if its working dont touch it
except when the client needs a new feature you have to
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
java classes should work totally fine on kotlin
I doubt it would be problem
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
yeah that might be a problem
bruhhh
i spent WAY too long on part 1
then part 2 i did in 2 minutes
i hate || 2d arrays ||
rate my erlang
this is so terrible https://codeberg.org/Ven/AdventOfCode/src/branch/main/2023/day3/solution.rb
i cry
god it was so horrible in it
literally just added this to my part 1 solution:
WHY SPOILER FAIL
discord markdown parser so bad
i had to invert the way i was searching things and then do it
you had an || in code
put zwsp :3
|| 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
**solution.rb: **Line 10
lines = File.readlines file, chomp: true
chomp chomp chomp chomp
**pt1.erl: **Line 17
parse(string:chomp(Line), 0).
CHOMP
weird lang
what does chomp do
||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||
trim trailing newline
fnuy
WHY is copy ctx button lazy
im gonna
oh ok
no its just newline
cursed
not in ruby. it's newline(s) by default but you can pass a custom string
@split heart run ```rb
puts "banana".chomp "ana"
Here is your rb(3.0.1) output @tranquil vapor
ban
Here is your rb(3.0.1) output @tranquil vapor
bana
oh it only removes first
not all
my solution does so many out of bounds array accesses


rust fans will cry
.get(i) returns Option
https://github.com/TodePond/nDreamBerd ok whos solving day 4 in dreamberd
[i] panics
I used a .checked_sub(1) in my solution for day3
rate
rini.get(12).expect("index out of bounds");
``` better
whats the * mean
does it unwrap fully or only the outer one
/run ```rs
println!("{}", Some(Some("banana")).unwrap())
@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
Here is your rs(1.68.2) output @tranquil vapor
banana
funny
rust so bad, cant even fmt an option
rini.get(12).unwrap_or_else(|| panic!("index out of bounds"));
``` even better actually
terror
it could unwrap tbh
but ig that might be undesired
xd
but also why cant it print Options
can debug print option
/run ```rs
dbg!(Some("banana"));
@tranquil vapor I only received rs(1.68.2) error output
[file0.code:2] Some("banana") = Some(
"banana",
)
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
yeah makes sense
not something someone would expect to see without deliberately trying to format it that way
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
i love evcxr
its really odd to have a repl for a compiled & statically typed language but its also so useful
0 + u8 = explicit type cast
OHH
"0" defaults to i32 I believe
that just looks like a function
0 as u8
thats also valid syntax though I believe that would create 0i32 and then convert it to u8
yeah
**Utils.kt: **Lines 18-21
/**
* The cleaner shorthand for printing output.
*/
fun Any?.println() = println(this)
it gets linted
KOTLIN DEVS ARE INSANE
WHAT
**Day01.kt: **Line 15
part1(input).println()
lmfao
this is NOT clean you are a SICK PSYCHO
kotlin devs have gotten a bit too adicted to extension functions
I love extension functions as much as the next person but come on
this is an official jetbrains repo btw
mom can we have pipe |> syntax?
no, we have pipe syntax at home
pipe syntax at home:
@tranquil vapor you love ((number.start().checked_sub(1).unwrap_or(number.start()))..=(number.end()))
use {:?}
to debug print
the error message literally told you
You can make classes, but you can only ever make one instance of them. This shouldn't affect how most object-oriented programmers work.
truest
girlie do i look like someone who reads error messages
FEAR
so goooood
i just thought of a good solution
im giving up on that last attempt
idk what went wrong but
doing convolutions was fun
soon theyll be convulsions
u on de floor
making large input for today could be slightly annoying
don't super want to do it
maybe will do later
large input?
oh
could just go the lazy route and concat the normal input a bunch of times
shuffle the lines
i mean you could just put random chars and make . slightly more likely
there's some edge cases that need to be considered in order to be compatible with the official inputs
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
I still haven't done todays, no idea where to go after making a matrix
use a hashset
I don't see how a set is applicable
||use it to keep track of what fields are adjacent to symbols||
idk how to help much more without revealing basically the entire solution
This one is straight up not fun lmao
skill issue
felt like it was ok
building Android is more fun
i wanna try it
that would be more fun than actually solving this one
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
are you still doing uiua
yes.,
hell
thats fun
holy minesweeper
WAIT TRUE AS SHIT
IM GONNA MAKE MINESWEEEPER IN UIUA
@warped dust you love that window works on any tensor so u can use it to ez convolve
oh my god i needed that in erl so much
yes but
||now i just have a bitmask for digits that are touching symbols||
||IDK HOW TO GET THE NUMBERS FOR THE DIGITS||
||I did the same thing at the start, what you have to do is search for parts and then store what numbers they touch||
||thats not exactly easier since from a matrix perspective they are really touching digits not numbers||
OH MY GOD
i know what i must do
sike
unsike
yea i know what to do
||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
||i did a similar thing, where i got the coordinates of the matching digits, filtered out the ones that were touching (ones that referred to the same number) then checked if y was same and if x was within the bounds||
doing that sucked a lot tbh and also somehow didnt work for some numbers
least complicated uiua program
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<_>>()
NO
You could technically use an array because inputs are fixed size
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
bro actually got encephalitis
WTF
braim strech
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.
i dropped out to do uiua
imma start building a uiua library
of functions that i use multiple times
in diff days
the sindresorhus of uiua
true
i thought it was copy on write in js
:shiglet:
Stack = dumpid
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
cus u took the gondala lift up
i like that i can see the lift but its not connected cus i havent fixed it yet
SMH
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
sike i only loved ||detecting the gears||
now i have to ||gear the numbers that the gears touch||
wait no im goated
Minesweeper
exac.ty
I actually ||checked characters surrounding numbers, not the other way around||
From a quick glance I think so
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
@warped dust currently fighting for fill windows to be a thing
HOW
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
quotes you
i manually added empty lists to both ends and used the middle value of the window
trol
behold: Trim and Border
||```
Trim ← ↘1_1↘¯1_¯1
Border ← ⍜(Trim); ↯⊙: +2△.: # Takes border element and matrix
but itd be cool if there was something
true
it would be weird for fill to make windows function differently
but yea i wish there was smth
pad when
vap will vaporize
fastest uiua program
tbh i could have done 1 kernel pass but i do 2
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
||1 to mark the gears, and 1 to calc gear ratio||
the BEAM
i gotta optimize this now
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
wha r
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
oh interesitng
its two fuckin hours long
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
DAyum
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
Out of curiosity what's your speed for part 1
his mother is very proud
Mine is 94.5ms for part 1
that was actually joey who got the records taken down 🙄🙄🙄
um no
no but it was actually the editor who ended up getting them taken down in the end so like close enough
to be fair a lot of the time is bc im running it from escript
cuz setting up an actual erlang thing has a lot of boilerplate
KILL Rini KILL
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
GOOD
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 
almost like debug builds have optimisation flags turned off
two seconds is insane though
wtf
simply become javascript
@solemn python you have a github repo right nvm i checked your github
tyman will pacman -S erlang-nox and benchmark my scripts on their machine
selfhosted forgejo
but yeah I have a repo
don't judge my overcomplicated setup ok
I have to spend the time waiting for puzzles doing something 
spooky
evidently maybe a me issue since discord scraped it fine but weird
oh yeah my router's isp likes to block random things let me check
it is a pretty new domain so I wouldn't be surprised if I was blocked by a random ISP
you hate to see it

oki i set up a bypass for it
looking into generating a large input for this one
you know what I will do
and almost went down a rabbit hole of the field of constraint problems
@warped dust CONVOLVE 2 AT ONCE
7*
I ALREADY DID IT
yaop
trust
then APL
then BQN
both of those look scary to me
@warped dust im gonna PR uiua
to show funciton signatures on aliases in the LSP
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)
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.
eric axoltl
ar eu making it or asking for them
I'm going to explode
oh lmao
nice one
and I lost the list because discord timed me out and cleared the undo buffer
bleh I'll get the list later
its in mod chat
oh true
I got the template ready 
@steady fog do todays puzzle for me
nop
I am goijf ro school
dont
after this day I might setup an example testing template so its easy to copy paste in the future
wait lmao it didnt block the message? it just removed the lines with mentions?
yesterday I used tests but it was very badly formatted and setup
Cant
I was editing in the pings so I didn't ping a lot of peeps
oh true
gs
which which
oh dang p1 seems easy af
i will not read the thing before i choose a language
i need to choose the worst language for it
GOOOOOOOOOOOOOOOOO RINI
⛳
@steady fog WHICH
Do it in D lang with me
vote now
D lang d Lang
WHAT
Todays seem easy
ok i got input Now
Why today is really easy compared to other days
something big is coming
nvm its so easy
:)
@sullen fiber GIVE ME A HARDER LANGUAGE
Guhh aoc balance died
LOL
im having to google how to do x in dlang
Do assembly
Idk
that would be funny
@real hinge https://dlang.org/library/std/string/chomp.html
D Programming Language
FUCK X86
chomp
damn I got top 100 today (for the gold)
Love
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)
insane
not so bad
global?
FIRE
part 1 took so long because i mixed up my variable names in the loop lmfao
same but it was cus im bad at math
part 2:
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
oh
FEAR
aaaaaaaaa
Just do manually
never
By charcodes 
fear
god pt1 was so easy on uiua
CURSE OF UIUA /+≡(⌊ⁿ:2-1/+∊⊃(S↙-1)(S↘+2)⊗@|.↘+2⊗@:.)⊜∘≠@\n.&ru@\00
how the hell am I supposed to debug this
_.reject(section.split(' '), _.isEmpty)
we stan lodash
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||
NO
this
you comment good variable names next to the actual variable
lol i will start to when they get difficult >.>
the comments i just put in
was going for speed :3
you should see my day1-3 https://github.com/alchzh/advent-of-code/blob/master/2023/3/code.js
i've never finished one of these. Contribute to alchzh/advent-of-code development by creating an account on GitHub.
yes but you can very quickly just change names using ctrl+d
f56
NEVER MIND HOLY HELL
i never actually set the struct field I was supposed to set
ok but for real how did I get part 2
- without any debugging
and 2. 2nd try
||```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
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

true, I am used to js/ts tho
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
im gonna translate my uiua into js to make a silly golf again
part 2 with cloning slow af
true my uiua is faster
I'm fairly sure my current code clones a vec for every single accumulated card lmao
@rose latch open vencord server for once
huh
D is so silly
i cry
hello friends
I open it
I just muted every channel except for the css channels
lmao
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
wtf is uiua
IM SAYING
array based language
well unmute this thread
wiat
deshape
i dont need
guh
wait im cracked
also stack oriented
wait im not cracked
fine
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
yop im trying to scan
P = NP btw
imagine not doing ||val grid = Grid.of(input.rl()); grid.filter { it.toString().matches("[^0-9.]" }.mapIndexed { p, _ -> p.getNeighbors().map { grid.numberAt(it) }.distinct()}.sum()||
same i was trying to scan
but i actually needed to fold
cus fold lets you have ur own accumulator
based kotlin enjoyer
my p1 is zoomy tho
i was contemplating doing it in kt this year but i'm trying to win on my uni lb
so py?
typescript
how is ts better than kt
DAYNM
it isn't, but it's what i have more experience with
uiua overhead got my part1 at 200ms still
i only picked up kt about 6 months ago
i love kotlin
i spent the summer making a utils lib
now anything that involves a grid in theory i should win but i keep throwing
day 4 was super easy too but it took me 14min and 16min
input parsing in c is bad enough vap
this was pt1 btw trolley
by far the easiest imo, it's the only one where i didn't run into any stupid edge cases
oh u just floored
cuz its early day and not weekend
tbh i shouldve placed global today
if i didnt fuck up parsing id have part 1 in 2mins
whyd u partition @|
They all have their own merits ok
fork take drop
It's not really possible to compare the two
and you BOXED.
SHAME ON YOU
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||
nah kotlin is objectively better
and parse logic
for aoc
eah same
i lvoe writing everything in a single line and then enver remembering what i did
kill rini kill rini
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
LMAO
took me 15 mins to figure out (total of 16 😭 )
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
How
the winning point logic is just || substring before | .intersect substring after | ||
(as lists obviously)
I mean in AoC terms a more dynamic language and a faster compiling one seems better
have u seen the kotlin stdlib
all the data manipulation functions
u can do every day in 1 line in kotlin
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
should spoiler
oh im stupoid
silly
i clicked and forgot
what uiua does to a mf
help
wtf i dont understand
By the end of AoC your brain will think only in multidimensional arrays
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]
}
||
WHY CANT I STRIP THE STRING
uiua will consume your mental patterns
The voice in your head will be uiua symbols
good
this is what i want
im genuinely hoping this helps me with thinking of things from an optimization perspective
i have yet to use a single array in aoc at all
You haven't been using uiua
TRUE
Also I'd argue a list is just an array but different
shut up
well how else do u save the lines
I haven't used any arrays actually (I've used Vecs)
sorry did u say you use strings?
im having a stroke
⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
@warped dust fix
but using arrays for logic not parsing is a death sentence (i did it today and it cost me the global leaderboard)
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
i give up
part 1 or 2
can u use regex?
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
dlang jumpscare
dlang more like deletelang
ong
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
epic
fixed (i'm editing lots of stuff so it won't show up right away)
@proper totem https://codeberg.org/rini/aoc/src/branch/2023
oh shit
@teal mountain i forgot who u were
I was about to say I was proud to be the only non-githuber on the list
hi
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;
}
hii :3
But now I suppose I can say im proud to be the only selfhoster on the list
selfhosting git so lame
oh you just hard code the indices
false
this looks like c with classes and the kotlin range operator
who gonn sign up to contribute
u dont
Nothing I host on there needs contributions
email them patches
I have registrations disabled regardless
I mean it doesn't have a license so yeah it's not regardless but
congratulations! your server died and you lost all your projects
idk kotlin does it have lazy ranges / generators?
yes
some of this seems cool, like the range syntax in the array accessor automatically looping (?)
oooo contributors oooooooo you fear them
If someone asks I'll make them an account, or they could mail a patch for all I care
I just like having it
yeah its like numpy index syntax you can set/add to a whole slice of an array
For more contribution-worthy stuff I use codeberg
its weird if i try converting to int in the same map function it doesnt work but in another map it does
then What Is The Point
it has start..end and start ..< end and u can use it as a parameter to operator fun get so i can do grid[2..10, 4..19] = '.' and itll make a rectangle from x2 to x10 and y4 to y19
fire
its op sometimes
I think it's the same in D but I read their docs for the first time 15 minutes ago so
not really sure
there was a section on 2-D arrays but I didn't need it
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
and for the other part its first.start in second || first.end in second
oh i dont even
HOLY SHIT
i dont even need to convert to int
IM CRACKED?
no youre not
yeah lol i realized this
if one of the elves decided to buy a lotto ticket with duplicate numbers i wouldve cried because .intersect wouldnt work by itself
I didn't bother checking if there were duplicates, I just assumed there were just in case
f32?
I guess any f\d{2} is identifiable as me
i didnt even think of duplicates, got 13 for test and submitted
You are a 32 bit floating point number now
@harsh marsh can you help me with mine

day 4?
wait im almost cracked?
no rini
i just realized
you are not cracked
You are cracking
almost linear
yop linear.5
why am i getting 3
are u using uiua
does cards[] = 1 initialize all elements to 1
discord is annoying and I made lots of typos
WTF
wtf is walklength
NEGATIVE CARDS
thing
staff not impacted by automod when™️
what about .size
doesnt eixst
goofy lang
https://github.com/danielhuang/aoc-2023/tree/master I found some guy's repo and holy rust setup
@solemn python tyminky
did u check if hand and winning are correct
My setup feels inadequate now 
like reading properly?
mines better
no auto submit tho
yes
ye
ok i think its gotta be a skill issue then
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
print the set intersect
["83", "86"]
card 1:
winning: ["41", "48", "83", "86", "17"]
hand: ["83", "86", " 6", "31", "17", " 9", "48", "53"]
match: ["83", "86"]
@steady fog i did day 4
guh
maybe ur intersect caps at the size of the second set
part 2 was kinda horror
also single digit
Is your intersect only getting the longest sequential intersection
wh
LMAO
im too sleep deprivated to know what that means
it gets the longest consecutive match
But not the ones that aren't next to each other
oh
for i in hand
if winning.contains (i)
matching++
true
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
@sullen fiber reverse will be deprecated in favour of foldjoin:[]
LAMFDOSGHBNJ
css will be deprecated in favour of java
@steady fog make grays gold
yopp
simple
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 }
use a language that has ;
CSS!!!!
how
program
dlang has ;
mantika help im starting to like dlang
i think u can hope this helps
it's like C++ but sane
@steady fog remember java
jarva
remember sysout println
of course java
what else can you use
assembly
dont even try assembly


