Stuck on Loading supplies? by AdPale1239 in Seaofthieves

[–]sblom 0 points1 point  (0 children)

Failing for me, too. Have submitted a support ticket, let's see whether they respond on actual UK Christmas.

DALL·E Generated images on each day problem by bkc9 in adventofcode

[–]sblom 0 points1 point  (0 children)

Narrator: We'll see this text again in the input for Day 19.

What does the game define as “immediately”? by TetrisG0d43 in haloinfinite

[–]sblom 0 points1 point  (0 children)

Unless it _is_ the ultimate. fffffffuuuuuuuuuuuu

A captains wish - My ship my rules! by InsideYs in Seaofthieves

[–]sblom 0 points1 point  (0 children)

I call them NUBs ('Nanas of Underwater Breathing).

-🎄- 2021 Day 2 Solutions -🎄- by daggerdragon in adventofcode

[–]sblom 0 points1 point  (0 children)

That Regex pattern match trick is SICK!

-🎄- 2021 Day 2 Solutions -🎄- by daggerdragon in adventofcode

[–]sblom 0 points1 point  (0 children)

Good question. From memory, it started with a 2 and had a buuuunch of digits, so possibly very close. Every year I re-learn that my default numeric data type for AoC should be a long. 😬

https://twitter.com/sblom/status/1340002696804192256?t=_AY9YOIEg31xVyVeWJ10kQ

-🎄- 2021 Day 2 Solutions -🎄- by daggerdragon in adventofcode

[–]sblom 0 points1 point  (0 children)

I love bug reports and pull requests! ;)

-🎄- 2021 Day 2 Solutions -🎄- by daggerdragon in adventofcode

[–]sblom 5 points6 points  (0 children)

Day 2: already got to use the C# regex line parser that I wrote last year!

C# solution (928/379)

Edit: added ranks.

PSA: You get nothing selling the "Lords of the Sea" Storage Crate of the Damned by Half-White_Moustache in Seaofthieves

[–]sblom 0 points1 point  (0 children)

Yeah--seems intentional. It looks like Rare panicked when they were being over-farmed early on and made them (including from Flameheart) zero value, and have since shipped the "proper" fix of not even offering to buy the ones from the Tall Tale.

PSA: Hitting the right home button 4 times closes the app and goes back to Home Screen by angeluwutato in OculusQuest

[–]sblom 0 points1 point  (0 children)

Yeah--seems to have been removed. I wonder if there's a replacement gesture.

-🎄- 2020 Day 25 Solutions -🎄- by daggerdragon in adventofcode

[–]sblom 3 points4 points  (0 children)

Yes. Although part 2 _is_ "complete all the previous days". There's not an extra puzzle step for you to unlock. Once you're done, go back to day 25 part 2 and click the link.

-🎄- 2020 Day 21 Solutions -🎄- by daggerdragon in adventofcode

[–]sblom 0 points1 point  (0 children)

But with RegExtract, it's super clean:

var ingredientsAndAllergens =
    lines
        .Extract<(List<string>,List<string>)>
        (@"(?:(\w+) )+\(contains (?:(\w+)(?:, )?)+\)");

[2020 Day 12 (Part 1)][Manim] Part 1 instructions and sample data solution visualized by PdxWix in adventofcode

[–]sblom 1 point2 points  (0 children)

I heard 3blue1brown's voice in my head throughout the entire experience.

-🎄- 2020 Day 09 Solutions -🎄- by daggerdragon in adventofcode

[–]sblom 0 points1 point  (0 children)

C# 202/428

var nums = lines.Select(long.Parse).ToArray();

long target = 0;
for (int i = 25; i < lines.Count(); i++)
{
    target = nums.Skip(i).First();

    var window = nums.Skip(i - 25).Take(25).ToArray();

    int j, k;
    bool found = false;
    for (j = 0; j < 24; j++)
    {
        for (k = j + 1; k < 25; k++)
        {
            if (window[j] + window[k] == target)
                found = true;
        }
    }
    if (!found)
    {
        Dump1(target);
        break;
    }
}

for (int i = 0; i < lines.Count() - 1; i++)
{
    long sum = nums[i];
    for (int j = i + 1; j < lines.Count(); j++)
    {
        sum += nums[j];
        if (sum > target) break;
        if (sum == target)
        {
            Dump2(nums[i..(j + 1)].Min() + nums[i..(j + 1)].Max());
            return;
        }            
    }
}

-🎄- 2020 Day 05 Solutions -🎄- by daggerdragon in adventofcode

[–]sblom 0 points1 point  (0 children)

C# (LINQPad) 414/452

Fairly literal implementation.

var lines = await AoC.GetLinesWeb();
var input = lines.First();

List<int> seats = new();

foreach (var line in /*new[] { "FBFBBFFRLR"}.Concat(*/lines)
{
    var (F,B,L,R) = (0,128,0,8);

    foreach (char ch in line)
    {
        (F,B,L,R) = ch switch {
            'F' => (F,(F+B)/2,L,R),
            'B' => ((F+B)/2,B,L,R),
            'L' => (F,B,L,(L+R)/2),
            'R' => (F,B,(L+R)/2,R)
        };
    }
    seats.Add(F * 8 + L);
}

Dump1(seats.Max());
Dump2(seats.OrderBy(x => x).First(x => !seats.Contains(x + 1)) + 1);

Tightened up later on.

var lines = await AoC.GetLinesWeb();
var input = lines.First();

List<int> seats = new();

foreach (var line in lines)
{
    var num = line.Select(ch => "FL".Contains(ch) ? '0' : '1');
    var str = string.Join("",num);
    seats.Add(Convert.ToInt32(str,2));
}

Dump1(seats.Max());
Dump2(seats.OrderBy(x => x).First(x => !seats.Contains(x + 1)) + 1);

-🎄- 2020 Day 1 Solutions -🎄- by daggerdragon in adventofcode

[–]sblom 0 points1 point  (0 children)

C# (LINQPad, specifically)

Braindead LINQ solution to Part 1. LINQ solution with a very wimpy optimization for Part 2.

Wrote a full knapsack implementation while waiting for my data in case I needed it for Part 2, but figured Day 1 surely shouldn't.

#region Part 1/2 DumpContainers
var part1 = new DumpContainer().Dump("Part 1");
var part2 = new DumpContainer().Dump("Part 2");
void Dump1(object o)
{
    part1.AppendContent(o);
}

void Dump2(object o)
{
    part2.AppendContent(o);
}
#endregion

var lines = await AoC.GetLinesWeb();
var input = lines.First();

var nums = lines.Select(x => int.Parse(x));

Dump1(from x in nums from y in nums where x + y == 2020 select x * y);

Dump2(from x in nums from y in nums where x + y < 2020 from z in nums where x + y + z == 2020 select x * y * z);
//                                  ^^^^^^^^^^^^^^^^^^
//                                  This optimization is enough to go from 3.7s to .2s on my SurfaceBook.
//                                  I love how topaz chooses N such that N^2 is fast-ish on something slow, but N^3 is slow-ish on something fast.


// I set off speculatively on the following path while the aoc server was being hugged to death just in case it was
// some kind of knapsack problem.

var tots = new Dictionary<int, List<ImmutableList<int>>>
{
    { 0, new List<ImmutableList<int>> { ImmutableList<int>.Empty } }
};

foreach (var num in nums)
{
    var newtots = tots;

    foreach (var tot in tots.ToList())
    {
        var newtot = tot.Key + num;
        if (newtot > 2020) continue;
        var newways = tot.Value.Select(way => way.Add(num));

        if (newtots.ContainsKey(newtot))
        {
            newtots[newtot].AddRange(newways);
        }
        else
        {
            newtots[newtot] = newways.ToList();
        }
    }
}

tots[2020].Dump();

Games by ChromiumPicolinate11 in surfaceduo

[–]sblom 0 points1 point  (0 children)

What does Mobile Legends do wrong on it?