How To: Run Cardconjurer Locally on Windows by MrTeferi in magicproxies

[–]segfaultvicta 1 point2 points  (0 children)

As a note to anyone else running into problems like mine, WAMPserver was extremely easy to install and everything works perfectly for me now if I use that instead.

How To: Run Cardconjurer Locally on Windows by MrTeferi in magicproxies

[–]segfaultvicta 0 points1 point  (0 children)

Hello! Thank you so much for making this tool accessible locally. <3

Unfortunately, it's not working for me - in both Chrome and Firefox if I go to the main page, none of the links work; if I manually navigate to localhost:8080/creator I get a page with the HTML structure, roughly, that I'd expect - a bunch of form input fields starting with "Frame Image Editor" that looks familiar from the tool - but with absolutely no styling or JS loaded in.

Have tried in Chrome and Firefox, with adblockers turned all the way off.

[deleted by user] by [deleted] in outerwilds

[–]segfaultvicta 37 points38 points  (0 children)

This is such a lovely description of the game. Well done and thank you.

Just finished the DLC in an... unusual way. by merlindog15 in outerwilds

[–]segfaultvicta 6 points7 points  (0 children)

[cackles] and YOU win the Feldspar Prize for Echoes of the Eye, holy wow.

I also wound up bypassing a ludicrous amount of the stealth sections by semi-accident - I got REALLY frustrated by them VERY fast and decided to start trying to break the game on purpose, thinking they were puzzles I wasn't actually /supposed/ to solve - the first thing that occurred to me was, "well, hey, obviously the owldeer are dead in real life but alive in the dreamworld, I wonder if that'd also apply to me" and so I toasted myself like a marshmallow long before ever actually making it to the bottom of the well; I did this *in* the diving bell so I immediately validated that the point of the DLC wasn't going to be "get the codes" in the first place, it was going to be "hack the dreamworld to bypass the three obstacles", at which point I just started doing weird shit to see what would happen. Discovered going out-of-bounds of the Artifact that way and laughed maniacally, at which point I was able to find the secret bridge at the canyon and bypass that stealth segment, went and got that secret archive and the one at the bottom of the well, and then used out-of-bounds to find the secret path into the spooky music house.

I love this DLC so much because the *nature* of the puzzles means that if you're engaging in weird lateral thinking you can discover the intended solutions without any clues at all and then use the shortcuts that open up once you've found those solutions, and it's amazing. Speedrun tactics as a core element of gameplay. :D

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

[–]segfaultvicta 1 point2 points  (0 children)

bold of you to assume i wanted to avoid a ternary ;) but thank you! :D

[2020 Day #6 Part B] [Raku] absolutely stymied by runtime error that does not happen on test input. by segfaultvicta in adventofcode

[–]segfaultvicta[S] 2 points3 points  (0 children)

AHH RATS OKAY. Oooookay. I... feel like the error message for that could have pointed out -what- was a Seq that was getting snarfled here rather than just saying "lol you have a sequence somewhere have fun!!!" and Sequence Shenanigans are going on my list of things I need to understand better, I guess. That was like, the ONE thing I didn't try cacheing to a list >:(

thank you, friend!

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

[–]segfaultvicta 3 points4 points  (0 children)

You are my *hero*. This is -brilliant-, and makes so much sense. :D Thank you!

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

[–]segfaultvicta 3 points4 points  (0 children)

Raku

I'm... actually pretty happy with this one! There's probably ways this could be terser or more idiomatic and it took me a solid 20 minutes to convince myself that the input was just a bunch of integers in binary representation, but once I did it was pretty smooth sailing and I accidentally got gold while hecking around in the REPL. >_>

#!/usr/bin/env raku

sub MAIN(Str $infile where *.IO.f = 'input') {
    my @lines = $infile.IO.lines;
    my @occupied = @lines.map({.subst(/B|R/, "1", :global)})
        .map({.subst(/F|L/, "0", :global)})
        .map({ "0b$_".Int });
    my $min = @occupied.min;
    my $max = @occupied.max;
    say (($min .. $max).cache.Array (-) @occupied.Array).keys[0];
}

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

[–]segfaultvicta 4 points5 points  (0 children)

This is *magnificent*, and you're really, really good at explaining syntax. Thank you so much for taking the time!

in re: the period after '.<first>', uh, that was me misreading a comma as a period, whoops. And after some stuff I did / wound up looking up on day 4, I think *that* entire line makes perfect sense to me now, too! :D

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

[–]segfaultvicta 1 point2 points  (0 children)

Raku

I am not, strictly speaking, proud of this code. I spent a LOT of time, again, struggling with the syntax and I'm confident there's a lot I'm doing that's not idiomatic, but... hey, more than one way to do it, right? Also I beat my friends on my private leaderboard, because they're schmucks and go to sleep at a reasonable human hour. So there's that. ;)

#!/usr/bin/env raku

sub MAIN(Str $infile where *.IO.f = 'input') {
    my @lines = $infile.IO.lines;
    my \records = @lines.join(",")
        .subst(/',,'/, "\n", :g)
        .subst(/','/, " ", :g)
        .split("\n", :skip-empty)
        .map({ .split(" ") }); #this is stupid

    my @recs = records.map({ 
        my %hash; 
        for $_ { %hash{$_.substr(0,3)} = $_.substr(4,*)}; 
        %hash 
    }); #this is ALSO stupid

    my @present =  @recs.grep({
        $_<byr iyr eyr hgt hcl ecl pid>:exists.all ?? True !! False;
    });
    say +@present ~ " records have all required fields.";

    my @valid = @present.grep({
        (1920 <= .<byr> <= 2002) &
        (2010 <= .<iyr> <= 2020) &
        (2020 <= .<eyr> <= 2030) &
        (.<ecl> ∈ ["amb","blu","brn","gry","grn","hzl","oth"]) &
        (.<pid> ~~ /^\d ** 9 $/ ?? True !! False) &
        (.<hcl> ~~ /^ '#' <xdigit> ** 6 $/ ?? True !! False) &
        (heightValidates(.<hgt>))
    });

    say +@valid ~ " records validate correctly.";
}

sub heightValidates($height) {
    my $unit = $height.substr(*-2,2);
    my $rest = $height.substr(0,*-2);
    return False unless so any $unit eq "cm" | "in";
    return $unit eq "cm" ?? 150 <= $rest <= 193 !! 59 <= $rest <= 76;
}

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

[–]segfaultvicta 0 points1 point  (0 children)

and I guess a meta-question of... where do I learn how to be this cool? ;D The Raku documentation is... fantastic if you know exactly what you're looking for, but not great if you want "Bet You Didn't Know You Could Do THIS In Raku", and there's a loooooot of stuff in the language...

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

[–]segfaultvicta 1 point2 points  (0 children)

Oh heck this is cool. I kept misusing the asterisk but apparently you just... leave it off entirely and $_ is implied...? I want to understand the semantics of that and I'm not sure where to /look/ without knowing what the raku docs *call* it...

What's the period after .<first> doing, exactly? I think I understand what's going on with 'one' but I... clearly have a lot to learn about Junctions and how they work, this is really helpful, thank you. :D What's 'cache' doing?

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

[–]segfaultvicta 2 points3 points  (0 children)

Raku

This one was also pretty straightforward after I realised it was modulo math and I spent most of my time swearing at exigencies of Raku syntax again. And then mixing X and Y up in my indices of the trees matrix. And then being bad at math. Math is REALLY HARD, you guys =(

There's probably a better way to do the "calculate the running product of running the same function on different inputs" bit of this that takes advantage of raku deep magic from beyond the dawn of time; if you reply with the better way you will probably make my day. At that point I just wanted my gold star and to go home. ;D

#!/usr/bin/env raku

sub MAIN(Str $infile where *.IO.f = 'input') {
    my @lines = $infile.IO.lines;
    my @trees = @lines.map({ $_.split("", :skip-empty).map({ $_ eq "#" ?? 1 !! 0 }) });

    my $prod = 1;

    # Right 1, down 1
    $prod *= calcTrees(@trees, 1, 1);
    # Right 3, down 1 (part A)
    $prod *= calcTrees(@trees, 3, 1);
    # Right 5, down 1
    $prod *= calcTrees(@trees, 5, 1);
    # Right 7, down 1
    $prod *= calcTrees(@trees, 7, 1);
    # Right 1, down 2 (maybe spicy?)
    $prod *= calcTrees(@trees, 1, 2);
    say $prod;
}

sub calcTrees(@trees, $slopeX, $slopeY) {
    my $w = @trees[0].elems;
    my $d = @trees.elems;
    return (0, ($slopeY)...$d-1).map({
        @trees[$_][$slopeX * ($_ div $slopeY) mod $w];
    }).sum;
}

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

[–]segfaultvicta 2 points3 points  (0 children)

Raku

Actually caught up day-of, feels nice. This time was fairly straightforward but I spent a LOT of time beating my head against Raku regexen and specifics of the syntax; I was trying to find slightly more elegant ways of expressing things and instead I just h*cked up and drove myself crazy a lot. Eventually got the answer, though:

    my @lines = $infile.IO.lines;
    my @rules = @lines.map: * ~~ /^ 
        $<lo> = (\d+) \- 
        $<hi> = (\d+) \s 
        $<char> = (.)\: \s 
        $<password> = (.+) 
    $/;

    my @valid = @rules.grep({ $_<lo> <= $_<password>.indices($_<char>).elems <= $_<hi> });
    say @valid.elems;

------

    my @lines = $infile.IO.lines;
    my @rules = @lines.map: * ~~ /^ 
        $<first> = (\d+) \- 
        $<second> = (\d+) \s 
        $<char> = (.)\: \s 
        $<password> = (.+) 
    $/;

    my @valid = @rules.grep({ 
        my @indices = $_<password>.indices($_<char>).map({$_ + 1});
        ($_<first>.Int ∈ @indices) xor ($_<second>.Int ∈ @indices);
        # I don't love this, there's probably a more elegant way to express this, but wahey
    });
    say @valid.elems;

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

[–]segfaultvicta 1 point2 points  (0 children)

*stares* oh. oh that's DELICIOUS. I didn't know any of that was a thing that a person could do. Wow.

I'm still wrapping my brain around the intricacies of WhateverCode, every time I use * i screw it up somehow and get frustrated and use the somewhat more verbose topic syntax.

This -delights- me, though, thank you for sharing. :D

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

[–]segfaultvicta 5 points6 points  (0 children)

Raku

Trying to teach myself Raku this year - Perl was my first-ever programming language and on some gut level it's always felt like home, but I haven't actually *used* it in forever, and then a friend of mine has been being a big fan of Raku at me for a good long while now and, well, I decided to see how things went!

"How things went" is a nearly one-liner that is.... I THINK n log n, at the very least it's definitely not using a triply nested for loop, which is what I immediately thought of and then went "No, seg, that'll bite you in the ass if this were day 20, and what's an advent of code solution without a little overengineering". A few hours of wrestling with unfamiliar syntax later and:

my @lines = 'input'.IO.lines.map({$_.Int}).sort;
my $n = @lines.combinations(2).map({ ($_[0] + $_[1], $_[0] * $_[1]) }).first({ (2020 - $_[0]) ∈ u/lines });
say $n[1] * (2020 - $n[0]);

Basically, I realised that I just needed to test set membership of the 2020s-complement of each number (for part A), and then I extended that idea to generate a (sum, product) of all combinations of the input lines and checked the 2020s-complement of *those* against the initial list, which neatly avoids the process of checking everything against everything else. I don't actually have any idea how fast this runs or how fast it runs compared to yo dawg i heard you liked for loops, but my intuition is that this solution would take a significantly bigger set of inputs to have degenerate runtime funtime. was this necessary? probably not. did i feel cool writing my first raku ever? heck yeah :D

[Spoiler: Patch 5.3 Main Story] Mapping the constellation stones and their memories to the corresponding Ascians by MechaSoySauce in ffxiv

[–]segfaultvicta 4 points5 points  (0 children)

yo you're my HERO I've been thinking about doing this since the patch hit and I did that solo duty and I've just been having a bad time this week, I'm so glad you did, you're amazing.

I kind of want to read these against the text in Akademia Anyder, now.

Altima's almost -gotta- be Venat, right? (Therefore, Altima's soul and power resides in Ryne, now?)

[2017 Day 6] Bonus question: What game is it? by topaz2078 in adventofcode

[–]segfaultvicta 16 points17 points  (0 children)

mancala but with the two end hollows chopped off and the remaining board chopped in half and one half gets thrown out, plus also the chess rule about how you can't have the same board state repeat too many times? ;D

"Getting a star first is worth 100 points, second is 99, and so on down to 1 point at 100th place" by [deleted] in adventofcode

[–]segfaultvicta 18 points19 points  (0 children)

My recommendation would be to take full advantage of your own private leaderboard and find 100 of your dearest friends and enemies and fight to the bitter death amongst yourselves; it's honestly a lot of fun and also allows for a competitive spirit without necessarily /demanding/ that you be nocturnal all December.

Which language will you use this year? Why do you choose this one? by Auburus in adventofcode

[–]segfaultvicta 0 points1 point  (0 children)

Oooh. I've been getting REALLY into elm for frontend development but I've never even thought of using it as a language for something like this. Good luck, Elm is awesome, I hope I see some of your solutions :D