Feature parity with Haskell version

This commit is contained in:
Nox Sluijtman 2024-03-21 11:41:47 +01:00
parent a6b357bfef
commit 7573836eba
3 changed files with 270 additions and 1 deletions

View file

@ -1,4 +1,5 @@
use rand::Rng;
use chrono::Datelike;
fn main() {
@ -10,5 +11,10 @@ fn main() {
, "Durum"
];
let secret_num = rand::thread_rng().gen_range(0..foods.len());
println!("{}", foods[secret_num])
let weekday = chrono::offset::Local::now().date_naive().weekday();
let output_string = match weekday {
chrono::Weekday::Tue => "Friet",
_ => foods[secret_num]
};
println!("{}", output_string)
}