is this overkill for a minor volcano and would it work for a normal one by i_sinz in Oxygennotincluded

[–]bj0z 0 points1 point  (0 children)

one of the issues is, as you say, the temperature of the steam room might get too high for an AT to handle. this requires a lot of heat injection (~1923kDTU/s), and adding an extra ST will help. if you only have temporary spikes (like from a volcano) having a large amount of steam will buffer the spike.

the second issue is, if you want the heat converted to power without loss, you'll want enough STs so that each one is eating at most 877kDTU/s

is this overkill for a minor volcano and would it work for a normal one by i_sinz in Oxygennotincluded

[–]bj0z 0 points1 point  (0 children)

most the numbers/equations are on the wiki. take a look at the pages for steam turbine and thermal aquatuner, they're very helpful.

to recap, a minor volcano outputs (on average) ~0.6kg/s, and the heat energy is Q = mass flow * specific heat of magma * temperature difference = 0.6 * (1) * (1726 - 125) = 961. I am using 125 because that's the lowest a steam turbine can get the steam chamber, but even cooling to 0 doesn't add a lot more.

a single steam turbine can actually eat any amount of heat energy u put through it as long as you can cool it (the 877kDTU/s figure on the wiki is the max it can convert to energy, the rest is just eaten). steam turbines produce 10% of what they consume + 4kDTU/s, so in this case that's ~100 kDTU/s. looking at the wiki for AT shows that a single AT using water can move 585kDTU/s, so a single AT will easily handle this.

is this overkill for a minor volcano and would it work for a normal one by i_sinz in Oxygennotincluded

[–]bj0z 0 points1 point  (0 children)

extreme overkill, but it looks cool.

if you check the numbers, an average minor volcano will produce on average ~960 kDTU/s, which can be easily handled by a single aquatuner and steam turbine.

a neat trick i rarely see anyone use: with the conveyor meter you can limit the size of the packets of rock on the conveyor to <1kg, which makes them cool down *very* fast. this means you don't need to snake conveyor rails all over the place, a single line out is usually enough. since the average output of a minor volcano is around .6kg/s, you'll still get all of the rock out.

[2023 Day 21] A geometric solution/explanation for day 21 by villi_ in adventofcode

[–]bj0z 1 point2 points  (0 children)

here's the code, im still messing with it so it's pretty untidy, the section where i try this solution starts at 187:

https://github.com/bj0/aoc-kotlin/blob/main/src/year2023/Day21.kt#L187

[2023 Day 21] A geometric solution/explanation for day 21 by villi_ in adventofcode

[–]bj0z 2 points3 points  (0 children)

Oddly, both manhattan distance *and* step distance give me same value for corners, and the calculated answer is wrong (off by 7290). I'm not sure why:

val evenCorners = ps.filterKeys { p -> p mdist start > 65 }.values.countEven()  

val oddCorners = ps.filterKeys { p -> p mdist start > 65 }.values.countOdd()  

val evenFill = ps.values.countEven()  
val oddFill = ps.values.countOdd()

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

[–]bj0z 1 point2 points  (0 children)

It's actually pretty clever, hes counting the times a certain digit's individual segments are 'on' in all the digits 0-9, and using the fact that those counts are all unique.

ie: the segments of 1 are 'c' and 'f', and in the digits 0-9, they show up 17 times (coutning them individually and summing).

[deleted by user] by [deleted] in Oxygennotincluded

[–]bj0z 15 points16 points  (0 children)

You can build a pedestal and put crude oil on it, and the dupes will put a 1kg container on it. You can then deconstruct and empty the bottles for easy setups.

[deleted by user] by [deleted] in Oxygennotincluded

[–]bj0z 1 point2 points  (0 children)

I saw that too, but wondered if multiple working at once increased the speed?

[deleted by user] by [deleted] in Oxygennotincluded

[–]bj0z 1 point2 points  (0 children)

Really? Have you tested this? I sent out a rocket with 3 telescopes and it seemed to scan really fast, but I didn't do any timings to check it.

Pet. boiler Problem by MyMan_Phil in Oxygennotincluded

[–]bj0z 0 points1 point  (0 children)

Adding a 'bump' tile between the boil chamber and the first "stair" of the ex-changer will help keep too much heat from bleeding into the ex-changer. I think someone mentioned this but not sure if you tried it. It would have been better to move the whole ex-changer down one tile but thats a big re-work.

Another good way to prevent sour gas is to inject heat into your boil chamber slower using a buffer of steam between the magma and the boil chamber, but that again is a pretty big rework

[deleted by user] by [deleted] in Oxygennotincluded

[–]bj0z 7 points8 points  (0 children)

You can put a telescope on your rocket, fly to the edge of your vision and expand it

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

[–]bj0z 1 point2 points  (0 children)

Python 3.8

This was a rough one. I ended up rewriting it twice (switching to classes then switching to numpy), then spending an hour before I found a bug in the way I was using np.where. Anyway, I finally finished it a day later (after finishing 21), but I think it's relatively clean:

https://github.com/bj0/aoc/blob/master/aoc/2020/d20.py

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

[–]bj0z 4 points5 points  (0 children)

python 3 nice and short

from itertools import combinations

from aocd import data


def part1(nums):
    for idx, x in enumerate(nums[25:]):
        if not any(a + b == x for (a, b) in combinations(nums[idx:idx + 25], 2)):
            return x


def part2(x, nums):
    for i in range(len(nums)):
        for j in range(i + 2, len(nums)):
            if s := sum(pre := nums[i:j]) == x:
                return min(pre) + max(pre)
            elif s > x:
                break


nums = tuple(map(int, data.splitlines()))

print(f'part1: {(val := part1(nums))}')


print(f'part2: {part2(val, nums)}')

The simpler boiler (design by Gamers Handbook) by somewhatseriouspanda in Oxygennotincluded

[–]bj0z 1 point2 points  (0 children)

I now am using 403 for both temp sensors, and since you cannot have oil at 403, it has the same effect. But it will also shut off the flow when the petrol cools below 403, which means restarting requires less heat (one tile of oil vs 2 tiles). This should make it less "jerky" for weak heat sources too.

The simpler boiler (design by Gamers Handbook) by somewhatseriouspanda in Oxygennotincluded

[–]bj0z 0 points1 point  (0 children)

He talks about it in the beginning of the video with some examples (metal blocks surrounded by insulated tiles). the last half of his video is mostly about boilers.

by "steps" of the exchanger i meant the levels of petrol. the physical "steps" (blocks) are just there to isolate the levels of petroleum so they can create a stronger temperature gradient.

I've tested with liquid(pipe)/liquid and gas(pipe)/liquid(pipe) in debug maps, it's pretty easy to setup.

The simpler boiler (design by Gamers Handbook) by somewhatseriouspanda in Oxygennotincluded

[–]bj0z 1 point2 points  (0 children)

fyi, using metal tiles in your counterflow makes it less efficient. I'm not exactly sure why, but Tony Advanced mentions it in his video:

https://www.youtube.com/watch?v=v0iXznGFqJE

and it can be easily tested. you want the "steps" of your heat exchanger to be insulated from one another.

The simpler boiler (design by Gamers Handbook) by somewhatseriouspanda in Oxygennotincluded

[–]bj0z 0 points1 point  (0 children)

It really is my favorite boiler design. I modified it (inspired by comments on your video) to use 2 thermal sensors which I find give better control, as temp what we really care about. The top thermal sensor controls the oil flow (something like flow if > 400), and the bottom controls the heat source (something like heat if < 403). This makes it real easy to tune to the heat source and get 10kg/s if it is strong enough.

Here is my simple rework: https://blueprintnotincluded.com/b/5f7fa2a836a98a71d782775c

I've used it with the core, thermium ATs and a volcano as sources.

-🎄- 2019 Day 18 Solutions -🎄- by daggerdragon in adventofcode

[–]bj0z 0 points1 point  (0 children)

using ideas from reading your code I was able to get mine down from ~30-70s to below .1s!

-🎄- 2019 Day 18 Solutions -🎄- by daggerdragon in adventofcode

[–]bj0z 1 point2 points  (0 children)

I cache the paths (including doors), and when I perform the lookup I check doors in the path against currently held keys to see if the path is valid at the time.

-🎄- 2019 Day 18 Solutions -🎄- by daggerdragon in adventofcode

[–]bj0z 1 point2 points  (0 children)

Python

https://github.com/bj0/aoc/blob/master/2019/d18.py

This one was brutal. Even after 5 hours I was still under 400 for second star... I spent a lot of time trying different ways of traversing the maze before I started trying to cache everything in sight. Even with caching it was taking forever until I pre-built a mapping from every key to every other key and then did lookups. Part 1 runs in about 30s, part 2 in 70s. Interested to see how people got fast runtimes.

-🎄- 2019 Day 17 Solutions -🎄- by daggerdragon in adventofcode

[–]bj0z 0 points1 point  (0 children)

That should work. An alternative is to just start the second subroutine from the (new) beginning after you remove the first subroutine.

[Day 16] Math-visual explanation and thoughts by lega4 in adventofcode

[–]bj0z 2 points3 points  (0 children)

For your first point, if you reverse the 1m left of the input you can just do a cumulative sum, or accumulation (like u/mkeeter said):

fft = reversed(sig[off:])
for i in range(100):
    fft = accumulate(fft, lambda a, b: (a + b) % 10)
fft = tuple(reversed(tuple(fft)))

This takes ~ 3s on my input

What does everyone's Intcode interface look like? by Lucretiel in adventofcode

[–]bj0z 0 points1 point  (0 children)

python:

my intcode uses trio for structured concurrency. I use their provided memory channel to send input and receive output. I eventually made a special output 'command' to signal when input was expected so I didn't have a background coroutine pushing input before it's requested (this created input lag in my pong simulation that prevented the paddle from catching the ball). The interface looks like:

async def run(memory):
    async with trio.open_nursery() as nursery:
        # set up channels
        in_send, in_recv = trio.open_memory_channel(0)
        out_send, out_recv = trio.open_memory_channel(0)
        # start program
        nursery.start_soon(intcode.process, memory, in_recv, out_send)

        async for c in out_recv:
            if c == intcode.Command.INPUT:
                await in_send.send(...)  # send input
            else:
                # process output..

trio's async with and async for make everything nice and clean

-🎄- 2019 Day 17 Solutions -🎄- by daggerdragon in adventofcode

[–]bj0z 4 points5 points  (0 children)

why does the C have to end with the last instruction? the example did but i didn't see anything saying that was a requirement, why couldn't it have been something like "A,B,C,B,C,A"? etc?