Feature parity with Haskell version
This commit is contained in:
parent
a6b357bfef
commit
7573836eba
3 changed files with 270 additions and 1 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue