[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 / qa] [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: 2024d17.png (209 KB, 609x609)
209 KB
209 KB PNG
>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:
796940-44255af5
anonymous-only leaderboard:
383378-dd1e2041

previous thread: >>103538057
>>
Remember to always read your ECMA 262 standard, my fellow javascriptfags
>>
>>103548212
beat it faggot
>>
File: mokou-solving-aoc.png (205 KB, 461x605)
205 KB
205 KB PNG
how long til the brute force finishes bros...?
>>
>>103548212
why post this
>>
File: D17_washed.png (817 KB, 2400x3248)
817 KB
817 KB PNG
>>103548198
Washed Kotlin.
>>
gotta say figuring out how to solve it and having it work felt good
best puzzle of the year?
>>
>>103548226
Depending on the specifics of your bruteforce, between 2^8 and 2^30 lifetimes of the universe
>>
>>103548224
>>103548227
people post their solutions here anyway, faggot
look: >>103548229
i would prefer people write their own solutions instead of copy from someone verbatim
>>
File: day17.png (239 KB, 934x2366)
239 KB
239 KB PNG
program state as "resumable generators". always feed in 3 new bits. filter by individual yielded output values
takes about 0.5ms.
>>
File: solve.png (891 KB, 5654x4362)
891 KB
891 KB PNG
idiomatic Rust solution
>>
>>103548239
no shit its in a picture instead of spoonfeeding them how to solve it directly in your post
so they can ignore the pictures if they dont want to get spoiled
>>
>>103548247
actually kinda clean, saying this as a skeptic of rust
>>103548255
as for you, as always, your solutions are unreadable messes
>>
File: file.png (395 KB, 1280x2078)
395 KB
395 KB PNG
WASHED
>>
>>103548212

For me it's
>the output at index 0 changes every 1 step and the cycle is 1024 long, index 1 changes every 8 steps and the cycle is 8*1024 long, (same numbers as index 0) etc.
>check last number in target program array you want to generate
>find the first occurrence of that number in the cycle, set minimum to index_cycle_length*occurrence
>go in reverse order. for next index, start at previous min and find the next one in the cycle
>repeat until index 0
>return minimum
It does require generating the output of the first 1024 possible values of A to get your cycle but if you want efficiency you can just add a stop condition for the first output since all beyond that don't matter for cycle gen sake, or just determine the math required.
This I think would be fast regardless of the size of the input, and since the bigboy doesn't change opcodes and you are getting mod 8 constantly the cycle won't ever be more than 1024 so it'd need to be like an 1000 long program to even slow it down.

Cool problem overall
>>
>>103548258
if they read the whole thing after ignoring "HINT / SPOILER" that's on them
>but they'll see keywords like 'dfs' and 'reverse'
don't act like people don't discuss their solutions in their posts; they'll see those keywords anyway
if you come to /aocg/ before solving you're probably filtered anyway
>>
File: day17.png (99 KB, 875x914)
99 KB
99 KB PNG
BQN day 17
>>
>>103548288
or you could just not be an attention seeking faggot
>>
>>103548294
anonymous imageboard
>>
>>103548262
>he can't grok idiomatic Rust
filtered
>>
>>103548212
>>103548227
>>103548258
The poster is probably actually mentally retarded and he's proud of himself for reading 8 (eight) lines of code in 6 hours.
>>
>>103548217
some fuckery is happening even before any of the numbers exceed 2147483647
i might be retarded
>>
deleted for you faggots if you're going to cry that much about an aoc solution in your aocg threads
>>
>>103548314
Good, retard
>>
HINT / SPOILER

observations
------------
- on each step you pop the last 3 bits from A
- B and C are temporary registers
- the answer is 48 bits; a bad day for brootchads

solution
--------
dfs in reverse to a depth of 16; try all 8 possible permutations of 3 bits and dfs `A << 3 | bits` if the output matches the reversed program at that depth

HINT / SPOILER
>>
>>103548322
based post undeleter
>>
>>103548322
>introducing subtle errors into the spoiler repost
devilish
>>
>off by 1
hmmm
>>
How the fuck are spoilers real just walk away from the screen like close your eyes
>>
>>103548322
Thanks anon! Appreciate the helpful post!
>>
>>103548303
Can anyone confirm this is actually correct?

Register A: 800263
Program: 2,4,1,5,7,5,1,6,4,1,5,5,0,3,3,0
Output: 5,5,5,0,3,3,0



Register A: 800264
Program: 2,4,1,5,7,5,1,6,4,1,5,5,0,3,3,0
Output: 3,6,5,0,3,3,0


This is going against my intuitions of how the most significant 3 bits should work...
>>
>>103548280
The other observation is that the final program is just the reversed form of the base 8 representation of your A value, except instead of 0-8 you have to cycle through the 1024 cycle for each value. That's probably a bad way to explain it but it's because each index can have 1024 different values but each next index will increment every 8 of the current index
>>
im going to sleep with my broot from 8 hours ago still running wish me luck bros
>>
>>103548358
yeah i get the same
>>
>>103548358
I get the same results for both.
>>
File: lawyer.png (446 KB, 1030x651)
446 KB
446 KB PNG
>>103548362
can you share your input, anon?
>>
>>103548364
You're gonna have to go to sleep a few trillion more times anon
>>
File: carbon.png (633 KB, 915x3851)
633 KB
633 KB PNG
Intcode, my beloved.
>>
>>103548391
Holy fucking verbosity batman
>>
listOfA = [0]
for lengthOfProgram from the end
for reminder 0-7
simulate for each A in listOfA using A*8 + rem as a starting register value
if it outputs a subprogram of original push A*8 + rem to newListOfA
endFor
replace listOfA with newListOfA
endFor
return min of listOfA
>>
>>103548362
To illustrate what I mean see this
[0]
[1]
[2, 1]
[3, 1]
[4, 2, 1]
[5, 2, 1]
[6, 3, 1]
[7, 3, 1]
[8, 4, 2]
[9, 4, 2]
[0, 5, 2]
[1, 5, 2]
[2, 6, 3]
[3, 6, 3]
[4, 7, 3]
[5, 7, 3]
[6, 8, 4]
[7, 8, 4]
[8, 9, 4]
[9, 9, 4]

To compare to what I was saying earlier, this one has a cycle of 10 and it increments the next index every 2. So my input (and the smallboy too I think) has a cycle of 1024 and iterates every 8
>>103548380
Give me a sec, just shitposting in bed I'll post it though I think this insight is true for all inputs. Check your first 1024 and see if the first digits cycles exactly in the next 1024
>>
forgot i wasted a bunch of time on part 1 because i thought XOR was | in python instead of ^
not that it mattered because part 2 took forever
>>
>>103548424
^ is exponentiation, silly!
>>
File: carbon.png (1 MB, 1434x6076)
1 MB
1 MB PNG
Unwashed golang.
I feel like I could compute each value from each input, but too dump to do that and just bruteforced number on each position
>>
>>103548431
God what a fucking ugly language
>>
>>103548380
>>103548414
2,4,1,1,7,5,1,5,4,5,0,3,5,5,3,0

Don't have my code with me at the moment, was just able to grab my input on my phone since it's 4am. But the 1024-8 cycle should hold true for all inputs since it worked for the smallboy and it seems all the inputs perform the same operations relatively
>>
>>103548431
(Go)d what a fucking sexy language
>>
File: file.png (20 KB, 336x889)
20 KB
20 KB PNG
>>103548440
mine isnt checking 1024 for each index
assuming 164540892147362 is the right answer
>>
>>103548439
Dunno, looks better than rust solutions, every over lang don't matter because performance difference is just too high
>>
>>103548512
idiomatic Go solution
package iter

func Pull[V any](seq Seq[V]) (next func() (V, bool), stop func()) {
yield := make(chan struct{value V; ok bool})
pull := make(chan struct{}{})
go func() {
seq(func(v V) bool {
_, ok := <-pull
if !ok {
return false
}
yield <- struct{value V; ok bool}{v, true}
})

close(yield)
}()

next = func() (V, bool) {
pull <- struct{}{}
return <-yield
}
stop = func() { close(pull) }
return
}
>>
>>103548519
yea, sadly iterators looks awful, I think nobody will use them outside of stdlib, until someone fixes this mess
>>
>>103548519
When did that get deleted?
>>
>>103548508
Actually the answer is (...)390. I don't know why, it's only off by a little bit. It confuses me since it's almost correct
>>
>>103548562
Sorry, meant 389.
>>
>>103548519
solution to what?
>>
>>103548571
to what ails ya'
>>
File: file.png (61 KB, 450x1214)
61 KB
61 KB PNG
>>103548562
>>103548570
ah interesting, i guess i got lucky with my input then, i was only checking the most recent digit but with this one it actually flips the second digit before finding the first, then flips it back a bit later if you keep going
works now if i check all of them
>>
nah im losing my fucking mind
is this another 2016 day 6? fuck me what the hell
>>
>>103548717
>2016 day 6
?
>>
>>103548717
it's just 7 lines of code bro
two of the variables are temporary bro
you can bruteforce in 0.5s bro
>>
>>103548727
i think he means 2006 day 16
>>
>>103548738
>advent of code 2006
?
>>
alright I know my bruteforce is correct and its just going to take really long so i'll just go to reddit and get myself the start
>>
File: file.png (62 KB, 857x212)
62 KB
62 KB PNG
>>103548727
oh i meant 2018 day 6
>>
>>103548741
yes? how do you think Christmas was saved before 2015?
>>
>>103548717
Js?
>>
>>103548717
>>103548747
I felt the same way at one point.
if you're using javascript like I was, there is a secret special edge case not present in any other language
>>
>>103548763
let me know the edgecase otherwise im jumping off a bridge
>>
>>103548439
I don't know golang, but I like how it looks.
>>
>>103548217
>>103548765
>>
>>103548765
blind retard: >>103548217
>>
>>103548765
Look at op
>>
>>103548774
>>103548775
i saw this and accounted for it so im just doing something else wrong
>>
File: carbon.png (118 KB, 1280x944)
118 KB
118 KB PNG
got stuck a bit on p2 but it turned out to be pretty simple once you step through the program and see what it actually does..
public static void Run(Span<int> program, int a, int b, int c, List<int> outputs)
{
var a, b, c;
int ip = 0;

while (ip < program.Length) {
int operand = program[ip + 1];
int combo = operand < 4 ? operand : (operand == 4 ? a : (operand == 5 ? b : c));

switch (program[ip]) {
case 0: a /= (1 << combo);
case 1: b ^= operand;
case 2: b = combo % 8;
case 3 when(a != 0): ip = operand; continue;
case 4: b ^= c;
case 5: outputs.Add(combo % 8);
case 6: b = a / (1 << combo);
case 7: c = a / (1 << combo);
}

ip += 2;
}
}
>>
File: day9goldbut.png (47 KB, 874x801)
47 KB
47 KB PNG
I get the gold result but there is a TON of files remaining trying to be placed but apparently no space for them left.
I'll have to implement some thing to keep track of the largest free space available to the left so I can quickly skip files that can't be placed anywhere.
>>
>only 16h left
I don't think I can make it bros
>>
Hilarious how the entire silver star leaderboard for today and the gold star leaderboard are full of completely different people.

Strange how "KedharnadhKamatham" solved part 1 in 28 seconds but doesn't appear on the gold leaderboard at all
Its kinda sad that this is how we celebrate 10 years of AoC, by having machines solve Christmas for us.
I hope AoC doesn't end like this.
>>
File: day17tests.png (74 KB, 688x531)
74 KB
74 KB PNG
IT PASSES EVERY TEST

ERIC YOU FUCKING DOUBLE GORILLA NIGGER WHY DOES IT FAIL ON INPUT REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
>>
>>103548869
your broot will finish in 5 more minutes
>>
>>103548878
did you read the last line of part 1? the part clearly bolded telling you in what form to submit your answer?
>>
>>103548878
part 1?
commas are part of the answer
>>
>>103548870
who cares about the public leaderboard
just enjoy the puzzles
>>
>>103548878
lol my part 2 code doesnt work on either of the examples
>>
im fully willing to admit i got filtered today but out of curiosity i tried to implement >>103548115

it doesnt work on my input. am i just that retarded or is my input just more tricky than lucky anon here?
>>
>>103548887
>>103548889
That's retarded. "join on spaces" means get rid of the spaces and concatenate what was previously separated by them, how is this any different?
>>
>>103548941
"what do you get if you use commas to join the values it output into a single string?"
retard
>>
>>103548940
i found this didnt work on this input too >>103548648
>>103548440
until i changed the condition to
while not all(a == b for a,b in zip(reversed(run(registers, program)), reversed(program))):

i did get a lucky input
>>
File: xarbon.png (14 KB, 484x772)
14 KB
14 KB PNG
washed ass
no eric, fuck you with the 150k united statian dollars
your paycheck is from me (as always) $0.00
let the AoC++ paypigs be enough
>>
>>103548941
>use commas to join the values
>gives you a literal fucking example answer
You're the only one who's retarded anon.
>>
>>103548961
>washed
i beg to differ
>>
>>103548940
the difference is in the program, so you need to look up what program indexes modify registers A B and C and adapt the code
>>
File: day9gold.png (42 KB, 754x797)
42 KB
42 KB PNG
Winner winner chicken dinner.
>>
>>103548969
Yes. here's the unwashed >>103546692
Compare to that
>>
>>103548981
you're the canonical puzzle solver of /g/, never forget that
>>
>>103548940
>>103548958
i think other people did something similar but also implemented backtracking, which i didnt do
to explain, there are multiple values which could result in it getting n for a particular index, and i just took the first one each time, but its not guaranteed to be the right one
e.g. something like 101 or 001 (binary) might both give you the same value so you could try 001 and if it fails on the next one, backtrack and try 101
>>
File: Capture2.png (9 KB, 416x283)
9 KB
9 KB PNG
data = open("Day 17 input.txt", "r").read().strip().replace("Register A: ", "").replace("Register B: ", "").replace("Register C: ", "").replace("Program: ", "").split("\n\n")

rom = map(int, data[1].split(","))

def combo(i, a, b, c):
if 0 <= i <= 3: return i
elif i == 4: return a
elif i == 5: return b
elif i == 6: return c
else: print "combo screwup"

def run(a):
b = 0
c = 0
pc = 0
outputs = []
while pc < len(rom):
if rom[pc] == 0:
a /= 1 << combo(rom[pc+1], a, b, c)
elif rom[pc] == 1:
b ^= rom[pc+1]
elif rom[pc] == 2:
b = combo(rom[pc+1], a, b, c) & 7
elif rom[pc] == 3:
if a != 0:
pc = rom[pc+1]-2
elif rom[pc] == 4:
b ^= c
elif rom[pc] == 5:
#print combo(rom[pc+1], a, b, c)&7
outputs.append(combo(rom[pc+1], a, b, c)&7)
elif rom[pc] == 6:
b = a / (1 << combo(rom[pc+1], a, b, c))
elif rom[pc] == 7:
c = a / (1 << combo(rom[pc+1], a, b, c))
pc += 2
#print len(outputs)
return outputs

def solve(prefix, step):
for i in range(8):
if run(((prefix<<3) | i) << (step*3))[step:] == rom[step:]:
print bin(((prefix<<3) | i) << (step*3))
if step == 0:
return True, (prefix<<3) | i
else:
solved, n = solve((prefix<<3) | i, step-1)
if solved:
return solved, n
return False, 0

print solve(0, 15)

Started late.
>manually screw around with A, narrow in on the first 16-digit answer, start brute force (never finished). Also realize the later digits are only affected by high value changes.
>narrow in on highest 16-digit answer, realize it's 2**48-1.
>disassemble program enough to see it consumes 3 bits at a time, and each digit also depends on some extra higher bits (but not any lower bits).
>start manually working out the bits, realize there are possible branches, write a recursive solver instead.
Took a while to find the right approach, but not too bad. Satisfying to see it construct the final number (pic related).
>>
>>103548994
i even tried it with backtracking, didnt work

i think my program is FUCKED
2,4 B = A % 8
1,5 B = B ^ 5
7,5 C = A >> B
1,6 B = B ^ 6
4,1 B = B ^ C
5,5 push b
0,3 A = A << 2
3,0 loop


so if A % 8 = 2
2 xor 5 = 7
A >> 7 means that means that 128 numbers can effect the output
thats a deep ass fucking search compared to lucky fuckers who only needed to test 8
>>
>>103549051
whats your input?
>>
>>103549055
it's a trap, DO NOT POST YOUR INPUT
it's illegal and eric's reddit mod will sue you and you will have to pay 150000$
>>
>>103549055
its in >>103549051 just remove my annotations
>>
>>103549064
>just remove my annotations
no
>>
>>103549066
fine, lazy ass
2,4,1,5,7,5,1,6,4,1,5,5,0,3,3,0


sue me eric 150k for 16 numbers
>>
File: file.png (125 KB, 1820x634)
125 KB
125 KB PNG
>>103549064
this solves it instantly for me
unless the answer is too high? looks right though
part B 107413700225434
>>
>>103549051
>>103549090
I'm also getting that, runs in half the time of my own input.
>>
File: image.png (710 KB, 1015x1044)
710 KB
710 KB PNG
my humble BQN solution for day 17, generalized to solve both parts now \^o^/

(don't ask me how Xor52 works, i had to steal it from someone else since BQN only uses floating point and has no 64 bit integers)
>>
>>103549090
i swear i had this implented ages ago but gave up because the answer was incorrect
i gotta figured out what i missed
>>
>>103549141
maybe check your registers? it should start with a fresh copy every time you run it, incase you are mutating the one that gets passed in
>>
>>103549152
my `run` command doesnt even take in a list, it just takes the a value and inits the rest to 0

ill post it when i figure out what i did wrong
>>
>>103549155
good luck anon
>>
>>103549158
thank you anon. i feel the christmas spirit thanks to you
>>
>>103549068
@HRHdaggerdragon check this out
>>
>>103549198
am i getting banned because my input is my UUID and now he fucking KNOWS
>>
>>103549207
yes, unless you buy AoC++ immediately
>>
File: file.png (4 KB, 251x53)
4 KB
4 KB PNG
>>103549227
im too broke for that shit anymore
its been tough since i lost my good paying job
>>
File: 20241217_225906804_1.webm (3.97 MB, 640x360)
3.97 MB
3.97 MB WEBM
Took a while to get a webm under size limit.
Had to speed up the video, too. Takes about 4.5 mins to run.
>>
>>103549280
>Kana key
you will never be japanese
>>
File: aoc24_17.png (460 KB, 818x3137)
460 KB
460 KB PNG
Odin
ezpz only took me 4 hours
>>
File: day9.png (617 KB, 2225x2186)
617 KB
617 KB PNG
>>103549280
Most memory intensive solution so far. I use 120kB of the GBA memory to store the information about the filesystem.
3 2byte words per file/free space. FID, size, original size.
For part one I just alternate reading left and right sides of the file system, keeping remainders from the right to fill in spaces on the left, don't have to alter the table at all.
For part two I first just compute the score of the beginning file structure, then I go from the right looking for spaces to move each file into, subtract their present score and add their moved score if they can move and update the "size" of the free space areas in the table.
And then I have r11 holding the largest free space to help skip files that can't be moved.

This was fun.
>>
>>103549287
umm sweaty he actually moved to japan, which means he's japanese - just like in his animes!
>>
>>103549287
>>103549328
>samefagging this hard
It's sad, really.
>>
>>103549280
>weeb keyboard
forget what i said earlier, filthy weeb
>>
>>103549346
>>103549328
>>103549287
>>103549280
samefag
>>
File: img-2024-12-17-15-33-03.png (100 KB, 2412x750)
100 KB
100 KB PNG
>>103549346
>>
>>103549361
>>103549358
>>103549349
>>103549346
>>103549328
samefag
>>
>>103549361
btfo the fuck out
>>
File: bruhcode1.png (17 KB, 855x87)
17 KB
17 KB PNG
REMINDER, save your code
>>
File: hm.png (5 KB, 321x142)
5 KB
5 KB PNG
>>103549365
>>
>>103548229
>>103548247
>>103548255
>>103548267
>>103548391
>counting up
did nobody do the counting down strat?
>>
>>103549287
>>103549328
>>103549346
>>103549349
>>103549358
>>103549361
>>103549365
>>103549366
all me btw
>>
>>103549387
whats the point? this way is easier
>>
File: hnnnnnghh.jpg (11 KB, 228x221)
11 KB
11 KB JPG
>>103549387
>>
File: Day17.png (188 KB, 1111x1822)
188 KB
188 KB PNG
C#.
>>
File: almost.png (11 KB, 310x272)
11 KB
11 KB PNG
>>103549412
close.
>>
File: babu_good_morning_sir.jpg (8 KB, 225x225)
8 KB
8 KB JPG
>>103549407
GOOD MORNING SIR
>>
>>103549415
thats not close at all are you stupid
>>
>>103549439
no? why are you so rude?
>>
>part 1
>impl instructions correctly
>um that's not the right answer sweaty
wtf?
>>
>>103549158
aw this is super fucking embarrassing
at some point i changed the division ops to be
if (op == 0) a = a >> combo(operand)

instead of
if (op == 0) a = floor(a / (2 ** combo(operand)))

and when i saw >>103548217 i thought this only applies to bitwise or, xor and and, not bitshift too

most embarrassing evening of my aoc life
>>
>>103549559
top kek
>>
>>103549557
>sweaty
Your fault, should have taken a shower.
>>
>>103549557
>impl instructions correctly
prove it
>>
File: Untitled.png (292 KB, 1308x859)
292 KB
292 KB PNG
look who I found
>>
>>103549605
kek
>>
>>103549557
nevermind. I assumed Bdv and Cdv numerators were their respective registers.
>>
>part2 is 2021-24 all over again, but with an annoyingly unreadable Intcode tier ISA
FUCK
>>
File: 1734433493701206.png (52 KB, 665x278)
52 KB
52 KB PNG
>>103549605
>>
braindead but fun solution
>>
File: code.png (45 KB, 622x702)
45 KB
45 KB PNG
skibidi
>>
>>103549605
Post link nigger
>>
>>103549793
>those fucking inlay hints
>those fucking colors
literally unreadable
>>
File: carbon.png (3.83 MB, 2480x3508)
3.83 MB
3.83 MB PNG
>>103549559
alright heres the monument to my shame
other than that dumbass xor function its not even that bad
but i could have solved this 4 hours ago if i wasnt clueless
>>
>>103549816
filtered
>>
>>103548358
you’re altering the 4 least significant bits
>0111
>1000
>>
>>103549816
i like those colours, nice and festive!
>>
File: IMG_4039.gif (578 KB, 299x198)
578 KB
578 KB GIF
>>103549605
>used Z3
now I’m curious, might give ol zoomzoom here a view
>>
>>103549605
>He still hasn't gotten gold
>>
File: mokou-vomit.jpg (122 KB, 415x497)
122 KB
122 KB JPG
it's been 17 days and i have not yet seen a single (1) rust solution that isn't vomit inducing
>>
File: idiomatic_calendar.png (3.53 MB, 7913x4038)
3.53 MB
3.53 MB PNG
wow
>>
>>103549867
Don't make me tap the calendar
>>
File: IMG_3471.png (140 KB, 825x3574)
140 KB
140 KB PNG
>>103549894
don’t make me tap the manifesto
>>
>>103549904
>/aocg/
>>
I fucking hate these kind of puzzles almost as much as I hate the line segments ones.
give me some more grids ericbrehh
>>
Is there a generalizable solution that isn't: implement your own optimizing compiler or should I just inspect my individual input alone?

No spoilers.
>>
>>103549971
I don't think there is one that isn't bruteforce
>>
File: carbon.png (628 KB, 1870x1200)
628 KB
628 KB PNG
Not too bad
>>
>>103549971
I found it helpful to actually look at the input, like: write its assembly language on a piece of paper
>>
>>103549991
Yes, I understand that, I've done 2021-24 as well so I'm familiar with this cancer, I just want to know if I should hard code and fuck off or not.
>>
>>103549605
I played a bit with Z3 for this but gave up after reading that it doesn't support XOR for integers.
Doing it using bit vectors looked more of a pain than solving it without Z3.
>>
>works on example
>doesn't work on input
I can't anymore bros...
>>
File: file.png (54 KB, 685x864)
54 KB
54 KB PNG
experimenting in jupyter is nice for aoc but maybe I shouldve wrote the bruteforce in c instead kek. This is going to take a while..
>>
File: carbon(16).png (1.59 MB, 2048x2844)
1.59 MB
1.59 MB PNG
Haskell solution. Fun day, I enjoy these "decompilation" problems
>>
>>103550068
see >>103549641
>>
>>103550058
it really was not >>103549694
>>
>>103548198
advent of laid of programmers with nothing better to do
>>
>>103550140
I can't understand you with goldstein's dick in your mouth
>>
>>103550070
Just to let you know, your target is in the 100 trillion range so "a while" is an understatement.
>>
>>103550015
yeah I don’t think my solution generalizes at all. it strongly uses special properties of the input, which I gather are common to everybody’s input. it would not work on just any program
>>
>>103550140
>implying I’m getting laid on the 25th
doubt
>>
File: IMG_4063.jpg (13 KB, 300x168)
13 KB
13 KB JPG
>>103549793
>CGA palette 0
Try palette 1, there should be a switch on the back of your monitor
>>
>>103549975
symbolic execution >>103549694
>>
>>103550140
>>103550249
"i'm getting laid..."
"AWESOME!"
"...off."
"Oh."
>>
>>103550120
nope not it
>>
>>103550220
kek, fuck
>>
>>103550379
48 bits, but you can broot it in chunks of 3 bits
>>
>>103550388
it's faster if you start at int64.max and count down
>>
12 HOURS LEFT
Brooters you better start praying.
>>
>>103550396
i'll just wait for cosmic rays to give me the right answer
any minute now...
>>
>>103550388
if you know about the 3 bit shit, it's not even brooting, kek, you basically check 16 * 8 numbers
>>
>>103550407
all this time could have been spent on writing a nice graphical disassembly view of the program so you can peacefully reverse engineer it and notice a very exploitable pattern to speed up the process
>>
>>103550464
what the fuck is your problem?
>>
>>103550464
>imagine getting triggered by counting down
were you molested as a child while playing hide and seek or what?
>>
>>103550473
that you're trolling in /g/ AGAIN
>>
>>103550473
looks like an advertisement for "/b/", whatever that is
just report it and move on
>>
>>103550271
It's gruvbox, so I guess you aren't far off
>>
>>103550479
i'm sorry if i'm polluting your stream of potential solutions to steal and pass off as your own, i guess?
>>
>>103550488
>it's faster if you start at int64.max and
anyone with a single braincell knows that this is gigantic bullshit, you're just doing this to troll retards
WHICH IS AGAINST THE RULES OUTSIDE OF /b/
>>
>>103550473
filter
>>
>>103550499
why are you posting misinformation in this thread? i literally solved the problem by counting down...
>it's not possible
why not? you stupid bastard
>>
>>103550511
One more trollpost and I'm reporting.
>>
>>103550520
you're probably one of those retards propagating the "you have to solve with dijkstra's" psyop yesterday
i'm telling daggerdragon
>>
File: fuck off.jpg (382 KB, 936x1024)
382 KB
382 KB JPG
>>103550520
>>
>>103550140
we have better things to do Anon, we just choose not to do them
>>
How would counting down work though? We must find the lowest value for a, when do you know when to stop counting down?
>>
>>103549694
Could Z3 somehow reason about an input that isn't guaranteed to make progress on the output before hitting a jump?
You can make the registers into arrays indexed by a time variable and then phrase everything in terms of ForAll constraints, but I have no clue about how well Z3 actually solves systems like that.
>>
>>103550580
Stop, don't engage with him. He's a troll.
99% percent tho that this is him speaking with himself so others will bite but just in case.
>>
>>103550591
you are the troll though
>>
Hold on a second, where is drawfag. Please don't tell me drawfag was filtered.....
>>
File: img-2024-12-17-18-14-46.png (1.46 MB, 1280x720)
1.46 MB
1.46 MB PNG
>>103550608
forget the drawfag, where is the input-chan faggot?
>>
>>103550580
it wouldn't, it's a meme. on day 12 some anon suggested an alternative to counting corners and provided an extremely vague hint as to what that was and this hyper mad anon spent probably 48h or more trying to figure out what the solution was but as you can see, he got filtered in the end and is just infinitely mad now.
>>
>>103550623
>ai
he was obviously filtered finding the Christmas tree.
>>
>>103550626
>an extremely vague hint
dumb retard, nothing vague about counting down.
You start with 4 * area and then count down to get the perimeter. Then for part 2 you take the perimeter count and count down to get the sides.
>>
>>103550580
when you find a new value you have to check it with higher values to make sure it's lower than them, duh
>>
>>103550644
so you count up?
>>
>>103550651
no.
>>
>>103550626
I got the solution for that day long before that conversation, and I instantly pointed out the intent behind the post.
>>103550638
Hang yourself rust troon. You're participating in this shit now too.
Wrong, I'm not filter, in fact I'm the first on both /g/ leadboards.
>>
>>103550670
>rust troon
>he thinks that everyone who uses "dumb retard" is me
well, you're right. but I participated in the counting down meme from the start, dumb retard.
>>
>>103550135
Although that one doesn't look too complicated I just watched the guy struggling with bool vectors for an hour to try getting it to work so I'm glad I avoided that route.
>>
>fun reverse engineering problem
>llm's btfo
>javascript jeets btfo
Today was a good day
>>
>>103550687
No one gives a shit about your solutions, participating all day every day in unfunny troll campaigns, a disgusting man pretending to be woman, terminally online, and retarded too.
The niveau has really become low for someone to become a CIA agent. All you have to do is to shill a backdoored language and you get paid. Amazing.
https://files.catbox.moe/1cx70l.mp4
>>
k, 2 was gay. but it didn't mean I have to rewrite my whole program. still gay since it only works because Eric makes it work.
>>
>>103550786
lmao, xolatile is seething right now
>>
>>103550670
>instantly pointed out the intent
no you started sperging about it not being a valid solution, which it is btw.
>>
>>103550797
And he lives rent free in your head, every time I post you mention him. It's fucking hilarious.
>>103550807
It doesn't matter if it CAN be solved using counting down, the point is that it's significantly more complicated than any other solution and there's absolutely no point to it. You know that too, and you didn't implement yourself, exactly because of that.
That solution is the same kind as something like let's generate a random number for each graph component, and if it's 0 we traverse with DFS, if 1 let's traverse with BFS. It CAN be solved like that, but an gigantic bullshit and no reason to.
>>
>>103550589
the problem is that you need to dispatch based on p[ip]
i'm literally a z3 noob though so don't know
wasn't needed though, this returns in like a second
>>
alright I've figured out my solution is somewhere between 8^15 and 8^16 we'll have this brooted in no time
>>
>>103550849
your solution will be 48 bits
8^15 is 46 bits
>>
File: manualp2.png (338 KB, 700x495)
338 KB
338 KB PNG
this was me brooting part 2
>>
>>103550836
correct I didn't, on the other hand it's not at all "significantly more complicated" either, dunno what you're getting that from
>>
>>103550849
You have figured out the main insight needed to not broot it.
>>
>>103550900
Thanks for confirming, no further questions.
(Nobody respond to that, ignore him.)
>>
>>103550929
you need meds and you need them now
>>
File: aoc_17.png (252 KB, 2000x1000)
252 KB
252 KB PNG
>>
>>103550845
Yeah, your program terminates because you always hit an out (that increases outl) before hitting a jnz.
I will have to try an array solution later.
>>
>>103550977
>2017 was the easiest year
didn't someone here say 2017 was the comfiest year?
>>
i want some puzzles I can do nice visualizations of
>>
>>103551039
>[the year i started] was the comfiest year
wrong. It was actually the year I started.
>>
has someone already added this architecture to ghidra?
>>
Is there an AoC colorscheme for Neovim?
>>
>>103550589
I did that and it didn't do well. I think I ran it for half an hour or so without finding a solution.
After explicitly writing the loop, it returned instantly.
>>
>>103551003
yeah
if i was running into infinite loops i'd probably add a hard iteration depth limit and hope for the best
plz poast soluton
>>
File: well.png (3 KB, 77x240)
3 KB
3 KB PNG
which one should I do while waiting for tomorrow?
>>
>>103551227
Do the 2015 one that makes you compute an MD5 sum.
>>
>>103551227
https://adventofcode.com/2018/day/15
elves and goblins fighting
>>
File: phone.jpg (8 KB, 200x200)
8 KB
8 KB JPG
How long will I be waiting for Part 2 if I bail on an iteration if the last output is not equal or the size of the output is greater than the program size?
I should be looking for patterns in how the seed affects the output shouldn't I?
>>
>>103551267
just fucking write your code out
you'll see it takes the first 3 bits from A, rshifts A by 3 bits, and loops if there's anything left
start there
>>
>>103551242
huh, do you mean this one? https://adventofcode.com/2015/day/4
i did that one a few days ago
>>103551247
looks interesting, i'll give it a go
>>
>>103551198
elflord, obviously
>>
>>103548217
JS bros.... I don't feel so good.
>>
>>103551267
step 1: disassemble the program
step 2: realize why naive brooooot is pointless
>>
>>103551384
step 3: realise you can "count down" by starting at the end and handling 3 bits at a time; make sure you count down from a 64bit int
>>
>>103551267
more like
>the sneed
>>
if I run part2 answer with my part 1 code it should output a string of equal length or can there be something more?
>>
>>103551417
no, the program has to print itself verbatim
16 numbers generated from 48 bits (16 sets of 3)
>>
>>103551247
kino problem
>>
>>103551471
>have to feed it the same amount of data as the program itself
People are really calling this a quine?
>>
>>103551349
that works
>>
>>103551526
yes, they are stupid
>>
I've just noticed that my program and all of the examples don't actually use opcode 6 (the bdv instruction). Is this the case for everyone else? Have we all been tricked into implementing a superfluous instruction in our programs?
>>
>>103551707
Part 3 in the AOC++ version of this problem actually tells you what opcode 7 does, so you better implement it
>>
>>103551707
same for me; everything but bdv is used
>>
>>103551718
don't tell me it's DEC?
>>
>>103549559
>when i saw >>103548217 i thought this only applies to bitwise or, xor and and, not bitshift too
That's because you haven't read your ECMA 262 standard, my fellow javascriptfag
>>
>>103551733
its the input instruction, it reads an intcode program to register D and then you have to implement an intcode vm in bitcode
>>
>>103551802
stop making up words
>>
>>103550533
You need double Dijkstra actually
>>
File: 690688942391164948.png (18 KB, 128x89)
18 KB
18 KB PNG
Your program IS capable of finding all valid values of A, not just the lowest one, right anon?
>>
>>103551888
of course; for how would i know which is the lowest one unless i knew all of them?
>>
>>103551888
I solved it by counting down. When I get to the last valid a, I know that it is the lowest.
>>
>>103551901
based, i solved it the same way; 12 hours of brooting paid off
>>
>>103551901
KILL YOURSELF
>>
Is this viable to brute force on a GPU?
I know CPU would take an obscenely long time, but this seems well suited to a GPU
>>
ah fuck it requires bits from higher up the word
>>
>>103551866
i'm not making up any words
>>
>>103552056
ok so start bottom up; the first set of 3 bits, i.e. the last digit of your program, can be solved for independently
>>
File: UUUUUGH.png (33 KB, 289x446)
33 KB
33 KB PNG
>>103551247
ugh that's a lot of stuff but I bet it makes a neat movie when it's done
>>
File: 1710358217048105.png (2.79 MB, 784x4000)
2.79 MB
2.79 MB PNG
Fuck this. The one day I couldn't wait until 2 AM Eric decides to drop a fun one.

Benchmark 1: ../target/release/aoc-day17 /tmp/input
Time (mean ± σ): 547.5 µs ± 9.7 µs [User: 385.0 µs, System: 96.5 µs]
Range (min … max): 534.2 µs … 562.9 µs 10 runs
>>
>>103552114
You somehow managed to make this more bloated than my intcode vm, is this the power of rust?
>>
>>103552141
A lot of it is just pattern matching.
>>
>>103551888
the first valid match it finds is the lowest though
>>
>>103552114
2AM? Where the fuck do you live? In the middle of the Atlantic?
>>
>>103552254
brazil
>>
>>103548267
Your code doesn't check if one of the previously checked output change in part b...which can happen.
You should check all element of the output list instead of just output[0].
>>
>>103552271
> The Kingdom of Kong
Make sense
>>
>>103552074
this only works since registers b and c are written before they are read in each cycle. else you would need 9 bits going backwards still one less than the 10 bit needed for forward iteration. well, I think most solutions depend heavily on the specific structure of the inputs.
>>
>>103551247
Best puzzle of all
>>
>>103552313
yes anon, the general case is np-complete
when eric asks you to do something np-complete you have to look for weaknesses in the input
>>
>>103552337
Good puzzles are 15/19, 22/16 and 23/25
There are 1-2 goods per year
95% of aoc puzzles are dogshit
>>
>>103552338
you just keep throwing around the np-complete right? still looking for weaknesses in the provided instructions (i.e. the problem structure) is much more satisfying than looking for them within the input... also it feels like more general solutions should be possible. esp. since the only branching OP only takes literal values.
>>
AAA I got it FUCK finally
had to disassemble my input program by hand
>>
>>103552373
it's against programming intuition to solve a specific problem on a specific input rather than solve the more general problem, to the point that very feasible work goes undone because the general problem is impossible.
hence, the puzzle
>>
>>103552337
the threads when that dropped were legendary
the utter panic at how long it took for the global leaderboard to fill
>>
File: 1476174894899.gif (13 KB, 416x416)
13 KB
13 KB GIF
Finally passed today's part 2. I'm not filtered after all!
>>
Did pen and paper bros win biggest today?
>>
Part 3: for an arbitrary program, determine which initial register values will cause the device to enter an infinite loop.
>>
File: day17.png (21 KB, 762x496)
21 KB
21 KB PNG
>>103551888
of course
>>
>>103551227
2018d17
>>
>>103552438
Impossible
https://en.wikipedia.org/wiki/Halting_problem
>>
/aocg/ is getting visibly slower. the great filter is taking its toll.
>>
>>103552454
yes anon, that's the joke
>>
>>103552464
haha anon good one very funny
>>
>>103552464
>>103552494
I laughed
>>
>>103552454
That was the joke, but actually it is not impossible. The Chronospatial Computer is not turing-complete.
>>
>>103552464
>>103552454
this assumes touring completes...
the instruction set feels much more like a glorified filter than a programming language...
almost all instructions remove bits, there are none that "generate" new ones. info cannot flow out of register b(?)... it's just too restricted to be a programming language
>>
>>103552539
the only "cyclic" data flow is via the "jnz a".
and when this bit of info is transferred, a=0 => this transfer can only happen once.
this feels like deciding if we loop should be possible
inst -> a
inst -> b
inst -> c
a -> inst
a -> c
c -> b
a -> b
a -> OUT
b -> OUT
c -> OUT
>>
File: codeimage-snippet_17.png (120 KB, 815x587)
120 KB
120 KB PNG
210µs runtime, eat shit brooters
>>
>>103552674
I started trying to write a proof. The complicated part is adv 5, since B might be 0 (meaning that adv 5 would not decrease A), but if B is 0 then B might still increase later via bst or bxl.
>>
>>103551901
kek this meme is growing on me
>>
>>103552539
Whether it loops can be determined by some rules, not to lay them all out but just for example
>if there is no jump instruction, it will not infinitely loop
Without jumps it will just proceed to the end
>if there is an adv instruction within any loop, it will not infinitely loop
adv will continuously reduce A to zero and then eventually result in the loop ending, so any form of jump must jump somewhere that it can reach itself without coming into contact with an adv instruction

This doesn't seem tremendously difficult, might get hard in the details if you jump to an odd number then start reading a secondary set of opcodes
>>
>>103552798
Oh, as >>103552741 pointed out adv might not reduce A. Still, definitely not impossible to prove
>>
>>103550140
yes
t. doing this at work
>>
File: carbon(3).png (1.79 MB, 1784x8488)
1.79 MB
1.79 MB PNG
Unwashed haskell ass after multiple hours and 4 pages of pen and paper
>>
>>103552798
>if there is an adv instruction within any loop, it will not infinitely loop
This is not true. It depends on the operand of the adv instruction. adv 0 is no-op (A / (2^0) == A). For adv 5, nothing happens if B is 0 (and it's hard to tell whether B will be 0, since there are many ways to change B).
>>
>>103552798
I was thinking an argument of the form:
if there is no non-zero "adv" within n cycles (and the program has not ended) then we have to be stuck in a cycle. i.e. a single "state space is limited" argument without "adv".
when adv happens we lose at least one bit of a => iterate the argument and you are done.
>>
today and the christmas tree are my favourites so far this year
>>
>>103550140
filtered
>>
>>103552880
Same. Got a huge rush from figuring out the pattern here and seeing the tree for the first time.

Shout out to day 6 also.
>>
>>103552891
I just brooted day 6
>>
>>103552880
christmas tree and the box pushing one for sure
>>
>part 2
ummm brootbros.. i don't think this is brootable...
>>
>>103552831
Same. Feels good to be saving the Christmas and getting paid for it.
>>
>>103552938
Can't this be brooted on GPU?
>>
>>103552963
if you count down i think so
>>
>>103552850
number of program states is limited by a**3 times len(program), since no number can ever be formed that is larger than a. => state space is limited => just run the program for that many cycles. if haven't stopped until then, we are in a cycle.
>>
>>103552459
yep
.t filtered
>>
>>103552984
will you still post the graph every day?
>>
>>103552984
>>103552996
nice to see the progress when you search by filename on desuarchive
>>
Is there a way to do Part 2 generally? I reverse engineered it, typed the reverse engineered instructions into a recursive function that works backwards to the number. But that requires me to read the instructions and type them in by hand for each input.
>>
>>103552984
seeing myself officially filtered actually feels kinda liberating. I was way over my head anyway. I was spending HOURS every day to keep up, and felt miserable. it wasn't comfy or even satisfying at all.
t. filtered on day 16 part 2
>>
>drawfriend filtered
>thread indexer filtered
>aisloppers filtered
>calendaranon filtered
>even filteranon is filtered
It's lonely at the top
>>
>>103553087
>company christmas party soon
either I'll speedrun it drunk during the night, or it's officially over
>>
>>103553087
I'm still here :)
>>
>missed one day on the first week because I was meeting family

It's not fair bros
>>
>>103553108
I'm usually filtered due to family around Christmas and have to finish on the 26th
>>
>>103552984
>hendrik sandnigger
remove him NOW
>>
File: 17.png (1.67 MB, 1322x4224)
1.67 MB
1.67 MB PNG
Slightly washed C++. Doing these at work the next morning instead of right when they drop is much more comfy, leaderboard be damned.
>>
>>103553081
>>103547440
I was too dumb to reverse engineer it, but I noticed that as the input value increases, the output numbers work like octal digits except out of order. So after each guess, I find the highest index where the output differs from the expected value, raise 8 to that power, and add it to the guess.
>>
File: aocbu.png (252 KB, 640x360)
252 KB
252 KB PNG
>>103553086
I have allowed myself to be consumed.
>>
>>103553244
Replace the % 8 with
& 7
for peak comfiness
>>
>>103553372
Yeah, I should have just used >> to divide as well instead of the nonsense I did.
>>
register a is the input.
the adv,bdv,cdv instructions can be thought of as "read from input". the trick is to have a "lazy" input that only gets set once it is required, to allow pruning to occur before actual work is done.When such a "lazy" read is requested you just have to provide all possible inputs (like in probabilisitc programming"). from the filtered lazy sequence of valid just take the first one. Thi s model fits nicely into "effectful" programming where each read calls an effect handler and that handler just loops over all possible continuations . thanks for listening to my TED talk.
>>
>>103552984
Where did Eric fell you?
>>
>>103553372
>>103553420
% 8 should be easy for the compiler to turn into
& 7

The division between variables might be more difficult, but maybe the compiler is able to turn
c = na / (1 << b);
into a shift as well.
>>
>54.6% gold
>>
>>103553086
I failed on 16 part 2 also. That one did my head in.
>>
The AoC subreddit is so sad. 80% of the posts are people asking for help debugging, but since they can't share their inputs, nobody is really able to help.
>>
>>103553483
that's the actual reason eric goes so overboard with his "intelectual property" he's a sadist.
>>
>>103553086
>>103553471
>16 part 2
that one was free if you used Dijkstra for part 1
>>
>>103553495
holy based
>>
>>103553483
Eric should put out a single example that is similar enough to input runtimes that input sharing could be avoided. Or stop being a bitch about input sharing.
>>
Is AoC getting easier, or is my hard work just paying off? I would love to see these problems as myself from 5 years ago when I started and see what I think of them.
>>
File: 2cij2v.jpg (49 KB, 526x400)
49 KB
49 KB JPG
>>103553483
>dm people saying I can help if they give me their input
>immediately tell u/daggerdragon they were sharing inputs and get them banned
>>
>>103553498
I did. I just couldn't figure out Part 2 and I got justly filtered. I will now commit sudoku.
>>
>>103550520
>announcing a report
>>
What the fuck is going on
I tried the simple bruteforce, obviously didn't work, tried some memos and pruning still didn't work
So I took my input and traced the full program, coded that program directly instead of simulating a CPU. Got it down to 2 lines of code + 3 more for pruning. SImplified all the mathematically redundant operations (e.g. 4^B^4 simplifies to B), rewrote it in C so it'd be faster. Got it to where it checked billions of inputs per minute, but it still wasn't enough
So then I think maybe there is some patterns I'm missing on, or a math's trick, or a way to work backwards, and the answer to all is no unless its in binary, very likely not, and certainly not, so it seems completely fucked
>>
>>103553593
check what the output is for every input value from 0 to 10000
check the data
find patterns and use them
>>
>>103553453
if you want to retain the lower bits, &7 is exactly what you mean by that, and %8 is something else that might mean that depending on the specific values involved and the specific tradition of % involved. &7 relies on the reader understanding bitwise representations of numbers, which is required to understand why someone would even want to retain only some bits of a number. %8 relies on the reader understanding that this is actually &7 but the programmer wanted to write more obscure and less direct code in order to avoid having some nag come along and regurgitate ancient programming wisdom.
>>
>>103553593
If you're really going at billions of inputs per second, it could still take days to get the answer.
>>
Are /g/oons unironically using rust now? Wtf?
>>
>>103553593
for mine the program output depended solely on a. so you just need to find "a" at each step to generate the desired output.
the way my program was structured, it became clear that a portion of "a" was used for each step, then discarded and the remainder used for the next step.
i fucking hate these puzzles with a passion but there's one every year. inshallah we don't have any more.
>>
File: 1714110370185703.jpg (51 KB, 844x884)
51 KB
51 KB JPG
ok what's the trick for part two
>>
>>103553712
broot + 128 cores
>>
>>103553712
disassemble and reverse engineer
>>
>>103553712
Broot force on your GPU. Have each core try a seed value.
>>
>>103553712
The instructions amount to 8 lines of code. Honestly this is probably Eric's easiest "reverse engineer this inefficient pesudo-assembly" problem.
>>
>>103553712
>>103553673
>>
File: pitiful year.png (7 KB, 121x458)
7 KB
7 KB PNG
>>103552996
don't worry anon I'm not going anywhere, I did the same last year
>>103553162
lel. it's ok anon, he's a fellow racist fren
>>103553450
I got stuck trying to do come up with ways to do day 10 part 2 using BFS and memoization. I could easily have done the "mark-compact" day 9 part 2 but my heart wasn't in it. Then there was day 12 part 2 at this one was a motherfucker.
>>
>>103553712
generate input 3-bits at a time.
start with bits [47:45] of register a and go down. set unknown bits to zero.
find all values that generate valid last digit of output
repeat, but reuse input(s). generate all bits that give you valid last two output digits
and so on
and so on
and from all the valid inputs pick the one with smallest register a representation
>>
>>103553646
we all transitioned, join us sister
>>
I'm curious as to how many variations of the input there are. I'm guessing the bulk of the program has to be the same for everyone. Looking at mine, I expect everything apart from the second and fourth lines would have to be fixed, with the remaining two lines each in practice only letting you change a number between 1 and 7. That would put a limit on 49 distinct inputs, possibly less if you want to avoid boring combinations.
>>
>>103552702
Washed and down to 80µs, hashmaps were bloat
>>
>>103553453
This is one case where writing everything in bit operations makes the code more readable.
>>
>>103553712
Inspect your input until you understand what's happening in terms of bit shifts etc.
>>
>>103553646
It was always projection
>>
>>103553712
disassemble the program and figure out how it works (it's only 8 instructions, you can do this)
screw around with the input and monitor how it affects the output
either one of these is enough to solve it, but both is recommended
>>
>>103553897
Previous years with assembly programs usually work this way, with fewer variations than other days.
Comparing my input with others people posted, the only difference was a number or two.
>>
Interesting. Most of you seem to be guessing some bits of register A, then run the program forward one iteration, and check the output.
I ran the program backwards, starting with the output, then guessing bits in B and C, then testing if they can be consolidated with the known bits of register a.
>>
>>103553244
It took this idea for it to click for me, then I was able to clean up my solution to do it properly (just rerunning the program instead of reinplementing it).
>>
>>103553646
it's just two fags spamming
>>
File: 1734476085386.png (379 KB, 889x2047)
379 KB
379 KB PNG
>>103554184
washed up
>>
>>103553108
>not canceling all your real life arrangements for aoc
>not using sick days for aoc
>not using paid vacation for aoc
Another one filtered...
>>
>>103554327
>Another one filtered...
He was weak.
>>
took me an embarrassingly long time to solve because I didn't realise every step could have more than 1 solution. i turned it into a dfs solution and finished it in <5 mins.
>>
I didn't like today's part 2. It was NOT fun.
>>
File: day17clojure.png (1.28 MB, 991x1500)
1.28 MB
1.28 MB PNG
clojure for today
>>
>>103549123
how does Xor52 work?
>>
NEW THREAD
>>103554593
>>103554593
>>103554593
>>
File: codeimage-snippet_17(3).png (350 KB, 834x2132)
350 KB
350 KB PNG
>wrote all this and didn't even use it for part 2
>>
>>103550534
wtf is this real
>>
>>103554607
Don't worry. You're prepared for day 22. Trust the plan
>>
File: code.png (407 KB, 1642x2668)
407 KB
407 KB PNG
Python



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