• 63 Posts
  • 2.48K Comments
Joined 2 years ago
cake
Cake day: June 18th, 2023

help-circle












  • Archery app. Basically zero users, and got purged from the play store earlier this year because I refused to jump through their hoops.

    It was was meant for use with scopes, you would put in some distance and scope settings pairs into it, and it would fit a line allowing you to estimate intermediate scope settings.

    It also had an AR mode, where you could save a targets GPS position, and get the distance and angle to the target, and the pin setting.

    Sadly, never got any users. So its just for me now. And I deleted the AR stuff.




  • Rust

    Its not Christmas, but this one was a gift :D. Merry Christmas all, thanks for everyone who has contributed solutions!

    Rest easy little advent bot, your work is done now.

    spoiler
        struct Tree {
            w: u32,
            h: u32,
            presents: Vec<u32>,
        }
    
        fn is_solveable(tree: &Tree) -> bool {
            if tree.h * tree.w < tree.presents.iter().sum::<u32>() * 9 {
                return false;
            }
            true
        }
    
        #[test]
        fn test_y2025_day12_part1() {
            let input = include_str!("../../input/2025/day_12.txt");
            let parts = input.split("\n\n").collect::<Vec<_>>();
    
            let trees: Vec<Tree> = parts
                .last()
                .unwrap()
                .lines()
                .map(|line| {
                    let parts: (&str, &str) = line.split_once(": ").unwrap();
                    let [w, h] = parts
                        .0
                        .split("x")
                        .map(u32::from_str)
                        .map(Result::unwrap)
                        .collect::<Vec<_>>()[..]
                    else {
                        unreachable!()
                    };
                    let num_presents = parts
                        .1
                        .split(" ")
                        .map(u32::from_str)
                        .map(Result::unwrap)
                        .collect::<Vec<_>>();
                    Tree {
                        w,
                        h,
                        presents: num_presents,
                    }
                })
                .collect();
    
            let mut solvable = 0;
            for tree in trees {
                if is_solveable(&tree) {
                    solvable += 1;
                }
            }
            println!("solvable: {}", solvable);
        }