Advent of Code

For discussions about adventofcode.com
Dec 8, 2022 14:57
Dec 7, 2022 14:10
I didn't really feel like doing a golf today, but I wanted to test out ChatGPT so I had it golf my code. I was really impressed: github.com/darthbeep/advent-of-code-2022/blob/main/day07/…
Dec 6, 2022 18:19
Moot point, the index trick cut down a few bytes/
Dec 6, 2022 18:11
@hyper-neutrino Let's see what this saves.
Dec 6, 2022 18:11
@hyper-neutrino This one actually took up more bytes. >13 is smart though.
Dec 6, 2022 17:10
I should also clarify that I'm pretty new to code golf so I'm probably missing out on a ton of fancy tricks.
Dec 6, 2022 17:07
Giving it a google though.
Dec 6, 2022 17:07
No actually.
Dec 6, 2022 17:02
Huh, I've never even heard of that in python.
Dec 6, 2022 16:59
@AidenChow Thanks! I've been keeping the print(r) on the third line because I'm mostly only counting the second line (same reason I'm not making the filename smaller or using arguments). Had no idea the trick to get rid of sets was possible, time to look into that.
Dec 6, 2022 14:08
I kind of gave up on jelly, at least for advent of code, but I'm proud of the golf I did in python for today: github.com/darthbeep/advent-of-code-2022/blob/main/day06/…
Dec 4, 2022 15:05
Mainly because I can tell if x is a sublist of y, but I do that, I can't tell if y is a sublist of x.
Dec 4, 2022 15:04
Also, now that I'm thinking about it, I'm having a bit of trouble thinking about how to go about solving this. I'd also appreciate tips.
Dec 4, 2022 14:53
Having trouble parsing today's input in jelly. How do I do something to each element in an array of arrays? I've managed to split on commas with Ỵœṣ€“,”, but I don't know how to further split on dashes.
Dec 3, 2022 10:34
Yep! Took longer than it should have because I misread the problem, but it was just ŒH€ -> s3. Probably the smallest adjustment I've seen so far between the two parts.
Dec 3, 2022 10:21
And part 1 is solved! Thank you so much!
Dec 3, 2022 10:20
Huh, I'm genuinely surprised that made a difference.
Dec 3, 2022 10:12
For context, ỴŒH€f/€Q€Œs is what I have so far.
Dec 3, 2022 10:11
@UnrelatedString Also gives all 0s.
Dec 3, 2022 10:09
Already did €Œs.
Dec 3, 2022 10:07
i€ØẠ is giving me a bunch of 0s.
Dec 3, 2022 10:01
Ok yeah I misread the entire thing, I want ØẠ.
Dec 3, 2022 10:00
I think I have this. I'll tell you if I do though.
Dec 3, 2022 10:00
Oh wait ØW exists.
Dec 3, 2022 09:58
And how would I make it index into a concatenated list? I've only ever done operations on single items, not combinations.
Dec 3, 2022 09:57
Oh smart.
Dec 3, 2022 09:56
So I don't know what you mean by index into.
Dec 3, 2022 09:56
Would you mind elaborating? I'm still really new to jelly.
Dec 3, 2022 09:55
So I can't do ordinal -> blanket subtraction.
Dec 3, 2022 09:55
I mean on the ascii table.
Dec 3, 2022 09:54
But in problem 3, there are characters in between Z and a.
Dec 3, 2022 09:53
Doing problem 3. Managed problem 2 with no if statements.
Dec 3, 2022 09:51
I also completely don't understand if statements in jelly.
Dec 3, 2022 09:51
As in, how do I make the code do one operation if the number is greater than 90, and a different if it isn't.
Dec 3, 2022 09:50
Having a lot of trouble with converting from letter to priority in jelly.
Dec 2, 2022 12:38
It's not perfect, but I'm really seeing my jelly improving.
Dec 1, 2022 19:54
Useful to know.
Dec 1, 2022 19:54
Ah.
Dec 1, 2022 19:50
I keep seeing the phrase "Vectorizes at depth 1." What does it mean?
Dec 1, 2022 19:43
Yeah I'm not trying to golf yet, I want to get familiar first. I tried learning jelly a while back but lost interest due to not really having a goal, so I'm hoping I can use advent of code to really learn jelly.
Dec 1, 2022 19:39
And I got part 2! ³œṣ“¶¶”Ỵ€VS€ṢUs3ḢS
Dec 1, 2022 19:31
I was struggling with getting € to work but after the example I think I understand it.
 

 Jelly Hypertraining

Practice your Jelly :) Rules and stuff are here: golfingsucces...
Dec 3, 2022 09:09
@UnrelatedString Would you mind explaining? I'm still really new to jelly.
Dec 2, 2022 12:37
When trying to modify all the y elements in [[x, y], [x, y]] (as in, all of the second elements of sublists), I keep making chains like this _0¦€1%0¦€-3+0¦€3. Is there a shorter way to do this?
Dec 2, 2022 11:13
Thanks!
Dec 2, 2022 10:47
Or, now that I think of it, [[y-x, y], [y-x, y]] would also be useful. But either way, I don't know how to make the elements inside arrays interact with each other.
Dec 2, 2022 10:43
In jelly, how would I take an array that looks a bit like [ [x, y], [x, y]] and turn it into [x-y, x-y]. Assuming an arbitrary length.