Treeniks

joined 1 year ago
[–] [email protected] 3 points 4 months ago
[–] [email protected] 1 points 4 months ago (4 children)

Oh I would never use bluetooth on PC, that adds input latency like crazy. I was talking wireless only ever over 2.4Ghz with the 8bitdo adapter. Even there the KK2 had really bad latency while all the others were fine. The KK3 Max actually comes with its own adapter to achieve 1000Hz wirelessly (I got only around 880, but still higher than all the others on stock which are usually stuck on 250 or 500Hz. You can overclock the PS5 to 1000 when wired but I never did).

Also since you mentioned them going for an elite controller style with the KK3 Max, I wouldn't count on its back pedals. Personally I find they make it impossible to hold the controller. I've never liked the back pedals on the Xbox Elite, and I like them even less on the KK3, while I found the one on the 8bitdo ultimate really nice (though I never used them anyway).

As for the branding I have no clue. They did have a US/Target version of the KK2 Pro called the Zen Pro which was the exact same controller, just sold at Target. I think they're just weird with their naming.

On that note, I've also heard there is supposed to be more budget versions of the KK3 Max coming out over the year (I think it was two more), similar to how they had a KK2 and KK2 Pro.

[–] [email protected] 3 points 4 months ago (6 children)

Just want to mention that Guilikit now have the KK3 Max which has some improvements over the KingKong 2. It's also possible to grab a PS5 controller and connect it to your switch with an 8bitdo wireless adapter.

I have both Guilikits, an 8bitdo ultimate and the ps5 combo here. The 8bitdo ultimate is certainly the safest option of the bunch, but I like the KK3 Max most.

The KingKong Pro 2 has some massive polling rate issues. If you want to use the thing wirelessly on PC, you're stuck at 60Hz and it's not even very consistent, which is awful compared to all the others. Not sure how it's looking on switch since it's difficult to measure that, but I feel like it's similarly much slower than other controllers.

The KK3 Max doesn't have that issue, though I haven't done any latency testing yet. In terms of Gyro, the KingKong Pro 2 was also pretty bad, no way I could play splatoon with that. I don't know if that's improved on the KK3 Max, I haven't tried gyro yet so I can't comment on it.

While I've had no hardware failures with either of them (I've only had the KK3 Max since yesterday), they also don't exactly give me confidence that they won't. It's not that they're badly built, but in particular the stick caps and should buttons just feel like they might give out fairly early. I will say that I find them by far the most comfortable though, and I love the material they used, it feels really nice, especially compared to the 8bitdo ultimate's cheap plastic. I also find the back triggers to be much better than the others. On the KK3 Max they have this new digital trigger mode and it's awful, but the normal analogue trigger feels fantastic. On the KK2 the triggers were pretty nice also.

PS5 controller's battery life is awful. Also the experience can vary depending on the adapter used, the Mayflash Magic ones I found to be significantly worse than the 8bitdo adapter.

The 8bitdo ultimate is just an allrounder. I don't like the shape and materials used, as well as the way the back triggers feel. All those points are better on the Guilikit, but then again the 8bitdo certainly is built better and I can say that it has 0 polling rate/latency issues and its gyro works great, which is why I say it's the safest options.

Also, no matter what 3rd party controller you'll get, you won't ever find a replacement for the original Switch Pro's HD Rumble stuff. In fact, Rumble is always a little awkward on all of these controllers I find.

[–] [email protected] 4 points 6 months ago

That's exactly it, no wonder I couldn't find it. Thank you so much!

[–] [email protected] 4 points 6 months ago

I have night light turned on 24/7 on all my devices. If I don't I get a headache after around a day.

In fact, I couldn't consistently use linux until recently because only the latest Nvidia drivers (545) added support for night light on wayland. Those glasses could've been handy there.

[–] [email protected] 1 points 6 months ago* (last edited 6 months ago) (1 children)

Rust

github codeberg gitlab

First tried a really slow brute force, but after waiting many minutes heard others talk of Karger's Algorithm, so I implemented that.

use rand::prelude::*;
use std::collections::HashSet;

type Graph = (V, E);

type V = HashSet;
type E = Vec<(String, String)>;

fn parse_input(input: &str) -> Graph {
    let mut vertices = HashSet::new();
    let mut edges = Vec::new();

    for line in input.trim().lines() {
        let mut it = line.split(':');

        let left = it.next().unwrap();
        vertices.insert(left.to_owned());

        for right in it.next().unwrap().trim().split_whitespace() {
            vertices.insert(right.to_owned());
            edges.push((left.to_owned(), right.to_owned()));
        }
    }

    (vertices, edges)
}

fn part1(input: &str) -> usize {
    let (vertices, edges) = parse_input(input);

    let mut rng = rand::thread_rng();

    // Karger's Algorithm
    loop {
        let mut vertices = vertices.clone();
        let mut edges = edges.clone();
        while vertices.len() > 2 {
            let i = rng.gen_range(0..edges.len());
            let (v1, v2) = edges[i].clone();

            // contract the edge
            edges.swap_remove(i);
            vertices.remove(&v1);
            vertices.remove(&v2);

            let new_v = format!("{}:{}", v1, v2);
            vertices.insert(new_v.clone());

            for (e1, e2) in edges.iter_mut() {
                if *e1 == v1 || *e1 == v2 {
                    *e1 = new_v.clone()
                }
                if *e2 == v1 || *e2 == v2 {
                    *e2 = new_v.clone()
                }
            }

            // remove loops
            let mut j = 0;
            while j < edges.len() {
                let (e1, e2) = &edges[j];
                if e1 == e2 {
                    edges.swap_remove(j);
                } else {
                    j += 1;
                }
            }
        }

        if edges.len() == 3 {
            break vertices
                .iter()
                .map(|s| s.split(':').count())
                .product::();
        }
    }
}
[–] [email protected] 2 points 6 months ago

Rust

github: https://github.com/Treeniks/advent-of-code/blob/master/2023/day24/rust/src/main.rs

codeberg: https://codeberg.org/Treeniks/advent-of-code/src/branch/master/2023/day24/rust/src/main.rs

gitlab: https://gitlab.com/Treeniks/advent-of-code/-/blob/master/2023/day24/rust/src/main.rs

Had to look on reddit for how to solve part 2. Wasn't happy with the idea of using something like Z3, so I ended up brute force guessing the velocity, solving for the position and time and seeing if those are correct.

Lots of unintelligible calculations for solving the equation systems in the code that I just prepared on paper and transferred over.

[–] [email protected] 14 points 6 months ago

This is correct, while OpenGL and DirectX 11 and before are considered high level APIs, Vulkan and DirectX 12 are both considered low level APIs.

[–] [email protected] 1 points 6 months ago* (last edited 6 months ago)

Zig

https://github.com/Treeniks/advent-of-code/blob/master/2023/day22/zig/src/main.zig

(or on codeberg if you don't like to use github: https://codeberg.org/Treeniks/advent-of-code/src/branch/master/2023/day22/zig/src/main.zig )

Every time I use Zig, I love the result, but I hate writing it. The language is just a little too inflexible for quick and dirty solutions to quickly try out an idea or debug print something useful, but once you're done and have a result, it feels quite complete.

[–] [email protected] 4 points 6 months ago (2 children)

Rust

https://github.com/Treeniks/advent-of-code/blob/master/2023/day21/rust/src/main.rs

I reused my Grid struct from day 17 for part 1, just to realize that I'll need to expand the grid for part 2 so I awkwardly hacked it to be a Vec> instead of a linear Vec.

I solved task 2 by reading through the reddit thread and trying to puzzle together what I was supposed to do. Took me a while to figure it out, even with literally looking at other people's solutions. I wrote a lengthy comment about it for anyone that's still struggling, but I honestly still don't really understand why it works. I think I wouldn't have solved it if I didn't end up looking at other solutions. Not a fan of the "analyze the input and notice patterns in them" puzzles.

[–] [email protected] 2 points 7 months ago (1 children)
[–] [email protected] 1 points 7 months ago* (last edited 7 months ago) (1 children)

I'm a little confused about this one. The mappings are total, that is any number that is not defined explicitly gets mapped to itself. So it's easy to create an example where the lowest number does not get mentioned within a range:

seeds: 0 3

seed-to-soil map:
10 0 2

soil-to-fertilizer map:
100 200 5

fertilizer-to-water map:
100 200 5

water-to-light map:
100 200 5

light-to-temperature map:
100 200 5

temperature-to-humidity map:
100 200 5

humidity-to-location map:
100 200 5

Here, we have seeds 0, 1 and 2. seed 0 gets mapped to location 10, seed 1 gets mapped to location 11 and seed 2 gets mapped to location 2. That means location 2 would be the answer, but it's not a start of any range. I guess this just doesn't happen in any of the inputs?

EDIT: actually it's double weird. If you implemented a backwards search, that is you create reverse mappings and then try out all locations (which is what I and many others did), the result of the above example is location 0, whereas if you create a forwards brute force of all seeds, the result is 2. For the reverse approach to work in all cases, the mappings would have to be bijective.

view more: ‹ prev next ›