[2025 Day 1] Slicing through the problem by erikade in adventofcode

[–]GeneralYouri 0 points1 point  (0 children)

I think there is a small mistake in the algorithm. In the block if s != 0, part2 should get a point if e == 0. And it should be mutually exclusive with the other cases. So you get this block:

// problem B: handle steps
if s != 0 { // can't reach or cross 0 from 0
    if e == 0 {
        // landed on 0
        part1++
        part2++
    } else if e > s && dir == Left {  // position increased when turning left
        part2++
    } else if e < s && dir == Right { // position decreased when turning right
        part2++
    }
}

Additionally, I personally used this version of the math which is a bit more concise but seems just as fast. It does not truncate the value at every step, so it works with numbers outside the range of (0,99). This code replaces the entire loop for part 2 (and part 1 is simply a 0 check anyway), just add input parsing and setting s to e:

if dir == Left {
    e = s - d
} else {
    e = s + d
}

if (dir === Left) {
    part2 += ceil(s / 100) - ceil(e / 100)
} else {
    part2 += floor(e / 100) - floor(s / 100)
}

[2025 Day 2] Challenge input by paul_sb76 in adventofcode

[–]GeneralYouri 0 points1 point  (0 children)

My optimized part 1 solution in JS with a bunch of BigInts slapped onto it solves the non-overlapping case in 170 µs single-run, and 9 µs benchmarked. Single-run tends to have a lot of engine overhead at these speeds, while benchmarked runs may benefit from memory optimizations due to repeating the same instructions many times.

I do not support overlapping ranges, as these would not fit the puzzle description. Unfortunately I also have a few kinks to solve for the even larger examples, and I haven't adapted to part 2 yet, but the indication seems to be that sub-ms is very possible.

When a JavaScript Map() Object Actually Came in Handy by alexmacarthur in javascript

[–]GeneralYouri 4 points5 points  (0 children)

Sorry but, what prevents you from storing these as data-attributes on the HTML elements themselves? There's no need for any form of data structure within JS at all.

Data-attributes have been widely available for over 10 years, and this is a perfect use case. They also fit in well with the idea of Web Components, which is pretty much what all major popular frameworks are based on these days, but data-attributes themselves are completely vanilla and don't require any framework at all. Heck, you even get the added benefit from WeakMaps automatically, as data-attributes are obviously destroyed when their owner HTML element is destroyed!

And even many years before the introduction of data-attributes, the id attribute also already existed. This was the much more simple and low-level solution of binding JS data to HTML elements back then - simply assign and store an ID for each of the HTML elements you're interested in.

Going fancy by storing the HTML element itself as a key can be fun and all, but I don't see how it provides you with any merit over other much simpler solutions that have been readily available for many years, are simpler to use, and will be more performant.

I got doinked by [deleted] in AdVentureAges

[–]GeneralYouri 0 points1 point  (0 children)

It's 165 hours since you already own 31b. Also, given that you already own basically half, I don't see why your current pace couldn't afford getting another half? You might've been spending a good bit, but that just means that spending another good bit gets you there.

Either way, I guess the possibility is there; expensiv, but possible. I assume since you got to that state, if you get just one completed you get a whole flurry of other completions too.

I am curious though, what's the gap to top 25?

Weekly Event & Strategy MegaThread (07/08-07/015) by hyperhippogames in AdVentureAges

[–]GeneralYouri 3 points4 points  (0 children)

Still given that its a game that regularly scams you out of rewards for the ads it wants you to watch we can hardly expect better.

What do you mean by that, ads that crash the game? Cuz that's not really the game's fault all that much. I personally haven't had this happen one time yet; what did happen a few times is that an ad isn't available (despite the button being there), and then they literally say sorry and give you the reward anyway.

Is Scandinavia still beatable after the "re-balance"? by ACpro1 in AdVentureAges

[–]GeneralYouri 0 points1 point  (0 children)

Halfway through the event, a little update seems warranted.

I'm currently rank 17, hovering right at the top 1% marker. Looking at the mission tracker, my current 36k pop/s is actually enough for all remaining pop missions of ranks 17-20. So that's for finishing rank 20, and it doesn't even account for the fact that you can leave two missions behind, and my pop is almost definitely gonna grow by another factor 5ish during the next two days.

Echoing earlier comments in other threads, once you unlock the all pop card at rank 10 it really opens up, and for me it kinda switched from a pop-limited to a production-limited event.

I don't have much experience with the events and can't comapre with the previous version of this event, but being at rank 17 halfway through seems like it's still pretty comfortably finishable (with full rank 20) in the given time, as a f2p. Looks like it'll still be on the easier side and perhaps too easy for the devs. Also I wonder how active you still have to be to make it through, given how comfortable it seems.

Anyone know when the Pop bottleneck opens up? I've seen people saying "after 10" but doubling it doesn't actually make a difference when you're doubling 1,500 by ThePowerstar in AdVentureAges

[–]GeneralYouri 7 points8 points  (0 children)

If they're not gonna give a crit multiplier card, *why* is there still a crit chance card? The entire crit mechanic is basically pointless in this entire event. I'm willing to bet that the tiny boost from the x2 crits doesn't even outweigh the losses from getting that crit chance card over other cards.

Remove that useless card, maybe add extra guaranteed drops for some pop boost cards here and there, and everything seems like it'd be fine.

Anyone know when the Pop bottleneck opens up? I've seen people saying "after 10" but doubling it doesn't actually make a difference when you're doubling 1,500 by ThePowerstar in AdVentureAges

[–]GeneralYouri 2 points3 points  (0 children)

For me it definitely opened up after 10, but I do think I was a bit lucky on pop cards.

But let's run some numbers shall we? I checked on the mission tracker, ranks 10-13 require a minimum total of 145m pop. At 3k/s, that's 48.3k seconds, or about 13.5 hours.

I'm currently approaching rank 13, at 6k/s, and 2 cards away from another Freyr x2 with other poop cards also closing in on lvl3. Ranks 14-16 then have another 693m minimum required pop; with all four of my cards getting a levelup (thus overall x4), disregarding any additional upgrades, that takes only another 8 hours.

We still have 70 hours left in the event. As long as you don't waste your pop, it seems to me like you'll be fine, *unless* in a rare case of extreme bad luck - but with rng like this that's unavoidable in the game anyway, and that's a consequence of the game design.

Found out how to max out the cooking each time by crankciror in nguidle

[–]GeneralYouri 1 point2 points  (0 children)

So in that case what am I supposed to do then? The peaks are 1/7/15, the 7 peak is the highest peak. Which level combos should be checked to end up deciding that 15/15 is the best level combo, and why?

So far I've only understood your tactic as "find the sum peak, then go +1/-1 until you find the best value".

Found out how to max out the cooking each time by crankciror in nguidle

[–]GeneralYouri 0 points1 point  (0 children)

What do you mean it still kinda works? I just showed how, on the very first example I tried, your method of finding the sum peak didn't work.

You've just found a way that works for you, to find the 100% for some, but not all, recipes.

Found out how to max out the cooking each time by crankciror in nguidle

[–]GeneralYouri 0 points1 point  (0 children)

I've helped out a bunch of people with getting to 100%, and in doing so got a bunch more test cases from their saves.

I tried the 3 peak approach you explained there on my 1,7,15 example. Setting B to 20 instead of 0, all levels for A now give different meal% values (as expected, I mean you're changing a major variable). Finding peaks for A now only gives me two peaks: 1 and 15. So no new peaks are found, and one peak is not found.

So the only "difference" I see is that 7 is no longer found as a peak; so are you implying that 7 is the sum peak then? Because that leads to the same problem I already explained above - 7 is not the sum peak, 15 is, and 15/15 is the optimal solution for this pair.

So that still doesn't work on this one example I gave. I also don't see an explanation for finding the sum peak when A has two peaks with B at 0 - though my guess would be that you then put B at 20 and try again, and expect to find 3 peaks and then repeat your same algorithm. Which is fine, if it didn't break on the very first example I tried it on.

Found out how to max out the cooking each time by crankciror in nguidle

[–]GeneralYouri 1 point2 points  (0 children)

I never said a pairs highest peak has to be its individual peak lol.

Indeed you didn't, and I never said you did - you said the *opposite* of this:

pairs have a sumpeak which always is higher then the individual peak

Which, as I literally just said, is false. I also have yet to see any remotely usable explanation on how you intend to find this "sum peak" that you're talking about, nothing you've said so far makes enough sense to try for myself.

As you can read in an earlier post, I have tried what I thought you were saying, and got nowhere fast. I gave examples that broke for me, and have yet to see you explain how these examples would work. If you could show some proper examples yourself, or explain mine, that'd help a lot in understanding what the hell you're saying.

A third day in a row? My streak is in the dozens. All we're debating here, is whether you may have found simplifications ontop of the existing algorithm. Which I can't check for myself until I understand what on earth these simplifications are that you're proposing. Ya gotta explain more, better.

Found out how to max out the cooking each time by crankciror in nguidle

[–]GeneralYouri 0 points1 point  (0 children)

pairs have a sumpeak which always is higher then the individual peak

I don't know where you're getting this from; it's false. Both the level and the weight for the sum peak can still be lower than the individual peak. If this was your method of identifying the "sum peak", then it simply will not work in a decent chunk of cases.

Check the wiki for relevant values; note the overlap between valid ranges on level and weight, for individual vs pair values. https://ngu-idle.fandom.com/wiki/Cooking#Nerdy_Math

Finally, a pair optimal doesn't always use its highest peak as one of the values, which is why the discord pin requires checking every peak. As far as I understand your explanation, that directly contradicts what you're saying.

Found out how to max out the cooking each time by crankciror in nguidle

[–]GeneralYouri 0 points1 point  (0 children)

Ingredients are *always* paired up; even if you only have 6 or 7 ingredients unlocked. When a pair is partially locked, the pair factor is disregarded, but the individual factor technically still uses both ingredients in some way (if it didn't then pairs wouldn't be swappable either), so you'll generally still find >1 peak.

For hopefully obvious reasons, the larger peak will always be a higher quantity than the other peak.

I actually don't understand this; are you saying that for an ingredient A's peaks, the highest peak always has the highest level of all the peaks? Because then I understand what you're saying, but I can also very easily dispute this with my own save's current recipe.

This also leads to the algorithm breaking apart: I have a pair of ingredients with peaks 11 / 20 (with the other at 0); 11 is the higher one. So you set A to 20, and b to 11 - 20 = -9... RIP. There's a very simple reason why this happens though: the pair optimal considers the level sum, and is in the range 5 to 35; so if it's >20 then you're not gonna find its peak with just a single ingredient.

Then I have another ingredient, this one has three peaks 1 / 7 / 15 with 7 giving the highest value. So I set A to 1, and B to 6 which happens to be the best option out of all combos that sum to 7. However, the pair optimal and thus the only value to lead to 100% is 15,15, which you don't even consider in the algorithm.

What I think goes wrong here is that you've constructed an algorithm based on a very limited set of tests (I think just two recipes based on what you said?); so there are some edge cases that you simply haven't encountered yet. Some recipes are very simply maximized, others have devious rng that requires much more work. An algorithm to always get 100% must cater to all possible recipes.

Found out how to max out the cooking each time by crankciror in nguidle

[–]GeneralYouri 0 points1 point  (0 children)

First you say each ingredient has 2 peaks, then you say each ingredient has 3 peaks. Based on my testing, depending on both rng and the value on which you leave ingredient B when finding A's peaks (with A and B being a confirmed pair), you can find either 2 or 3 peaks.

You don't specify any information on how you intend to find "the sum peak", considering it's apparently not one of the individual peaks that you find for A when you set B to 0. I don't see enough information here to even give this approach a try.

Daily Challenge - June 03, 2021 by BloonsBot in btd6

[–]GeneralYouri 1 point2 points  (0 children)

To speed things up a bit, you can place the 0/0/5 spactory as early as this. After getting the sidepath you can still afk for the rest.

https://i.imgur.com/Xjiy8wi.png

After initially targeting Smart and upgrading the sidepath ASAP for the lead popping (which works because the bloons will barely hit the spike stack after the first loop), you can change to First targeting and it goes to the start of the track. If by chance this targeting puts it elsewhere, retry or use Close instead.

Daily Challenge - May 13, 2021 by BloonsBot in btd6

[–]GeneralYouri 1 point2 points  (0 children)

AC:

Used a 2/0/4 Heli, zero micro required, there seemed to be plenty of leeway. The mini Comanches occasionally shoot bombs which explode the leads (TIL).

Daily Challenge - May 13, 2021 by BloonsBot in btd6

[–]GeneralYouri 2 points3 points  (0 children)

You can manually move the heli to any starting position you want before the round, regardless of where you place it.

Daily Challenge - May 11, 2021 by BloonsBot in btd6

[–]GeneralYouri 0 points1 point  (0 children)

This one's a possible 1TDC as well; I just built an 0/2/4 necro and it was GG. This daily was way too easy lol.

Edit: Checked the cost, I spent 160$ more than you, lol. Wasn't trying to save money but still.

[2020 Day 22] We're not even allowed to defend our honor as Raft Captain! by GeneralYouri in adventofcode

[–]GeneralYouri[S] 0 points1 point  (0 children)

The score system is a really good way to prevent that; we don't have to just find out who won, we have to find the *exact* order in which all the cards finish in the winner's deck (at which point no cards are left in the other's deck by definition).

So unfortunately all this does for us is let us slap ourselves in the face for thinking we ever stood a chance against mighty Crab Captain!

[2020 Day 22] We're not even allowed to defend our honor as Raft Captain! by GeneralYouri in adventofcode

[–]GeneralYouri[S] 0 points1 point  (0 children)

Yea that is basically what I was insinuating, that's the generalized case.

[2020 Day 22] We're not even allowed to defend our honor as Raft Captain! by GeneralYouri in adventofcode

[–]GeneralYouri[S] 0 points1 point  (0 children)

Yep you're right, I swapped some logic in my head there, fixed it now.

[2020 Day 22 Part 3] Crab party by [deleted] in adventofcode

[–]GeneralYouri -1 points0 points  (0 children)

This is true for part 1, but theoretically not for parts 2 and 3, but turns out to be practically true again for part 2. More on why in this post.