From 58a51a0da9495e207d6b1678772440bec985737d Mon Sep 17 00:00:00 2001 From: Marty Sluijtman Date: Thu, 21 Mar 2024 16:23:17 +0100 Subject: [PATCH] I totally didn't nick half of this from the guessing game example --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index d33c02a..a1863e4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,11 +9,11 @@ fn main() { , "Friet" , "Durum" ]; - let secret_num = rand::thread_rng().gen_range(0..foods.len()); + let rnd_num = rand::thread_rng().gen_range(0..foods.len()); let weekday = chrono::offset::Local::now().date_naive().weekday(); let output_string = match weekday { chrono::Weekday::Tue => "Friet", - _ => foods[secret_num] + _ => foods[rnd_num] }; println!("{}", output_string) }