[-] Ategon@programming.dev 3 points 2 years ago

There will be another poll in around 6 months

[-] Ategon@programming.dev 3 points 2 years ago

The bots not whitelisted in this community but heres your reminder from me instead

[-] Ategon@programming.dev 3 points 2 years ago* (last edited 2 years ago)

If youre interested in the sublinks side of things the primary chatting platform for that is matrix (discord is just for programming.dev specific things since that's where the rest of the admin team is)

Most of the repos will also be open source on our github org when the things they're for release

[-] Ategon@programming.dev 3 points 2 years ago* (last edited 2 years ago)

btw I made a post in our instance meta community if you want to read it. Been trying to resolve the situation !meta@programming.dev

[-] Ategon@programming.dev 3 points 2 years ago

Yep, I can update that maybe later today. Was waiting until I get them all up but can do the first 3 while I deal with mlmym

[-] Ategon@programming.dev 3 points 2 years ago

Change has been pushed

[-] Ategon@programming.dev 3 points 2 years ago* (last edited 2 years ago)

Rust (Rank 7421/6311) (Time after start 00:32:27/00:35:35)

Extremely easy part 2 today, I would say easier than part 1 but they share the same sort of framework

Code Block(Note lemmy removed some characters, code link shows them all)

use std::fs;

fn part1(input: String) -> i32 {
    const RED: i32 = 12;
    const GREEN: i32 = 13;
    const BLUE: i32 = 14;

    let mut sum = 0;

    for line in input.lines() {
        let [id, content] = line.split(": ").collect::>()[0..2] else { continue };
        let id = id.split(" ").collect::>()[1].parse::().unwrap();

        let marbles = content.split("; ").map(|x| { x.split(", ").collect::>() }).collect::>>();
        let mut valid = true;

        for selection in marbles {
            for marble in selection {
                let marble_split = marble.split(" ").collect::>();
                let marble_amount = marble_split[0].parse::().unwrap();
                let marble_color = marble_split[1];

                if marble_color == "red" && marble_amount > RED {
                    valid = false;
                    break;
                }

                if marble_color == "green" && marble_amount > GREEN {
                    valid = false;
                    break;
                }

                if marble_color == "blue" && marble_amount > BLUE {
                    valid = false;
                    break;
                }
            }
        }

        if !valid {
            continue;
        }

        sum += id;
    }

    return sum;
}

fn part2(input: String) -> i32 {
    let mut sum = 0;

    for line in input.lines() {
        let [id, content] = line.split(": ").collect::>()[0..2] else { continue };
        let id = id.split(" ").collect::>()[1].parse::().unwrap();

        let marbles = content.split("; ").map(|x| { x.split(", ").collect::>() }).collect::>>();
        
        let mut red = 0;
        let mut green = 0;
        let mut blue = 0;

        for selection in marbles {
            for marble in selection {
                let marble_split = marble.split(" ").collect::>();
                let marble_amount = marble_split[0].parse::().unwrap();
                let marble_color = marble_split[1];

                if marble_color == "red" && marble_amount > red {
                    red = marble_amount;
                }

                if marble_color == "green" && marble_amount > green {
                    green = marble_amount;
                }

                if marble_color == "blue" && marble_amount > blue {
                    blue = marble_amount;
                }
            }
        }

        sum += red * green * blue;
    }

    return sum;
}

fn main() {
    let input = fs::read_to_string("data/input.txt").unwrap();

    println!("{}", part1(input.clone()));
    println!("{}", part2(input.clone()));
}

Code Link

[-] Ategon@programming.dev 3 points 2 years ago

[Rust] 11157/6740

use std::fs;

const m: [(&str, u32); 10] = [
    ("zero", 0),
    ("one", 1),
    ("two", 2),
    ("three", 3),
    ("four", 4),
    ("five", 5),
    ("six", 6),
    ("seven", 7),
    ("eight", 8),
    ("nine", 9)
];

fn main() {
    let s = fs::read_to_string("data/input.txt").unwrap();

    let mut u = 0;

    for l in s.lines() {
        let mut h = l.chars();
        let mut f = 0;
        let mut a = 0;

        for n in 0..l.len() {
            let u = h.next().unwrap();

            match u.is_numeric() {
                true => {
                    let v = u.to_digit(10).unwrap();
                    if f == 0 {
                        f = v;
                    }
                    a = v;
                },
                _ => {
                    for (t, v) in m {
                        if l[n..].starts_with(t) {
                            if f == 0 {
                                f = v;
                            }
                            a = v;
                        }
                    }
                },
            }
        }

        u += f * 10 + a;
    }

    println!("Sum: {}", u);
}

Link

[-] Ategon@programming.dev 3 points 3 years ago* (last edited 3 years ago)

Reposting from the python post you did just to make sure you see it

Just wanted to let you know that we dont allow reposting of comments made on other platforms in this instance (both for spam reasons and tends to be a mess with gdpr). Link posts with no text are fine as long as you get approval from a moderator of a community or by one of the admins for site wide usage (and then allow moderators to opt out), and follow our bot guidelines that you can find in the sidebar on our site. Id be willing to greenlight the bot for sitewide usage as long as you remove the comments, make posts links only (links to the content, not the reddit post) and limit it to maximum 10 posts a day across the instance (max 2 in a specific community) (and also make sure you dont repost stuff already posted in the community). We have another bot called reddit x-poster that its been working fairly well with but they hang out in a couple communities like haskell

In terms of this community itself it doesnt really need help with posting. Its got more than 200 monthly active users already and around 4 posts every day

[-] Ategon@programming.dev 3 points 3 years ago

I believe the limit is 1MB on all instances by default so should be what our current limit is as well

[-] Ategon@programming.dev 3 points 3 years ago

Bot seems to be struggling after the upgrade to v18. Hopefully comes back up soon

[-] Ategon@programming.dev 3 points 3 years ago

The server was getting hit by a ddos attack earlier if you were getting 404s when trying to use programming.dev

Its running fine now though

23
42
submitted 3 years ago* (last edited 3 years ago) by Ategon@programming.dev to c/godot@programming.dev
8
Godot Sunday Showcase (programming.dev)
submitted 3 years ago* (last edited 3 years ago) by Ategon@programming.dev to c/godot@programming.dev

Are you making anything in godot? Feel free to discuss it below or show off your progress!

6

Hey everyone! Just wanted to let you know of some features ive been working on for the instance and get some feedback on them to shape how they turn out

The main things mostly involve the addition of flairs around the website similar to reddit flairs

User Flairs

The first addition to be added is user flairs. Communities will be able to make flairs for use in their community with self assignable flairs, and flairs given by mods. These could include things like marking people who participated in a special event, adding in what specific programming language you use, or marking people who made contributions like making the community banner.

Mods will be able to create and assign flairs using a button beside the inbox button in the top right, and users will be able to get flairs from the sidebar

Flairs are put into flair groups which only allow certain amounts of flairs from that group to be chosen. For example if you have a role for choosing programming language and you only want people to choose one you can set a max of 1 for that flair group. (This can be set to whatever you want as long as its a nonnegative integer)

Post Flairs

Post flairs function essentially the same as user flairs but are put on posts instead. Flairs can be set to be only assignable by mods or able to be assigned by everyone and they are also in flair groups if you only want one of a type to be added (e.g. if you have category post flairs for help, news, etc. and dont want people to assign both help and news to the same post)

Community Flairs

Function the same as the other two but are created by admins and set by mods instead of mods and users. Are added to communities to show what category of community it is (e.g. gamedev, webdev, etc.)

Mod List

Currently in community both admins and mods show up in the mod list. Im aiming to add a small update to only show mods so that admins arent shown (as they arent the ones running the community) unless explicitly added

Ive got an image showing a possible setup for flairs. Currently all the posts in here have the same flair format as its not built apart from basic ui but can give a rough idea of it

8
2
1
Feedback Friday (programming.dev)

Welcome to Feedback Friday!

Have a scene in your game that you want to know if it looks good? Have a mechanic prototype that you want tested? Want to know if your steam page is good? Or do you want feedback on some other part of your game? Feel free to post them below for others to give feedback!

3
submitted 3 years ago* (last edited 3 years ago) by Ategon@programming.dev to c/meta@programming.dev

Hey everyone! Just wanted to let you know that we have a matrix room at https://matrix.to/#/#programming.dev:matrix.org and a discord server at https://discord.com/invite/kwyxvYEYt4 for discussions outside of threads

If youre a mod for a community I also recommend setting up a group chat for all of the mods in your community so you can chat between yourselves easily (theres a dm feature built into lemmy but as far as I know its just for two people). Ive been setting up mine on matrix but you can chat to see what you prefer

7
9
Feedback Friday (programming.dev)

Welcome to Feedback Friday!

Have a scene in your game that you want to know if it looks good? Have a mechanic prototype that you want tested? Want to know if your steam page is good? Or do you want feedback on some other part of your game? Feel free to post them below for others to give feedback!

16
1

A game jam for the fediverse community from July 14th to July 23rd! Anyone is welcome to join and all of the main communication about the jam will be taking place within the fediverse

Open sourcing games you make for it is recommended so people in the community can learn from what you did. Youll also be able to show off your game around the fediverse communities while the jams running and after it ends

More information can be found in the linked jam page as well as the button to hit to sign up

Hope you enjoy! :)

Team finder thread

view more: โ€น prev next โ€บ

Ategon

0 post score
0 comment score
joined 3 years ago
MODERATOR OF