[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

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: 1765573151570448.png (27 KB, 1200x1200)
27 KB
27 KB PNG
we're still here 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

See also: https://obonofcode.com/ (Summer 2026)

previous >>107536609
>>
File: calendar.png (3.16 MB, 9779x3472)
3.16 MB
3.16 MB PNG
official /aocg/ calendar
>>
>>107570855
How do you become this good at rust or programming in general?
>>
>>107570870
program exclusively in Rust for 15+ years
>>
>>107570570
Rust onboarding is stellar, actually.
you won't start to dislike the language at all until you start to maintain code.
>>
no new stuff for today?
>>
>>107570855
>>107570870
>>107570912
Attention seeking samefag.
>>
File: file.png (44 KB, 1009x351)
44 KB
44 KB PNG
>>107555399
lmao
>>
File: all me.png (46 KB, 1460x500)
46 KB
46 KB PNG
>>107572101
what are you going to do about it? cry?
>>
>>107570926
>you won't start to dislike the language at all until you start to maintain code.
Really? My anger at the borrowchecker and desire to use raw pointers and unsafe blocks for everything has only decreased over time
>>
>>107570042
anon... plz.

use saturating subtraction and then you have no problems.
>>
someone please talk to me...
>>
>>107572469
wtf, those are my posts. stop stealing my posts.
>>
i'm sad I didn't do it this year
got filtered by 1b
i guess i could have just done the silver ones and kept up
>>
File: 1726786632203684.jpg (111 KB, 923x605)
111 KB
111 KB JPG
>>107573507
you still have like 8-9 more days to do a puzzle a day
>>
need to get around to solving the previous years
>>
chat dont let the thread die wtf
>>
>>107575243
It's over.
You need to let go.
>>
z3 is pretty interesting. Seems hard to tell WHEN to use it, though.
>>
>>107572124
I also did this in Zig (after solving it on paper lol). see >>107556558

LLVM is pretty good desu. although I would imagine these are simple reductions for an optimizing compiler

>>107575573
I have never used it but "linear optimization" seems pretty clear. when you can write your problem as a set of linear equations (no modulo stuff) and you need to find a solution that minimizes or maximizes some parameter

>>107572260
doesn't solve the reverse iteration pattern since you can't put i>=0 as a condition for an unsigned type. what I did in a lot of aoc days is use wrapping sub and test only for upper bound. in grid puzzles when you write a loop for iterating over neighbors then you would do if (ni >= 0 and ni < m and ...same for nj...) this can be done with just if (ni < m and nj < n) since if there is a negative overflow then it will wrap go u32 max.
>>
>>107570870
I think idiomatic rust anon's ability to use the entire set of Iterator methods in each solution is pretty impressive lol. he even uses nightly features



[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.