[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: csgrad highres.jpg (429 KB, 2253x2119)
429 KB
429 KB JPG
still on easy mode edition

>Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other.
https://adventofcode.com/

/g/ leaderboard join code:
224303-2c132471
anonymous-only leaderboard:
383378-dd1e2041

Previous thread: >>107464708
>>
File: 7.png (759 KB, 5440x2542)
759 KB
759 KB PNG
idiomatic Rust solution

>>107465269
2.3ms
>>
>went onto page 11 before a new thread was made
FUCK
>>
>>107468355
>2.3ms
how tf anon. I will have to improve mine again. I am stuck at 7ms
>>
>>107468364
only every second line contains a splitter
>>
>>107468364
have you tried his code on your computer?
>>
Reminder that so called "influencers" like Low Level, Theo and Primeagen can't solve past the easy days of AoC.
>>
>>107468372
I did not want to make this assumption but
eric has not really put the soul into these puzzles so I just went with it
>>
So which day this year has been the hardest? Or has all of them been equally piss easy?
>>
What makes a solution idiomatic as opposed to other solutions?
>>
>>107468407
Looking retarded
>>
File: 7.png (838 KB, 5440x2802)
838 KB
838 KB PNG
>>107465269
166μs
>>
>>107468390
point and laugh
>>
>>107468407
linq
>>
File: aoc_day7.png (60 KB, 520x603)
60 KB
60 KB PNG
>>
>>107468403
day 6 took the longest for me because of parsing
>>
>>107466389
>>107468339
Thanks. I like what you're doing, but it seems (https://github.com/ziglang/zig/issues/18652 and https://github.com/ziglang/zig/issues/19755) that bitcasting between vectors and integers is going to be changed at some point?
I think it shouldn't matter for your code since you're switching between [N]u8 and @Vector(N, u8) and u128, which shouldn't need special padding or packing, but I'm really not sure about that.
>>
>>107468372
is that true for the bigboy? I am getting wrong ans when stepping by 2

>>107468379
no, but I think there is some overhead due to I/O and me being on a laptop. idiomatic rust anon only measures the solve function afaik

>>107468407
how many features and patterns can you use that you cannot in C

>>107468456
>166us
wtf. on bigboy at that?
>>
>>107468496
>is that true for the bigboy?
I'm not sure actually, but I get the correct results lol
>wtf. on bigboy at that?
yeah
>>
bros, why is it still so fucking easy?
>>
>>107468485
day 5 took the longest for me because of multiple minor mistakes
at the 30m mark i just started over, taking me 55 minutes total
day 6 only took me 15 minutes
>>
>>107468508
got it now. my step by 2 logic was wrong. still 5.19ms even after using simd for finding ^
>>
>>107468494
it will matter for var mask: LANE_INT = @bitCast(@as(@Vector(LANES, u8), row[p..][0..LANES].*) == splitter); because I am bit-casting from a vector of bool to u1. bool of size 1 byte is bitpacked so this works but if it takes 1 byte then it could not be casted to an int
>>
>>107468407
LESS LINES = MORE IDIOMATIC
>>
>>107468456
btw what was wrong with your left = start - y/2 and right = start + y/2 logic? seems finding min and max on each ^ found is a bit excessive. the beams almost double in width for each row containing a ^. you can just do

left = left.saturating_sub(1)
right = width.min(right + 1)
>>
Part 1 took me longer than part 2 because I am a dummy who doesn't read.
>>
>>107468582
Eric made the first twelve puzzles of a year and shipped it early
>>
File: Blaise_Pascal_Versailles.jpg (395 KB, 1280x1525)
395 KB
395 KB JPG
Where are my Pascal homies?
>>
>>107468802
alternatively he picked up the discarded ideas from previous years that did not make it and threw them all into this year
>>
Do you do these types of puzzles often?
>>
>>107468870
>literally garbage year
>>
>>107468802
Even against the same days in other years this has to be the easiest it's ever been
>>
>>107468881
once a day in december
used to do it for 25 days but this year I'll do 12 at max
>>
>>107468881
No
The only programming puzzles I do are AoC. Much more chill than the usual puzzle sites, and I wouldn't do it without the threads regardless.
>>
>>107468348
I'm already filtered by day 1 here. I'm actually don.
>>
>>107468922
what? how? are you retarded?
>/g/
then why are you retarded?
>>
>>107468922
day 1 is one of the hardest days so far this year
>>
File: aoc23_23.png (1.16 MB, 798x6891)
1.16 MB
1.16 MB PNG
>>107468853
back in 2023
>>
bigboy sub 1ms in golang running on a remote server. (without io)
>>
File: Capture.png (110 KB, 914x1094)
110 KB
110 KB PNG
Lazy python solution
This is the easiest day (so far)...
>>
The days of making a small cube out of paper on christmas are over
終わりだ
>>
Guys today will be the filter for real this time
>>
>>107469007
there's no way it's not a maze today
it's time
>>
>>107468997
I remember
>t. hardcooder
>>
>>107468496
>me being on a laptop
mine's faster when the charger is plugged lol
no point in measuring performance on a mobile device running a desktop os
>>
>>107469007
>>107469016
it will be aiming a catapult to hit a target
>t. knower
>>
>>107468802
jesus christ. it's probably this.
>>
getting a lot of Plutonian Pebbles vibes from this puzzle bros.
>>
>>107468933
No the 2nd part is causing me trouble
>>
this puzzle sucks
basic dp memoize
where are the good puzzles brehs? why is this year so soulless?
have the pajeets and webshit redditors sucked the fun out of it for us?
>>
Man, at this point there is either going to be an enormous difficulty spike out of nowhere or this year is going to be a wash
Difficulty's barely ramped up at all so a sudden increase would blindside a lot of people
>>
I have a good idea for my day13-25 puzzle.

My main concern is, As I fuck up every single day with off-by-one errors, I am terrified I will release the puzzle with the wrong answer.
>>
>>107469150
>have the pajeets and webshit redditors sucked the fun out of it for us?
ledditors are praising the reduced difficulty, go fucking figure
>>
>>107469172
if it was harder claude would be filtered and redditors angry
>>
>>107469150
>DP
Where? What DP?
>>
>>107469151
theres no way hes gonna massively spike it in the middle of the week
friday 12th was the only hope and hes just gonna phone it in with a "collect every star" one
>>
>>107469204
here: >>107465769, >>107466077 (washed)
>>
there's less than a week left? the fuck?
>>
>>107469204
haven't you heard? basic counting is dp now
>>
>>107469301
why wouldn't counting be DP?
>>
File: 1737008387841161.png (88 KB, 1546x248)
88 KB
88 KB PNG
I think I am going to get filtered today. Managed to did part 1 in Haskell with list memery, pattern matching and without single use of indexes. Which runs well enough.

But I couldn't do same thing in part 2. So I implemented a basic bitch recursion to solve it. Which my potato of a computer couldn't handle. Then I spent 4 hours and tried some stuff and implemented a tail call recursion, I hope, but at this point code looks alien to me. And my computer still is struggling right now to compute it.

I can't think a more performant way to solve this. Not with Haskell, not that I blame the language. I suck at it. And I miss loops ;_;

Pic related is my terrible first attempt at part 2
>>
File: 1753859059270312.png (473 KB, 605x631)
473 KB
473 KB PNG
Too lazy to wash my idiomatic Nim.

Day   -Part 1-   -Part 2-
7 09:48:14 10:20:59
>>
>>107469301
this is textbook dp
see: >>107465068
you just don't know what dp actually is
you probably think it's some exotic dynamic technique which you program
hint: the "programming" in dynamic programming has nothing to do with writing code
>>
>>107469301
>>107469319
Watch me solve this math puzzle using DP!

2+2 = X
>2 = 1+1
>>1 + 0 = 1
>>>0 = 0
>>1 + 0 = 1 + 0
>>cache
>1+readCache(1) = 2
>cache
2+reachCache(2) = 4
Ans: 4
>>
Part 2 in 8 lines of Python. Suggestions on how to make it shorter are welcome.
grid = [[{"S": 1, ".": 0, "^": -1}[x] for x in row.strip()] for row in open("7.txt")]
for i in range(1, len(grid)):
for j in range(len(grid[0])):
if grid[i][j] == -1:
if j-1 >= 0: grid[i][j-1] += grid[i-1][j]
if j+1 < len(grid[0]): grid[i][j+1] += grid[i-1][j]
elif grid[i-1][j] > 0: grid[i][j] += grid[i-1][j]
print(sum(grid[-1]))
>>
>>107469350
dumb retard
>>
>>107469340
You know, this is not a DP problem. This is closer to a pathfinding problem, only instead of checking the shortest path you check how many paths take the same route
>>
>>107469365
you can find paths with DP
>>
>>107469340
>you probably think it's some exotic dynamic technique which you program
this is my solution
!S {
if ((S = index($0, "S")))
n[S] = 1
next
}
/\^/ {
gsub(/./, "& ")
delete tmp
for (i in n)
if ($i == "^") {
tmp[i-1] += n[i]
tmp[i+1] += n[i]
ag++
}
else {
tmp[i] += n[i]
}
delete n
for (i in tmp)
n[i] = tmp[i]
}
END {
for (i in n)
au += n[i]
print ag, au
}

I don't see no dp in there
>>
>>107469365
>can the global solution be obtained from solutions to subproblems?
yes
>are there overlapping subproblems?
yes

therefore dynamic programming can be used
this is not up for debate
>>
>>107469360
dumb retard
>dumb
>>dum
>>>du
>>>>d
>>>>cache
>>>d+u
>>>cache
>>d+u+m
>>cache
>d+u+m+b
>cache
>retard
>>retar
>>>reta
>>>>ret
>>>>>re
>>>>>>r
>>>>>>cache
>>>>>r+e
>>>>>cache
>>>>r+e+t
>>>>cache
>>>r+e+t+a
>>>cache
>>r+e+t+a+r
>>cache
>r+e+t+a+r+d
>cache
d+u+m+b+ +r+e+t+a+r+d
>>
>>107469385
dumb retard

>>107469397
impressive
>>
>>107469378
Yes, but you don't need it here.
>>
>>107469396
It is not whether or not you could, but whether or not you should
>>
>>107468355
>idiomatic
>unreadable mess inside of a function named solve
Sounds right.
>>
>>107469409
>>107469418
you can have that opinion sure
but I hope you are consistent and dont use regex for parsing
>>
>>107469450
skill issue
>>
>>107469460
what's wrong with regex? legit question
>>
>>107469460
Yep. I don't. Hate regex.
>>
>>107469385
    if ($i == "^") {
tmp[i-1] += n[i]
tmp[i+1] += n[i]
ag++
}
else {
tmp[i] += n[i]
}

this is literally push dp
you can rewrite as pull dp if you're not familiar with push
// recurrence relation excl. bounds checking
dp(i,j) = sum(
dp(i-1,j-1) if input(i,j-1) is '^' else 0,
dp(i-1,j+1) if input(i,j+1) is '^' else 0,
dp(i-1,j) if input(i,j) is '.' else 0,
)
>>
>>107469482
Nothing. Unless you want to parse something recursively where you have ti match brackets and tags, then it gets ugly and you should avoid it.
>>
>>107469516
>this is literally push dp
you made that up
>>
>>107469581
https://usaco.guide/gold/intro-dp?lang=cpp#push-dp
>>
>>107469482
it is abouts as "overkill" as using dp
>>
>>107469598
>here is some word salad and spaghetti code
yeah I'm convinced
>>
File: day7.apl.png (23 KB, 481x287)
23 KB
23 KB PNG
>you literally cannot fold over matrix rows in APL

Worst designed language of all time award
>>
>>107469482
Regex is the only language I can think of that is "write-only" - easy to write, impossible to read
>>
>>107469697
>i'm convinced
great! :)

>>107469631
regex * is implemented with dynamic programming
>>
>>107469705
tex macros are pretty bad too
I know why latex was made now
>>
>>107469705
Regexps can be read. Unlike APL. Or J. Some guy here posted a J solution to one of the puzzles.
>>
where's the regex only solution to day 6
>>
what else can we make more dynamic
>>
File: day7.apl_fold.png (8 KB, 664x68)
8 KB
8 KB PNG
nvm got it working

what a great language
>>
File: code.png (415 KB, 1478x2708)
415 KB
415 KB PNG
Python
>>
>>107469767
Oh yeah that too. That shit is terrible
>>107469773
True but I'm convinced that it exists only as some esoteric for-fun language so I'm ignoring it
>>
>part1
>example input all good
>real input too few
what did I miss?
>>
>>107468853
2022 was the last year i did in pascal. was pretty fun.
>>
File: d07.png (98 KB, 648x766)
98 KB
98 KB PNG
How can I write more idiomatically?
>>
>>107469877
which day?
>>
>>107469884
programmer socks
>>
>>107469893
today
>>
>>107469884
Use an llm
>>
>>107469884
for loops are considered unidiomatic
needless collects are considered harmful (and thus also unidiomatic)
>>
>>107469920
>>107469877
oh I misread the post
>>
>>107469900
ah fuck it was obvious, I failed to propagate the not-split beams
>>
>>107469877
part2 has 12-13 zeroes if your answer is low in the low-low sense if that helps
>>
File: carbon.png (501 KB, 1678x2160)
501 KB
501 KB PNG
Unwashed Haskell
>>
comfy C solution
>>
>>107468264
are u supposed to compare to a dictionary when finding words?
>>
>>107469838
/gen how do ppl type this. wanted to look into it but having to type out codes made me balk
>>
>>107469326
the answer has 15 digits, fren
don't try to count the rays one by one
>>
File: 433_percent.png (354 KB, 732x879)
354 KB
354 KB PNG
>>107470111
Check 'em!
>>
>>107470111
Not him, but we had a small lab with special (expensive) keyboards for this at the university.
That was a long time ago, however, I doubt the lab's still there.
The keyboards would be lettered QWERTYUIOP and have those APL symbols next to the letters, many keys had more than one that you could access with the right ALT key. (Just like you can get the Euro sign with R-ALT+E on European keyboards.)
>>
>>107468390
No bro it just get so tedious and I have a life bro. I could definitely do them but I have better things to do with my time bro
>>
ffs
>>
>>107468407
when your code uses patterns commonly used in that language. for example, your code is not idiomatic php unless you add an sql injection vulnerability
>>
>>107468390
>pressing x to doubt
>>
>>107468407
dont worry about idiomatic
writing idiomatic code means youre a follower, an npc. you blindly copy what your masters have told you, write code how they tell you to write it
a real programmer creates his own idioms
>>
File: 359cns8n6q5g1.mp4 (34 KB, 480x512)
34 KB
34 KB MP4
From r*ddit
>>
>>107470229
filtered and humiliated
what a nice sunday
>>
>>107470296
>From r*ddit
*erkx*
But on the other hand that illustrates pretty well what I did for part 2.
>>
>>107468355
2.8 ms with JS
>>
>>107468407
When you abuse the language's features to write the most unreadable code ever conceived.
Look at IOCCC for examples in C.
>>
>>107470207
like monetizing the blog posts more capable engineers wrote for free by stuttering them into a camera while interrupting with terrible commentary
>>
>>107470355
2028 ms for 1000 iterations, so it's closer to 2 ms
>>
>>107470298
lmao
>>
>>107470277
bro, you're using english where someone else came up with all the words.. are you a blind npc follower?
>>
>>107470355
>>107470378
see >>107468456
>>
>>107470043
disgusting Apple fag
>>
>>107470403
lol I'm a retard - I did a structuredClone of my own data-structure every iteration, which is by far the biggest time slog - I'm down to 273µs now
>>
>>107470461
without console.log every iteration, I'm down to 168µs
>>
>>107470406
>disgusting Apple fag
Not him, but:
Dude, you upload your code to some website and it generates a png picture for you. The apple window buttons are just part of it. You can't disable that, you can just pick a different website.
>>
>>107470472
with 10000 iterations it's 1587ms, so 159µs
>>
File: 7.png (908 KB, 5008x3062)
908 KB
908 KB PNG
>>107470512
116µs
>>
>>107470111
setxkbmap -layout gb,apl -variant ,dyalog -option grp:rctrl_switch


aka use a regular keyboard and bind right ctrl to toggle the APL layout.
You don't need special symbols on your keys, how often do you look at your keyboard when typing?
>>
>>107470539
do you have zig installed? I want someone to measure my time
>>
File: rape_me.png (57 KB, 817x918)
57 KB
57 KB PNG
part 1 was extremely easy, didnt even have to care about going out of bounds
>>
>>107470649
I noticed eric padded basically everything
idk if he is coddling or what
>>
>my solution is using 20 gigs of ram
I once again regret never getting a proper algorithms course
>>
File: 1757418468141631.jpg (5 KB, 250x250)
5 KB
5 KB JPG
i got filtered by day 2, i asked the ai what kind of alogirthm i have to implement and i still dont get the hashmap solution where i store the count for each column
>>
>>107470693
part2*
>>
>>107470693
does the video anon posted help >>107470296
>>
>>107470715
unfortunately not, i dont really understand the numbers, i think this is my intellectual limit
>>
I refuse to get filtered on day 7
>>
>>107470539
you can get more perf if you drop the obsession with having it idiomatic and use get_unchecked_mut

also, will it not be more idiomatic to do counts1.iter_mut().enumerate().skip(left).take(right - left).for_each(...) and reset *count = 0 inside the closure in for_each. or just use counts1[left..=right].fill(0) after the for_each to maybe have a faster memset?

>>107470693
anon, see this recurrence relation and understand why that will work. then you can just memoize the f using a hashmap of (i, j).
>>
>>107470737
forgot to link it kek >>107465077
>>
>>107470732
each splitter in the webm just copies the block left and right
and if two get copied to the same spot they add up the stacks
>>
>>107470678
I've refined it so it doesn't use 20 gigs of ram
However it appears that it will still take 5 hours
>>
File: 1756314820633091.webm (870 KB, 477x480)
870 KB
870 KB WEBM
Cringe ass visual

include std/[cmdline, strutils, sequtils, math]

const render = true

var inp = toseq lines commandlineparams()[0]

var image_cur = 0
proc print_image(mymap: seq[seq[int]]) =
var f = open("frame_" & inttostr(image_cur, 4) & ".ppm", fmWrite)
inc image_cur
var (w, h) = (len mymap[0], len mymap)
var mymax = max mymap.mapit max it
writeline f, "P3"
writeline f, w, " ", h
writeline f, 255
for y in 0 ..< h:
for x in 0 ..< w:
if inp[y][x] == '^':
writeline f, 255, " ", 0, " ", 0
elif mymap[y][x] == 0:
writeline f, 0, " ", 0, " ", 0
else:
let val = uint16 255 * 2 * mymap[y][x].float64.log float64 mymax
if val >= 255:
writeline f, 0, " ", 255, " ", 255 * 2 - val
else:
writeline f, 0, " ", val, " ", 255

var start: tuple[y, x: int]
for iy, y in inp:
for ix, x in y:
if x == 'S':
start = (iy, ix)

var mymap = newseqwith(len inp, newseq[int] len inp[0])

mymap[start.y][start.x] = 1
when render: print_image mymap

var p1 = 0
for y in start.y ..< pred len mymap:
for x in 0 ..< len mymap[0]:
if mymap[y][x] <= 0: continue
if inp[succ y][x] == '^':
inc p1
inc mymap[succ y][succ x], mymap[y][x]
inc mymap[succ y][pred x], mymap[y][x]
else:
inc mymap[succ y][x], mymap[y][x]
when render: print_image mymap
echo p1
echo foldl(mymap[^1], a + b, 0)
>>
>>107470678
>>107470761
post it anon
>>
>>107470737
>get_unchecked_mut
literally UB with another input
>counts1.iter_mut().enumerate().skip(left).take(right - left).for_each(...)
it's slower by 32µs
>>
File: 1751223124266426.png (385 KB, 483x460)
385 KB
385 KB PNG
>>107470764
If anyone makes a "FUCK\nYOU\nERIC" map I will render it using this.
I just modified my code to allow multiple "S" starting points too. Make sure to dither the text so the water can flow through it.
>>
>>107470776
wdym UB? not like direct indexing will prevent any issues, it will just panic after the bound check failing
what about assigning left and right at each ^ pos? why not just sub 1 from left and add 1 to right, saturate at 0 and width after processing the row
>>
>>107470805
panicking is safe, UB is not
>why not just sub 1 from left and add 1 to right, saturate at 0 and width after processing the row
I want the tightest bounds possible
>>
File: splits.png.png (6 KB, 195x185)
6 KB
6 KB PNG
>>107470732
low effort drawing but the 1 gets split into two
and the 3 gets split into two
but because the middle splits land in the same column they add up to 4
>>
>>107470840
anon, *you* allocated the count{1,2} vectors with a known size, you are indexing count1[x] and count2[x +- 1]. only time it will fail is when splitters are at the extremes of a row, which you can assume it won't be

>I want the tightest bounds possible
you do you

ig y*(width+1) is already optimized out of the inner loop? I see you switched back to double buffering. how slow was using the observation that there are no ^^ and a single array will do?
>>
>>107470944
>which you can assume it won't be
that's not how it works, see https://doc.rust-lang.org/std/keyword.unsafe.html
>is y*(width+1) is already optimized out of the inner loop?
idk, but LLVM usually has my back
>how slow was using the observation that there are no ^^ and a single array will do?
see >>107468456
>>
>>107470883
im trying to follow but i dont think i implemented it like that in my code i have Map<col, count> then i got left-right -1 +1 and if im out of bounds i add to timelines, otherwise i add it to the map leftcol: map.get(leftcol) || 0 + count, this usage of maps is a bit hard to understand
>>
File: carbon-2.png (447 KB, 1430x2680)
447 KB
447 KB PNG
properly washed, decided to try a std::function for the first time ever. kinda nice. also somehow slightly faster, ~30ms on the bigboy
>>
one of you niggers should start working on a day 13 puzzle for the chronically /g/ay
it'd be a fun event
>>
>>107471055
I have one
But I cba to make a website for it and pay hosting costs
And if it just gets posted on /g/ nobody will do it
>>
>>107471055
Maybe I will do something,,,
>>
>>107471039
I usually use anonymous struct with operator() for this sort of thing. std::function and lambda certainly is clearer though.
>>
File: cl-dp.png (475 KB, 1496x1344)
475 KB
475 KB PNG
how did you guys write so much code for p2? it was honestly easier than p1. 5 minute problem.
>>
>>107471166
>I have one
what is it
>>
I've spent about 5 hours on this thing, I give up. I have been filtered by day7 part 2.
>>
>>107471295
post attempts
>>
>>107471295
share your input I'll tell you the answer
>>
>>107471295
Fucking how? Start with the most brainless solution.
Do you know what memoization is? Do you understand the recurrence relation? wtf the fuck?
>>
>>107471295
LOL
>>
>>107471295
What is your approach?
>>
File: day7.png (870 KB, 1986x4170)
870 KB
870 KB PNG
I used recursion for part2 and DP, but it works and solves bigboy. I straight up overcomplicated part1.
>>
>>107471322
there are no silver stars though
>>
>>107471295
Ignore anyone talking about recursion because they are retarded.
Just think about what happens when you drop a bucket of water from the start.
>>
>>107471329
On leaderboards part 1 only gives you a silver star anon...
>>
>>107471295
Write your chain of thought step by step for me. I'll point out the first mistake.
>>
File: 1737957067826290.png (143 KB, 1370x750)
143 KB
143 KB PNG
>>107471329
>>
File: img-2025-12-07-19-32-56.png (279 KB, 4680x136)
279 KB
279 KB PNG
>>107471335
>>
>>107471333
In algorithmic design its best to start stupid and optimize after. A basic recursive function is the easiest way to understand this problem, how most DP problems work in practice and more.
>>
>>107471344
no one cares
>>
>>107471344
that's not a silver star
>>
>>107471353
exactly
>>
>>107471333
But anon, I used recursion.
>>
>>107471333
if you're not doing recursive/dp the only way to do it is to work bottom up. start with 1s on every row, when you get to a split sum the numbers left and right of the splitter and use that above. Continue working up, and return the number that goes into the S.
>>
>>107471347
If starting bottom-up with recursion is the first thing you come up with for this problem, you might actually be brainwashed.
Did you learn about Pascal's triangle using overlapping subproblems, or did your teacher tell you that you sum up each pair of numbers in a row to get the next row?
And no, keeping track of the number of beams on each grid point is not "dynamic programming"
>>
>>107471375
You are overcomplicating it. Just write how much ways is to get to each point at each line top from bottom, then sum the bottom line. If your ray goes down to empty space, it just gives it the same number it had, if your ray goes to space with a number it adds itself to it.
>>
>>107471274
Ive always said im going to do a year in lisp, but i always chicken out due to Advent of Parsing and just being really comfortable with pythons string manipulation, and built in high level abstractions like dictionaries and sorting etc. Im assuming clisp has equal amounts of built-in support though? The only lisp I've used is scheme to do sicp.

And i know that even if it doesnt, it only takes a few hours to make all of the important ones, im just lazy.
>>
>>107471014
>that's not how it works, see https://doc.rust-lang.org/std/keyword.unsafe.html
That's exactly how it works.
Unsafe represents preconditions that lead to UB if violated.
The standard library is full of unsafe because it's safe as long as you DON'T FUCKING VIOLATE THE PRECONDITIONS.
In this case the precondition is "the character matrix in `input` doesn't have a caret on its edge".
>>
File: rape_me.png (127 KB, 1307x1426)
127 KB
127 KB PNG
pretty easy part 2
>>
>>107471470
>In this case the precondition is "the character matrix in `input` doesn't have a caret on its edge".
but what if it does though?
>>
>>107471375
dp doesn't automatically mean recursion is involved, tabular (which is iterative) is bottom up dp.
bottom up doesn't mean you start at the bottom and work towards S btw, stupid retard.
>>
>>107471470
my website is safe as long as no visitor adds ?admin=1 to the URL
>>
>>107471375
>the only way to do it is to work bottom up
Not true, you can do it top down row by row as well. Kind of like pascal's triangle, just sum up whatever hits the bottom.
>>
>>107471466
yeah, common lisp has tons of built-in functions and a really good package system, so you can just load libraries if you want specific things (perhaps infix math). Racket is good, too.
If you know scheme then you can get by just looking up the functions you want to use and seeing if they exist or not.
I also recommend spending the time to learn emacs. I'm not even really messing with parsing this year, just doing it ahead of time in emacs and justing sticking parentheses around it so it works with lisp.
>>
>>107471424
>And no, keeping track of the number of beams on each grid point is not "dynamic programming"
Anon... That literally is DP thougheverbeit. I still think describing the solution recursively first is easier. But whatever.
>>
File: 1756522252097979.jpg (1.47 MB, 2365x2817)
1.47 MB
1.47 MB JPG
>>107471536
Behold, the inventor of dynamic programming.
I am starting to believe this term should just be banned completely from all textbooks.
>>
File: carbon(7).png (238 KB, 1936x1392)
238 KB
238 KB PNG
Took me a while to remember how one usually does DP in Haskell. This is more like it, I hope difficulty keeps increasing.

>>107469326
DP takes a bit of time to get right. Once you understand the usual idiom (fill a data structure with your results, lazily so it gets memoized), then it gets easier.
>>
>>107471494
Then your computer aspode
>>
>>107471484
how dynamic is my programming
>>
>>107471571
your head asplode
>>
>>107471553
Who's that, John Dynamic?
>>
>>107471568
why do this shit when you can just foldl'?
>>
>>107471574
not using dp. DP means there's a cache/memoize somewhere. It lets you turn an exponential time function into a linear time one.
>>
>>107471424
>And no, keeping track of the number of beams on each grid point is not "dynamic programming"
It literally is.
The number of beams of each grid point is calculated from the number of beams on different points. That's recursion.
Keeping track of them is memoization.
Recursion with memoization is dynamic programming.
You may consider it dumb to give it such a name, and maybe it is, but it is what it is.
>>
>>107471609
It's iterative DP. Filling in the whole table of values of the function eagerly. Recursive DP is calling a recursive function only for the values you actually need in the end (the last row) and caching the intermediate results. They're both DP.
>>
Using the term "dynamic programming" unironically outs you as a midwit.
>>
>>107471525
Yeah im a vim guy, I tried emacs before and was filtered, especially because I didnt know lisp.

now that I do, revisiting emacs is high on my list. But I've used my setup for over 5 years and am reluctant to go through the growing pains again.
>>
>>107471665
All the IOI and ICPC gold medalists use that term.
>>
>>107471689
literally who
>>
>>107471628
>>107471660
this is the dumbest shit ive ever read. Recursion is a function calling itself, either directly or indirectly. Recursion is a facet of an implementation, not of an algorithm.
// iterative implementation to find fib
def fib(n)
prev = 1
prev_2 = 1
n.times do
next = prev + prev_2
prev_2 = prev
prev = next
end
return prev
end

// recursive implementation to find fib
def next_int(n)
n < 2 ? 1 : fib(n - 1) + fib(n - 2)
end

now if you slap memoization onto next_int you get O(N) performance and shit memory usage. That's the dp solution. The first one is not dp. It doesn't get you O(1) for repeat inputs. Neither does this dumbass "iterative DP" idea.
>>
File: Capture.png (23 KB, 814x290)
23 KB
23 KB PNG
I don't understand. Day 1 was clearly one of the hardest. Have people been filtered even though they passed d1 or have they just grown bored of aoc this year?
>>
>>107471609
it is dp, even if it's disgusting dp
>>
>>107471724
if you dont get O(1) for repeated inputs it isnt dp.
>>
>>107471706
lmfao funniest shit I ever read. read some literature, anon
>>
>>107471628
>The number of beams of each grid point is calculated from the number of beams on different points. That's recursion.
If I calculate a + b = c, would you think about this as a recursive operation? If I do a time step in a physics solver, am I recursively calculating the new state from the old one?
>>
>>107471716
natural attrition as people get bored or distracted. doing something is always harder than not doing something
>>
I for one enjoyed implementing a shallow-history Dijkstra for today's classic path-finding puzzle. Dijkstra sure solves everything! Also day 16 is sure to have a similar problem that requires you to remember more of the history.
>>
>>107471730
show me a definition of DP where it mentions O(1). are you stupid? give me your best definition of memoized fibonacci impl and I will give you a number. find me the nth fibonacci no. in O(1) (no, you don't get to fill the cache before hand. that's not what O(1) means)
>>
>>107471730
wdym, there is top down and bottom up dp, bottom up dp is iterative
>>
>trannies bitching about terminology
where the fuck is drawanon? this thread is worse than dead
>>
>>107471744
>day 16
anon...
>>
>>107471753
do you know what repeated input means?
>>
>>107471753
not that anon but it has a closed form solution although floating point becomes an issue
>>
File: 1743090647504566.jpg (92 KB, 460x443)
92 KB
92 KB JPG
>>107471744
anon, don't give me hope. I started to believe the conspiracy that eric has prepared the rest of the days as a surprise
>>
>>107471770
bad example. assume factorial or some other example that does not have an edge case like this
>>
>>107471744
>shallow-history Dijkstra
kek, it really do be like that.
>>
File: AoC Day 7 stats.png (24 KB, 767x314)
24 KB
24 KB PNG
>>107471716
I think interest is generally waning for it, there was a sizeable drop in people who started it compared to last year.
>>
File: stars.png (25 KB, 697x159)
25 KB
25 KB PNG
>>107471800
nah this is 2021
we are around the same
>>
>>107471769
alright, is this DP according to *your* definition?
memo = [0, 1]

def fibonacci(n: int) -> int:
while n >= len(memo):
memo.append(memo[-2] + memo[-1])
return memo[n]

print(*map(fibonacci, range(10)))
>>
are you guys seriously arguing about the term dynamic programming because there's nothing better to do?
>>
>>107471706
There's multiple definitions of recursion on varying levels of abstraction.
The fibonacci function has recursive structure regardless of how you implement it.
>>
>>107471895
There are no good puzzles yet after all.
>>
>>107471833
NTA, but I firmly believe that one of the main reasons why people struggle with recurssion (other than low intelligence) is because it is too often introduced wtih Fibonacci which has to be the absolutely most retarded problem to solve recursively. All it teaches you is that recurssion is unnecessary as an iterative solution is better, easier and smarter since it doesn't involve the need for caching.
>>
>>107471895
DP is nothing but a fancy marketing term invented to fool managers. It is useless to debate its definition because a rigorous one was never the point to begin with.
>>
>>107471939
it is fancier sounding than it deserves, but it also refers to a real pattern and can be useful as shorthand for it
>>
File: file.png (1.19 MB, 1023x964)
1.19 MB
1.19 MB PNG
hello sir

kindly see the needful

~ H.B. Gopalakrishnan
>>
File: out.png (535 KB, 5718x4313)
535 KB
535 KB PNG
washed
>>
>>107471895
such has been this year, anon :(
imagine if we had actual good puzzles and half the anons were malding over it while the other half ridicule and laugh at them. that would be a fun year to have

>>107471912
anon, but iterative is better. recursive dp formulation is just easier to reason with. it's easy to write the value for the current state like f(i,j) = f(...) + f(...)

>>107471910
I might just start doing ebc even tho it's finished

>>107471939
well, names are just references. if every anon started calling it double penetration then I am sure it will be normalized within a few days in aocg
>>
>>107471951
>collect_vec
>collect_vec
>HashMap<usize, HashSet<usize>>
>HashSet<(usize, usize)>
>Vec<usize>
>Vec<usize>
holy shit nigger, your memory allocator is working overtime. how is that "washed"????
fix your contrast btw, shit is barely legible.
>>
File: 1752257286935747.png (27 KB, 381x244)
27 KB
27 KB PNG
This is already the furthest I've gotten in a year except for the intcode year, and I feel nothing.

I figured with 14 days I could put a lot of effort into a reduced amount of problems, and avoid losing steam, but the problems themselves have also just gotten significantly easier...
I'm a bit disappointed.
>>
>>107471989
wait fuck i'm reading it wrong. I thought 2018 was $current_year
>>
>>107471706
faggot doesn't know about tabular dp.
>>
>>107471985
you wouldn't get it
>>
>>107471895
do you have a better term?
>>
>>107471939
The Secretary of Defense even.
--
I spent the Fall quarter (of 1950) at RAND. My first task was to find a name for multistage decision processes. An interesting question is, "Where did the name, dynamic programming, come from?" The 1950s were not good years for mathematical research. We had a very interesting gentleman in Washington named Wilson. He was Secretary of Defense, and he actually had a pathological fear and hatred of the word "research". I'm not using the term lightly; I'm using it precisely. His face would suffuse, he would turn red, and he would get violent if people used the term research in his presence. You can imagine how he felt, then, about the term mathematical. The RAND Corporation was employed by the Air Force, and the Air Force had Wilson as its boss, essentially. Hence, I felt I had to do something to shield Wilson and the Air Force from the fact that I was really doing mathematics inside the RAND Corporation. What title, what name, could I choose? In the first place I was interested in planning, in decision making, in thinking. But planning, is not a good word for various reasons. I decided therefore to use the word "programming". I wanted to get across the idea that this was dynamic, this was multistage, this was time-varying. I thought, let's kill two birds with one stone. Let's take a word that has an absolutely precise meaning, namely dynamic, in the classical physical sense. It also has a very interesting property as an adjective, and that is it's impossible to use the word dynamic in a pejorative sense. Try thinking of some combination that will possibly give it a pejorative meaning. It's impossible. Thus, I thought dynamic programming was a good name. It was something not even a Congressman could object to. So I used it as an umbrella for my activities.

—Richard Bellman, Eye of the Hurricane: An Autobiography (1984, page 159)
>>
File: 1670602894807439.webm (81 KB, 392x392)
81 KB
81 KB WEBM
maybe tomorrow will be soul
>>
>>107472086
is this loss?
>>
>>107472129
no
>>
File: 1671800803548060.webm (2.97 MB, 640x480)
2.97 MB
2.97 MB WEBM
>>
>>107471951
My biggest problem is I keep thinking in one way and forget about looking at the problem in all angles. I got filtered because I was trying to Frankenstein my first solution, when I should have stop and better thought about the problem.
I'm not sure what's a solution to this besides setting a timer for failed attempts.
>>
>>107472181
I crushed my cube the moment I was done, kinda regret it
>>
Fucking finally. Today would be much much easier for me if I could actually be able to iterate with loops and mutate data but I chose this.

>>107470146
I had to actually think a proper algorithm instead of brute forcing recursion. Your comment about the result has certainly encouraged me

>>107471568
Man I love your snippets. It takes a while to understand them. I should do some reading. I have EE background, so I only know programming concepts at a surface level.
>>
File: Untitled.gif (153 KB, 800x452)
153 KB
153 KB GIF
aaaaa
>>
>>107472181
>we will never get a good puzzle ever again
this fucking sucks. Eric ruined Christmas. At least clueless redittors can get their hecking 24 staririnos!!!
>>
>>107472181
soul
>>
>>107470539
alright man, you win :D
But ~200µs isn't too shabby for js I guess
>>
File: carbon.png (60 KB, 574x656)
60 KB
60 KB PNG
hello sirs
>>
you know what? I'm going to restart 2019 intcode and finally complete all days.
>>
File: PXL_20221217_184207908~2.jpg (411 KB, 2931x1069)
411 KB
411 KB JPG
>>107472257
Lol I remember that one.
>>
Finally, a problem literally MADE for awk.
>>
>>107472493
love brootes simple as
>>
>>107472257
>>107472493
SOVL
>>
File: day7.apl.png (7 KB, 655x71)
7 KB
7 KB PNG
>>107472506
What image maker are you using? Or are you taking photos
>>
Day 07:

For the first part, it's simple. Parse the input into a grid and enqueue all positions which contain an S or a pipe "|".

Dequeue positions (BFS style) until the queue is empty, and for each position, check if the position below it is a splitter. If it is a splitter, then enqueue two positions to the left and right of the splitter and continue. Otherwise, simply enqueue the position straight ahead. Repeat until you hit the edge of the grid.

https://pastebin.com/edatRhUv

Part 2 is not that difficult once you understand what's going on. It's like playing plinko and determining all possibilities. Extend the previous program by instead parsing the input into a grid of ints and instead of generating the initial pipe, generate a 1. Make it so every position in the queue also stores the current accumulation at the tail end of the tuple, and deposit the current accumulation plus any incoming accumulations when another ray hits a certain position.

https://pastebin.com/jPsGUa5L

Yes I hardcoded the start positions so sue me.
>>
>>107472580
why are you giving me commands?
>>
>>107472580
wrong
>>
>>107472617
I forgot to mention that you have to sum the values in the last row of the grid at the end by the way.
>>
>>107472493
how did he even know it would converge and it wasn't stuck in an infinite loop somewhere?
>>
>>107472576
https://github.com/Swordfish90/cool-retro-term
>>
File: file.png (691 KB, 1514x3462)
691 KB
691 KB PNG
Haskell
Benchmark 1: cabal run < bigboy.txt
Time (mean ± σ): 1.917 s ± 0.016 s [User: 1.665 s, System: 0.250 s]
Range (min … max): 1.886 s … 1.969 s 100 runs
>>
>>107471304
i tried dfs from top, then from end, then lost myself on a 2**max_height - missing_^ * 2**column "there must be a math way" brainloop
then i went to the movies
>>
File: 1761234289042039.gif (1.88 MB, 400x300)
1.88 MB
1.88 MB GIF
>part 1, did a solution where I had a row of bools and just kept stepping through each line updating it in order to keep track of splits
>part 2 just did a whole separate DP solution
>go to bed, wake up
>realize I probably could have just changed the p1 from bools to ints to solve it instantly
>>
>>107472768
I'm really annoyed we didn't actually have to evaluate any of the paths.
>>
>>107472768
part1 is actually harder than part2 since you have to keep track of the number of splits and not just the number of beams
>>
I thought this was going to be hard. This was one of the easiest ones. The internet lied to me.
>>
>>107472974
yeah, super hard to check how many ^'s have a | above it, phew
>>
>>107472648
brooters don't think, they simply do
>>
File: delusional.png (279 KB, 567x425)
279 KB
279 KB PNG
>>107470277
>writing idiomatic code means youre a follower, an npc
I decide what is idiomatic in my language, you imagination-free fool! Let others follow where I bother to lead!
>>
>>107472997
It's easy if you pick the right algorithm. And allow for a lot of paths; 32-bit integers won't help with this one.
>>
File: im-1765142979233.png (16 KB, 464x376)
16 KB
16 KB PNG
>>107468348
extremely lame year so far. tried actually following each path but after hopefully waiting that it might still finish in under a minute implemented the needful.
reminds me of euler triangle path https://projecteuler.net/problem=67 (see also 18)
>>
>>107471322
>I used recursion for part2 and DP, but it works and solves bigboy.
Please tell me it was tail recursion? This problem works fine with a single scan of the data, doing just basic forward passing of the information...
>>
eric is such an obnoxious faggot
>>
Haven't really seen an obvious filter yet. Clearly the puzzles are either too easy, or the redditors are too shameless
>>
>>107473241
No CPU these days uses 32-bit integers.
>b-but C/C++ make 32-bit default for "int" and the 64-bit ones have too long and unwieldy names
skill issue
>>
>>107473347
i'm definitely getting my practice typing `uint64_t` this year
>>
>>107473347
>b-but C/C++ make 32-bit default for "int" and the 64-bit ones have too long and unwieldy names
>#define int int64_t
>>
Remember when EC drew a dragonduck with circle strings? Eric can't even be bothered to hide images in grid problems. He's washed.
>>
Overly terse C++. Big boy take 750ms, so not the most efficient.
>>
>>107473369
> error: 'main' must return 'int'
>>
>>107473382
If this is overly terse C++, no wonder everyone under 30 is using Rust
>>
>>107473241
The algorithm is pretty obvious though no? Its like 5 lines worth of recursive function. In contrast I still find difficulty solving some previous year puzzles in similar-ish spirit (like the one with the robot pushing buttons for a robot pushing buttons etc and day 11 with the magic rocks).
>>
>>107473414
>The algorithm is pretty obvious though no?
I thought so. Some Anons' whining here made me suspect that I might have been good at picking the right one.
>>
>>107473401
you just type int32_t on main no?
>>
>>107473451
I prefer `signed`
>>
>>107473459
i signed your mom last night
>>
>>107473459
I always want my results from main() to be digitally signed too, for integrity.
>>
>>107473375
>>
>>107472228
>topright = (x-1) (y+1)
>right = x (y+1)
bro
>>
>>107471833
Yes? Are you retarded? Literally Wikipedia the definition.
>>
File: IMG_7172.jpg (44 KB, 666x760)
44 KB
44 KB JPG
Anyone else feel like even the map is turning out to be lackluster and uninspired? Just compare it to '23
>>
>>107473369
There is nothing in the C++ standard that mandates that int must be 32 bits, it can be less (but not less than 16 bits), it can be more.
>>
>>107473743
Its kinda cool how it actually maps to the puzzles. It has sovl
>>
>>107473401
main can be void
>>
>>107473811
microsoft's bastardizations don't count
>>
I haven't done last night's problem yet, is it hard?
>>
>>107473961
Not really no
Fyi pt2 is counting number of beams kinda
>>
>>107473798
Eric's ASCII arts have always been soulful.
>>
File: cube.png (778 KB, 1133x1052)
778 KB
778 KB PNG
sneak peek
>>
File: file.png (661 KB, 1648x4396)
661 KB
661 KB PNG
rust day 6
find a good way to parse this was fucking shit
>>
File: Untitled2.jpg (162 KB, 1044x862)
162 KB
162 KB JPG
>>107473994
eric would never
>>
>>107473961
Part2 is annoying, but not hard.
>>
>>107474013
it's just a grid, anon. replace whitespace with X and see how dumb you were
>>
File: day7go.png (75 KB, 619x1120)
75 KB
75 KB PNG
Baby's sixth Go program.
>>
>>107474048
It's not even annoying.
>>
File: file.png (43 KB, 1200x1200)
43 KB
43 KB PNG
:)
>>
File: file.png (99 KB, 1200x1200)
99 KB
99 KB PNG
:(
>>
File: Thomas_and_William_Riker.jpg (169 KB, 1436x1080)
169 KB
169 KB JPG
>>107474326
>>107474337
yay :D draw anon. D: oh no
>>
>>107474326
>>107474337
cinema
>>
Are there any actual good books on this stuff? Most of the comp sci shit I have from school is super basic. Everything I learned was from google and old aoc threads.
>>
>>107474496
>Everything I learned was from google
so like, every pro then
>>
>>107474496
For me it was oreilly algorithm in a nutshell
>>
If today's problem doesn't take me at least an hour, I will riot.
>>
>>107474496
some shit school you went to lol
>>
File: carbon.png (107 KB, 819x1028)
107 KB
107 KB PNG
>>107474013
it was pretty awkward for sure
>>
my final solution for day7
>>
File: lol.gif (25 KB, 220x159)
25 KB
25 KB GIF
>>107474646
>>
File: day7.png (67 KB, 557x543)
67 KB
67 KB PNG
>>107474646
forgot upload
>>
>>107474496
Competitive Programmer's Handbook
>>
File: ocaml-haskell7.png (835 KB, 1470x3121)
835 KB
835 KB PNG
>>107472228
here's OCaml in this style, after getting bit very hard by the 1-indexed rows and the deceptive coordinate space, which helped me discover the OCaml's super cool time-travelling debugger doesn't have even gdb's ability to call functions on the fly.
your logic also depends on Eric's inputs: S has to be at the top, there need to blank lines after every line with something interesting, and (everyone depends on this:) ^ can't be adjacent to a ^
>>
got any pointers on doing grid problems in haskell. i am new to it and have done every problem in haskell, except the 2 grid ones that i did in c
>>
>>107474676
immutable arrays is obviously a retarded representation but I thought it was in the spirit.
performance is miserably bad but space usage is alright: 11s on Eric's input, 12.3MB MaxRSS.
2G just loading the bigboy, and killed it after 10min
>>
>>107474717
>2G just loading the bigboy, and killed it after 10min
>>107466181 The PS2 has 32MB of RAM.
>>
So bros what do we do now that AI is 14/14?
>>
>>107474756
AI doing it is not me doing it.
>>
>>107474752
32MB is plenty for >>107466024 but that's a lot less in Haskell's style
>>
>>107473347
>No CPU these days uses 32-bit integers
nigga you just went full retard
never go full retard
>>
>>107474326
>>107474337
<3 <3
>>
>>107474756
If you are doing AoC just for the sake of collecting stars and not as an exercise in fun and learning you're ngmi and you are the type that will just get replaced by AI entirely.
>>
>>107474682
I'm using a different functional language, but I think the easiest way to do mutable grids with immutable data structures is to represent them using a map, mapping (int, int) coordinates to chars for example (I believe that's Data.Map in Haskell).
These are internally represented as binary trees, so they can be updated without having to copy the entire thing.
>>
>>107474838
We're all getting replaced soon, anon. Why do you think eric gave up? He can read the writing on the wall. Coding by hand as a productive activity is over.
We might as well go play some video games, at least AI can't do that yet.
>>
>>107472228
>matrices
>vectors
just foldl' over the rows, nigga
>>
>>107474951
people expecting him to care about AI probably sucked a lot of the fun out of it, but practically speaking AI doesn't end programmers any more than optimizing compilers or high level languages or COBOL or IDE text-completion managed to do that. Normies, instead of asking AI once to help write a program to perform some text-wrangling task, will ask an AI a thousand times to do the same task, and then spend too much time checking for and fixing up errors and having to type "hey did you just COMPLETELY make these numbers up?". Normies will still need a programmer to make and maintain software that's somewhat reliable. That programmer can use AI if he wants, but normies can't.

Now, you know what AI totally ruins forever? Your manager's job.
>>
>>107468407
Fewer lines, shorter variable names, no comments.
>>
>>107474995
>Normies will still need a (one) programmer
>That programmer can (will have to) use AI (to be competitive)

Hand-coding is coming to end. I'm sorry. We both know it. It's better to accept it quickly than lie to ourselves.
>>
>>107475062
I'll miss it, though.
>>
>>107475062
bit twiddling largely came to an end with high level languages with optimizing compilers, but an understanding of it still benefits you.
Good programming was never a matter of fast a typist you were, anyway. Your decisions were always what mattered the most, and another guy being able to generate more shit code faster than the other guy was never going to give him a better product. The Mythical Man Month covers a historic failure to see this.
>>
>>107475062
programming is 90% thinking 10% typing
>>
>>107474951
>We might as well go play some video games, at least AI can't do that yet

https://deepmind.google/blog/sima-2-an-agent-that-plays-reasons-and-learns-with-you-in-virtual-3d-worlds/
>>
>>107475250
Switching to 10% thinking 90% typing(prompting)
>>
>>107474496
>hello chatgpt give me a basic leetcode problem
>here is my solution, why doesn't it work/how can I improve
>>
>>107475283
I'll take what I can get
>>
>>107474773
If Haskell's style is to use all the RAM and go slow, I think we can do with less of Haskell's style.
>>
>>107475399
It's idiomatic Haskell to not care about how a computer actually works
>>
>>107474951
He's right to be afraid but a coward to stop.
>>
>>107475062
It could be a decade before vibe coding reaches the level of a good human programmer.
>>
>>107475555
That might be fine for middle-aged boomers but I have a whole life ahead of me.
>>
File: ocaml-haskell7b.png (849 KB, 1518x3088)
849 KB
849 KB PNG
>>107475399
that was my joke but now I'm feeling bad about it. It'd be awful if some anon thought >wait, Haskell's not that bad actually.
>/g/ lied to me!
>I should use lenses now, and write a monad tutorial
>laziness is such a cool feature, I get caching for free
pic related is 37x faster and only needs 12.8MB for Eric's input, and the representation is a tree just like >>107474846
suggested
still 8G on the bigboy and I'm still not waiting for it finish
>>
>>107474951
Hobbyists will inherit the earth
>>
>>107475716
you'll hate it though because after a couple generations of AI use, technical communication's going to be completely in the toilet. It'll be like everyone's degraded to a boomer. Bug reports of "it doesn't work", and a look of expectation like you're supposed to disgorge a 20-page bullet list of suggestions based on that much information, because that's how AI responds.
>>
>>107475716
Realest shit ever
>>
need new bread
>>
>>107474326
>>107474337
Beautiful
>>
>>107473692
It is matrix so indexes are reverse. I did write them like coordinates at first but that was a mistake. I should've fixed the naming scheme though.

>>107474676
That is nice. I can actually read this unlike a week ago. You defined matrix type. I have yet to define my own type in Haskell. Rest looks straightforward enough

>>107474954
Anon I am EE. My mind goes to matrices by default. But after I implemented my solution I can see how I can use foldl rows, I guess
>>
>4chan will be down for scheduled maintenance at 11AM EST on Monday the 8th
/aocg/bros...
>>
>>107476317
if you haven't solved and discussed the puzzle by then you're filtered
>>
THE GREAT FILTER
>>
>>107476393
why are some of these people even on a /g/ leaderboard if they're going to do half of day 1 then stop
>>
>>107476317
what does 4chan need maintenance for?
>>
>>107476461
adding webp support
>>
one hour or something
>>
advent of code ended in 2024. This zombie aoc is just making me depressed.
>>
File: completion_stats.png (103 KB, 1372x724)
103 KB
103 KB PNG
is aoc dead?
>>
>>107476422
>>107476422
You're filtered at the first problem you didn't solve, but everyone on this graph has solved at least one problem.
24r3 has solved part 1 and part 2 of day 3
>>
40 minutes
page 10
no new thread
It's Over.
>>
>>107476691
we get the threads that advent of code 2025 deserves
>>
>>107476691
we're all pooping
>>
107476777
107476777
>>
>next bread

>>107476777
>107476777
>>107476777
>107476777



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.