This commit is contained in:
Nox Sluijtman 2025-02-21 00:25:33 +01:00
parent b4b6a958f3
commit f8eb855c15
Signed by: Egg
SSH key fingerprint: SHA256:2sG9X3C7Xvq2svGumz1/k7cm8l4G9+qAtAeugqB4J9M

View file

@ -1,19 +1,13 @@
use chrono::{offset::Local, Datelike, Weekday};
use rand::Rng;
use chrono::Datelike;
fn main() {
let foods = [ "Kapsalon"
, "Pizza"
, "Lasagne"
, "Nachos"
, "Friet"
, "Durum"
];
let rnd_num = rand::thread_rng().gen_range(0..foods.len());
let weekday = chrono::offset::Local::now().date_naive().weekday();
const FOODS: [&str; 6] = ["Kapsalon", "Pizza", "Lasagne", "Nachos", "Friet", "Durum"];
let rnd_num = rand::thread_rng().gen_range(0..FOODS.len());
let weekday = Local::now().date_naive().weekday();
let output_string = match weekday {
chrono::Weekday::Tue => "Friet",
_ => foods[rnd_num]
Weekday::Tue => "Friet",
_ => FOODS[rnd_num],
};
println!("{}", output_string)
}