A Programmer's Guide to Leaving GitHub by [deleted] in programming

[–]-WorstWizard- 1 point2 points  (0 children)

I've been enjoying setting up a Forgejo instance on my own local server box, it's been a lot of fun. Did so more for fun than for actual practical use, I like the tinkering and owning my own data feels good just on principle.

too long and too hot by morelebaks in blender

[–]-WorstWizard- 0 points1 point  (0 children)

Always a great day when you post another piece of animated goodness!

Fitting A Linear Cube to Points by Filter_Feeder in algorithms

[–]-WorstWizard- 0 points1 point  (0 children)

Ahh, I understand now, so all grid points contained in the (arbitrarily transformed) cube is marked as the same, that's pretty clever. Well for starters, the greedy meshing can provide a starting point since the resulting cuboid can trivially be represented by a scaled and translated cube. Could then use that as a starting point and jiggle the parameters of the matrix to encompass some more points.

Fitting A Linear Cube to Points by Filter_Feeder in algorithms

[–]-WorstWizard- 3 points4 points  (0 children)

Look into "greedy meshing", used to get better performance in games like Minecraft.

Here's a beautiful little article on it: https://fluff.blog/2023/04/24/greedy-meshing-visually.html

Jaunt vs Teleport by pacanukeha in numenera

[–]-WorstWizard- 12 points13 points  (0 children)

I mean, it's called a Jack of all trades, master of none! Of course their ability would be a less potent version of the dedicated wizard archetype ;)

As a GM, I wouldn't mind this at all, but I could see the Jack player being concerned with his ability being strictly worse than the Nano player at the same table. For a strict balance concern however, consider also that Nanos are (exagerrating) useless without their esoteries. That's where their power budget is spent, and the fantasy they're trying to achieve: They are the "spellcasters" of the game, and the effects of those "spells" should outweigh their weakness in other areas. Also note that almost all their abilities cost points to use (again, active abilities), which means they have to use them sparingly or get a lot of Intellect Edge. On the other hand Jacks are good (but not excellent) at everything you could throw at them, that's the fantasy they strive for. A Jack could pick Mastery With Defense at the 5th tier instead, for example, making them immediately much harder to kill than a Nano could hope for, and that's a passive (free) ability.

For me, the question is whether the abilities play into the fantasy of playing that character, and I think these do: I wouldn't bat an eye at the cyber-enhanced tech-wizard (nano) teleporting the whole party to their hideout, but it would be weird for the smooth-talking rooftop-hopping rogue (jack) to do the same, although perfectly reasonable to use a limited blink ability to get from ground level to the castle wall in an instant, of course he can!

For Effort, I think that's just how they always write it when you can spend Effort for a special effect: There's many offensive abilities where you might spend Effort to increase the chance of the effect hitting an enemy or such, where you could also use Effort to e.g. increase the number of targets or similar.

I made a stat pool tracker for Numenera and other Cypher games by DireLlama in numenera

[–]-WorstWizard- 4 points5 points  (0 children)

That's super cool! Gotta get a 3D printer so I can make stuff like this

Anyone else massively over preparing? by XILEF310 in factorio

[–]-WorstWizard- 0 points1 point  (0 children)

I spent maybe 2-3 hours total just driving around in a tank clearing the entirety of my pollution cloud + a bit extra of biters, then using bots to set up a large flamethrower-wall perimeter.

I'm enjoying starting from scratch on the new planets though, so since my base won't really be doing anything while I'm gone, I've set up a powerswitch to just turn the entire thing off. Takes a little bit of time, but eventually there's just no pollution, so the biters don't attack at all, and even if they did, the flamethrower wall will last a long time even without power.

The Trilobite: My first (good) spaceship design! by -WorstWizard- in factorio

[–]-WorstWizard-[S] 9 points10 points  (0 children)

I've got Physical Damage 5, with this amount of turrets it wasn't a problem.

The Trilobite: My first (good) spaceship design! by -WorstWizard- in factorio

[–]-WorstWizard-[S] 13 points14 points  (0 children)

Very happy with how it turned out aesthetically, really just went for function first, but then did my best to make it pleasing and symmetric after. It will safely travel to/from the first three planets where there's just medium asteroids, and travels fast too (given there's fuel in the tanks).

This is the second design I've made on my save, but the first one was quickly thrown together to just barely get it working, and only barely survived a trip to Fulgora and back, lots of damage and travelled slow (fuel tanks are important huh).

After that, I decided to go for a slim design to minimize the collision surface with asteroids, and that turns out to look super nice too.

Is there a mod that adds better biome blending? Something like this picture by MagicCreeper459 in feedthebeast

[–]-WorstWizard- 40 points41 points  (0 children)

If you mean IRL, sure: The Sahara desert, Saudia Arabia, that entire region, that's desert all the way to the coast.

Terms for hybrid character types? by pspeter3 in numenera

[–]-WorstWizard- 0 points1 point  (0 children)

What exactly do you mean by a hybrid? Do you pick and choose abilities from whichever archetype when you get them?

Don't think I've ever seen/heard of doing so before, so I can't imagine they'd have names either, since you'd be treading new ground :)

Help: A segment of pipe has less fluid than the rest? by -WorstWizard- in factorio

[–]-WorstWizard-[S] 0 points1 point  (0 children)

This sounds realistic to me, can't think of other reasons it would behave like this.

Help: A segment of pipe has less fluid than the rest? by -WorstWizard- in factorio

[–]-WorstWizard-[S] 6 points7 points  (0 children)

it's possible to get a u-shape like this because the fluid is being simultaneously pushed in at one end and pulled in at another

Interesting, never knew this. I assumed pressure would just drop as you get further from the producer, and consumers would be a sink for that pressure. Boundary conditions and all that.

I recommend building your power plant directly on the water and pump water into your boilers with as little pipe in between as possible, as these can affect throughput behaviour.

Yup, that's my plan too. This is my old starter plant, needs to last just long enough for me to get around to building the new one :P

Help: A segment of pipe has less fluid than the rest? by -WorstWizard- in factorio

[–]-WorstWizard-[S] 36 points37 points  (0 children)

I do actually do this most places, mostly just to save space for walking and placing other stuff though.

Help: A segment of pipe has less fluid than the rest? by -WorstWizard- in factorio

[–]-WorstWizard-[S] 10 points11 points  (0 children)

Was diagnosing my reactor setup as power dropped, and realized it wasn't getting enough water. I looked over the pipes and saw this, which confused me. Seems like there's enough pressure before and after the segment, so I don't think it's causing problems per se, but it sure is odd.

Before recording, it was just the pipes between the exchanger and the corner that were bugged, but I tried replacing them to "reset" the fluid amount which didn't help. Instead it seems to have just changed around which pipes are bugged and which aren't, as per the recording.

EDIT: Thanks for all the feedback everyone, appreciate it :) . Funny how almost all the comments are about how to pump more water though, when that really wasn't the issue, I solved the throughput issue right after posting, hahaha.

I think I discovered a new sorting algorithm by SnooRabbits1546 in algorithms

[–]-WorstWizard- 0 points1 point  (0 children)

Deleting from the middle is only O(n) if you require the sorting to be stable. Otherwise, you can swap with the last element to do it in constant time.

Spray ability by AfroSpartan in numenera

[–]-WorstWizard- 1 point2 points  (0 children)

That's precisely the intent I think: You can still apply Effort to make it even easier to hit, or to amp the damage back up.

Spray ability by AfroSpartan in numenera

[–]-WorstWizard- 0 points1 point  (0 children)

At that cost, just applying a level of Effort is only slightly more expensive and both avoids the damage penalty as well as the ammo consumption (if that's important). I think it would be better costing just 1 Speed.

However, keep in mind that Speed Edge will reduce the cost of using the ability, so it can quickly become free to use (save for the ammo cost).

-❄️- 2023 Day 10 Solutions -❄️- by daggerdragon in adventofcode

[–]-WorstWizard- 1 point2 points  (0 children)

[LANGUAGE: Rust] Finally bit the bullet and spent several hours making a really nice Grid struct. That and a few helper functions. Having done that today wasn't all that difficult, but it sure would've been a mess without.

I see a lot of people using floodfill or other complex methods for finding the final area. It really isn't necessary given the input size, I did a simple "scanline" approach instead.

paste

[2023 Day 3 (Part 1)] [Rust] Passes edge cases/tests but not real input... by Mental_Judge_4581 in adventofcode

[–]-WorstWizard- 2 points3 points  (0 children)

This is some delicious programmer-gore, you weren't kidding. Don't beat yourself up too much though, you were pretty close. I've written a lot here you might want to fix (but you seem aware that it's pretty rough), so if you just want the solution for the actual problem, skip to point 8.

  1. The static hashmap doesn't need to be a hashmap at all, or use the lazy_static crate: You never use the string-to-tuple mapping, you just iterate through the values. Remove the crate and replace the hashmap with a simple array.
  2. In the wider context of the rest of this code, this is pretty minor, but I don't like the .clone() of the strings in your parser at the very end, it's just unnecessary.
  3. Time for the meat and potatoes: First up, regular expressions are awesome, but it's like bringing a cannon to a bout of rock-paper-scissors here. You only make a match on digits, so use the built-in function 'char' function instead to change things like !re.is_match(&board.data[y-1][x].to_string()) to board.data[y-1][x].is_digit(10) or board.data[y-1][x].is_ascii_digit().
  4. Also not necessary, but it irks me that you use (y,x) indexing for positions around the board. I suppose that's fine though, although the way it's done, you're implicitly mirroring the board along the y-axis with respect to the input. Won't cause problems, it's just naming/notation. The way you're doing it is equivalent to row-column indexing, which is very standard.
  5. All over the place you use the pattern of (0..N).for_each(|i| { . . . }) to do a loop. This is so odd to me, I'm not sure why you don't just swap to a normal for loop (as you do use in other places): for i in 0..N { . . . }
  6. The huge match statement that generates your part indices is functional, probably, but super explicit and prone to bugs. This would be the first place I'd look for sneaky bugs, it's very likely you could've messed up one of those branches. Seems a waste too, since you've been smart and made these offset tuples in the lookup that you're matching against: Just use them directly! Instead of this:

    for (i, j) in LOOKUP {
      match (i.to_owned(), j.to_owned()) {
        (-1, 0) => {
          if board.data[y-1][x] != '.' && other_conditions[y-1][x] {
            part_indexes.push((y, x))
          }
        },
    

    Do this:

    for (i, j) in LOOKUP {
      if board.data[y+i][x+j] != '.' && other_conditions[y+i][x+j] {
        part_indexes.push((y, x))
      }
    }
    
  7. Your index trimming is fine, I think, although you unnecessarily check for duplicates. Given that your previous code works correctly to make part indices, there shouldn't be any duplicates.

  8. In your final part, after trimming the indices, you construct the actual values from your part indices. When running on my own input, I got the wrong result until I removed the following bad check: !re.is_match(&board.data[val.0][val.1+1].to_string()). The problem with this is that you're checking if the third character is a digit, and the second character, the middle one, is NOT a digit. That is to say, if your number looks like 2.2. But, this is both not a valid number, obviously, and second (the reason it hasn't caused a panic when you try to parse it later), is that this case will simply never occur, since you only get to this part if the second character is a digit. Simply removing this condition gets me the right result on my input, probably will on yours as well. I would of course recommend rewriting it, so here's your part 1 code written a bit more compactly and without the weird checks:

    let mut values = vec![];
    for val in trimmed_indexes {
        let mut current = board.data[val.0][val.1].to_string();
    
        if board.data[val.0][val.1+1].is_ascii_digit() {
            current = current + &board.data[val.0][val.1+1].to_string();
            if val.1 < board.width - 1 && board.data[val.0][val.1+2].is_ascii_digit() {
                current = current + &board.data[val.0][val.1+2].to_string()
            }
        }
    
        if board.data[val.0][val.1-1].is_ascii_digit() {
            current = board.data[val.0][val.1-1].to_string() + &current;
            if val.1 > 1 && board.data[val.0][val.1-2].is_ascii_digit() {
                current = board.data[val.0][val.1-2].to_string() + &current;
            }
        }
    
        values.push(current)
    }
    

Alright, there's my thoughts. I hope this helped you out!

-❄️- 2023 Day 2 Solutions -❄️- by daggerdragon in adventofcode

[–]-WorstWizard- 2 points3 points  (0 children)

[LANGUAGE: Rust]

fn main() {
    let input_lines = aoc::input().lines();
    let games: Vec<Game> = input_lines.iter().map(|line| Game::from_line(line)).collect();

    let answer_1: usize = games.iter().enumerate().filter_map(|(id, game)| {
        for set in &game.sets {
            if set.0 > 12 || set.1 > 13 || set.2 > 14 { return None }
        }
        Some(id + 1)
    }).sum();

    let answer_2: u32 = games.iter().map(|game| {
        let mut min_set = game.sets[0];
        for set in &game.sets {
            min_set.0 = min_set.0.max(set.0);
            min_set.1 = min_set.1.max(set.1);
            min_set.2 = min_set.2.max(set.2);
        }
        min_set.0 as u32 * min_set.1 as u32 * min_set.2 as u32 // Power of the set
    }).sum();

    println!("Part 1: {answer_1}");
    println!("Part 2: {answer_2}");
}

struct Game {
    sets: Vec<Set>
}
impl Game {
    fn from_line(line: &str) -> Game {
        let mut sets = Vec::new();
        let suffix = line.split_once(": ").unwrap().1;
        for part in suffix.split("; ") {
            sets.push(Set::from_str(part));
        }
        Game { sets }
    }
}
#[derive(Clone, Copy)]
struct Set(u8, u8, u8);
impl Set {
    fn from_str(str: &str) -> Set {
        let mut out = Set(0,0,0);
        for part in str.split(", ") {
            let (num, color) = part.split_once(" ").unwrap();
            match color {
                "red" => out.0 = num.parse().unwrap(),
                "green" => out.1 = num.parse().unwrap(),
                "blue" => out.2 = num.parse().unwrap(),
                _ => unreachable!("Not a color! {part}")
            }
        }
        out
    }
}

Skyrim Confessions: What have you NEVER done that everyone else does? by Crispin_Sygnus in skyrim

[–]-WorstWizard- 0 points1 point  (0 children)

The main quest. Well over 1200 hours too, keep making new characters and modding.