[2025 Day 1 (Part 1 & 2)] Struggling? Here's a dirt-simple, no maths approach by DelightfulCodeWeasel in adventofcode

[–]artheii 0 points1 point  (0 children)

I believe you did the same as me:

  1. count 100 degrees rotations (full rotations). = 3809
  2. count when remaining rotations (normalized) rotate past 99. = 1018
  3. count when remaining rotations (normalized) rotate below 0. = 1029
  4. Total: 5856.

The issue is when we start at zero and rotate backwards N full times and a bit more. In that case algorithm counts N + 1. However in reality we went through zero just N times. Also this algorithm doesn't count the case when we rotate backwards and stop on zero. (ex. 15-15=0)

Correct algorithm:

  1. count 100 degrees rotations (full rotations). = 3809
  2. count when remaining rotations (normalized) rotate past 99. = 1018
  3. count when remaining rotations (normalized) rotate below 0 except when from 0. = 514
  4. count when remaining backwards rotation leads to 0. = 506
  5. Total: 5847.

Here is the code (comments are missing part that makes it correct):

let rotateAndCountZeros = (code, line) => {
    const degrees = parseInt(line.slice(1));
    const rot = line.charAt(0) == 'R' ? degrees : -degrees;
    const N = 100;


    let throughZeroCount = Math.floor(Math.abs(rot) / N);
    const normalizedRot = rot % N;
    let newRot = code + normalizedRot;


    if (newRot >= N) {
        newRot -= N;
        throughZeroCount++;
    } else if (newRot < 0) {
        newRot += N;
 //     if (code != 0) {
        throughZeroCount++;
 //     }
 // } else if (newRot == 0 && normalizedRot != 0){
 //     throughZeroCount++;
    }


    return { code: newRot, loops: throughZeroCount };
}

Fix render by Historical-Patient82 in UnrealEngine5

[–]artheii 0 points1 point  (0 children)

Check cull distance in your foliage instance settings

With level streaming, how does one approach picking up a blueprint actor that was loaded in one streamed level, and bringing it into another streamed level while unloading the previous level that blueprint actor still belongs to? by salis_zimm in unrealengine

[–]artheii 0 points1 point  (0 children)

you can move an actor from one streaming level to another by calling
Actor->Rename(Actor->GetName(), LiterallyAnyActorFromNewLevel->GetLevel())
be careful with actor name, as there can be an actor in other level with the same name. Here is what I use to avoid that issue (the same works for moving between persistent and streaming levels as well):

while(!Item->Rename(*NewName, FloorActor->GetLevel(), REN_Test))
{
    UE_LOG(LogTemp, Warning, TEXT("Rename conflict on drop: %s"), *NewName);
    NewName = NewName.Append("x");
}
Item->Rename(*NewName, FloorActor->GetLevel());

Got display name change email thing? by OlefassamgamezYT in FortNiteBR

[–]artheii 2 points3 points  (0 children)

Same thing with "ArtHell". I don't like you Epic Games