The bots not whitelisted in this community but heres your reminder from me instead
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
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
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
Change has been pushed

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()));
}
[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);
}
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
I believe the limit is 1MB on all instances by default so should be what our current limit is as well
Bot seems to be struggling after the upgrade to v18. Hopefully comes back up soon
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
Ategon
0 post score0 comment score
There will be another poll in around 6 months