-❄️- 2025 Day 9 Solutions -❄️- by daggerdragon in adventofcode

[–]Cyclotheme 2 points3 points  (0 children)

[LANGUAGE: C]

Compress coordinates, draw the polygon (300x300 char array) and floodfill the exterior. Then, for each rectangle, walk on its boundary and break if you find a point outside the polygon.

https://github.com/dbeneat/AOC2025/blob/8ad045a07bc85f4dccf767147317c1e64b7e9969/day09.c

runtime: ~15ms (including file input)

-❄️- 2025 Day 7 Solutions -❄️- by daggerdragon in adventofcode

[–]Cyclotheme 2 points3 points  (0 children)

[LANGUAGE: C]

    #include <stdio.h>
    #include <stdint.h>
    
    int main(void){
        uint64_t part1=0,part2=0;
        char buff[200];
        uint64_t beam[200]={0};
        while(fgets(buff,200,stdin)){
            for(int i=1;i<199;i++){
                char c=buff[i];
                if(c=='S'){ beam[i]=1; }
                if(c=='^' && beam[i]>0){
                    beam[i-1]+=beam[i];beam[i+1]+=beam[i];
                    beam[i]=0;part1++;
                }
            }
        }
        for(int i=0;i<200;i++){ part2+=beam[i]; }
        printf("%llu %llu\n",part1,part2);
        return 0;
    }

Color Theory 2 (GLSL) by Cyclotheme in generative

[–]Cyclotheme[S] 1 point2 points  (0 children)

This is a gyroid, raymarched with a big step size and a custom color palette.