Junilu Lacar

Sheriff
+ Follow
since Feb 26, 2001
Merit badge: grant badges
Forum Moderator
Junilu Lacar currently moderates these forums:
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Junilu Lacar

Junilu Lacar wrote:

Bhaskar Bantupalli wrote:The question says almost. So printbto a file and search for  ****** and see if it almost looks like a tree. I brute forced it and found solution


Ah, the old school of Brute Force way... I see. I will give it a shot. Hopefully it's not that many iterations.


Ha! That certainly didn't work out to be a few iterations. Another instance where hope is not a viable strategy.
4 months ago
I was thinking start with a tree and work backwards, too.

I authenticate to AoC with both Gmail and Github. The Christmas trees for both my inputs in this puzzle look exactly the same, the only difference being that one is shifted to the right/down by a few columns/rows. The approach of starting with a tree and working backwards will give at least a few dozen or hundreds of unique puzzle inputs for the same-shaped tree. Add a few dozen more different tree shapes and you potentially have hundreds or thousands of unique solutions. Automate this and I think it's entirely possible for there to be a unique puzzle input for each and every AoC participant profile.

I doubt that's the case though. There are a number of puzzles across all the ones I've solved so far where my Gmail and Github profile have exactly the same input/answers. Also, I've "crossed steams" a few times and entered the answer for one profile into the other and I'd get a message along the lines of "Sorry, that's not the right answer. Curiously, it's the answer for someone else's puzzle input. Are you sure you're not using the input for another profile?" Eric sure has all his bases covered.
4 months ago
You know what be a good corollary challenge to this?

It would be to write a program to generate valid puzzle input for Day 14 given N where N is the answer to part 2, and a randomly placed Christmas tree on the map. How would make the program so you can create potentially thousands of unique puzzle inputs using hundreds of versions of the Christmas tree Easter Egg?
4 months ago
I have never LOL'd like that on seeing an ASCII art Christmas tree. In retrospect, that's pretty   - that guy is really creative and deserves my annual support.

............*........................................................................................
..........*...........*..................*******************************.......................*.....
.........................................*.............................*..*..........................
..*..................................*...*.............................*.............................
.................................*.......*.............................*.............................
.........................................*.............................*...............*.............
.........................................*..............*..............*.............................
.........................................*.............***.............*........................*....
.........................................*............*****............*.............................
............................*.*..........*...........*******...........*...........*.................
.........................................*..........*********..........*...........*.................
...*................................*....*............*****............*.............................
...................*.....................*...........*******...........*...................*.........
.........................*...............*..........*********..........*..*........*.................
.........................................*.........***********.........*.............................
.........................................*........*************........*................*............
.*.............*......*..................*..........*********..........*.............................
.........................................*.........***********.........*.............................
.........................................*........*************........*.............................
.........................................*.......***************.......*.............*...............
...............*.........................*......*****************......*.............................
..*...........*..............*...........*........*************........*.............................
.........................................*.......***************.......*........*...............*....
.........*.......*.......................*......*****************......*.............................
.........................................*.....*******************.....*...........*.................
.........................................*....*********************....*.............................
...........................*.............*.............***.............*.............................
..................................*......*.............***.............*.............................
.........................................*.............***.............*.............................
....................................*....*.............................*.............................
..................................*...*..*.............................*..........*............*.....
.........................................*.............................*.............................
..................*......................*.............................*..............*.*..........*.
...........*.............................*******************************.............*....*..........
.....*..........*.......*......................................................*.....................
4 months ago
@Tim & Bhaskar, did your answer end up being a multiple of 100 plus or minus one? Or some number related to the safety factor in Part 1? That's what some people seem to be claiming on Reddit. Just curious. I haven't come back to AoC yet, been busy with other stuff at home and at work. Going to try to get this done over the weekend and catch up on the newer puzzles. Right now it looks like I won't be getting the fifty stars until we're well into the new year.
4 months ago

Tim Cooke wrote:This staying up all night shenanigans must be exhausting Junilu. The puzzles get released at 5am in my timezone so it's at least close to getting up time for me, although when you're a few days behind it hardly matters.


NGL, it is kind of wearing me down.  But I did lay off over the weekend and got a bit more sleep. I've been sleeping earlier and waking up about 2am these past few days. Ever since I started falling behind it didn't make sense to get up at midnight. I at that age where no matter what, I still have to get up in the middle of the night. Whoever called these years the "golden" years wasn't kidding.
4 months ago
I tried a bunch of things but couldn't find any that worked for me.

Going to bed now. My brain is fried.
4 months ago

Bhaskar Bantupalli wrote:The question says almost. So printbto a file and search for  ****** and see if it almost looks like a tree. I brute forced it and found solution


Dang, I was going to go back to bed but now I can't stop thinking about this. Gonna have to get back in the saddle and do this now...    
4 months ago

Bhaskar Bantupalli wrote:The question says almost. So printbto a file and search for  ****** and see if it almost looks like a tree. I brute forced it and found solution


Ah, the old school of Brute Force way... I see. I will give it a shot. Hopefully it's not that many iterations.
4 months ago
I know, it's Advent and not Lent but tell that to the AoC creators.

I got Part 1 done using pure wrapping logic, no iterating from one generation to another necessary. Now, this "easter egg" they want in Part 2, what shape is it? Does it have a base or is it a simple triangle centered on the grid? That is,

Is it supposed to look like this?

         *
        ***
       *****
      *******
         *  

... or like this?

         *
        ***
       *****
      *******
     *********

or something else entirely?

I could try both these ways and I can think of at least one other way it could look and see which of those works but if you already know, a hint would be great. Pretty please...?    
4 months ago

Liutauras Vilda wrote:

Junilu Lacar wrote:Yeah, I was tempted to do it this way, to just brute force the answer out with a couple of nested loops. But then I finally saw that it was two equations, two unknowns and it could be solved without iteration.


Well, yes, equations I see, they are spelt out in explanation, not exactly with ink on paper, but almost, i.e. for first claw machine a two of those are:
94x + 22y = 8400
34x + 67y = 5400

I'm just working out how to derive at what I need to using them. Will do a bit of reading. I'll have to go to sleep now as tomorrow is an office day, but will continue tomorrow.



Ok, but that only works for the first claw machine. The other claw machines have entirely different equations. You need the generalized equations, which I showed in a previous post. But solving for the unknowns involves matrix operations which I wasn't keen on racking my brain on so I turned to ChapGPT to do all the heavy lifting for me. I still had to translate what it gave me into code though because I wasn't going to ask it to generate a solution for me for this one.
4 months ago

Liutauras Vilda wrote:It just doesn't scale of course what the part 2 requires.


Yeah, I was tempted to do it this way, to just brute force the answer out with a couple of nested loops. But then I finally saw that it was two equations, two unknowns and it could be solved without iteration.

BTW, the "fewest" thing is a red herring. There's either a unique solution or there's not because of the constraint to have whole numbers for the answers and to limit #s to no more than 100 in part 1.
4 months ago

Tim Cooke wrote:Looks rather mathy this one, which is not my strong point. I predict a struggle ahead.


The equations are hiding in plain sight in the puzzle examples, BTW. It's two equations, two unknowns (pushes A, pushes B).
4 months ago

Tim Cooke wrote:Looks rather mathy this one, which is not my strong point. I predict a struggle ahead.


I struggled to get the math right on my own. Even with assistance from ChatGPT with the equations, I had a rough time working them into the code. As always, in retrospect, the refactored code looks like I know what I'm doing but I went through a long period of confusing myself with accidental complexity.

Another reason to strive for simplicity in code.

It was frustrating trying to get it right but now in hindsight, I can say that was (kind of?) fun, in a I-finally-got-it-right satisfying kind of fun way.
4 months ago
Here's my cleaned up solution for Day 13 in Kotlin.

A good 1/3 of the code is just for parsing the input.

The IDE assistant suggest line 41, where the variable declaration is pulled into the when expression to limit its scope. That's a really nice feature. As I often do, I've also defined type aliases (lines 4-6) so I can use type names from the domain instead of raw implementation types.

4 months ago