Here's a simple Rust script that achieves what you've described using the rand crate for random selection:
use rand::seq::SliceRandom;
fn main() {
let names = vec!["Alice", "Bob", "Charlie", "David", "Emily", "Frank"];
let mut rng = rand::thread_rng();
let selected_name = names.choose(&mut rng).unwrap();
match selected_name.chars().next() {
Some('A') => println!("Congratulations, {}! You've been selected.", selected_name),
Some('B') => println!("Well done, {}! You're the chosen one.", selected_name),
Some('C') => println!("Hooray, {}! You're the lucky winner.", selected_name),
Some('D') => println!("Great job, {}! You're the winner today.", selected_name),
Some('E') => println!("Congratulations, {}! You're the lucky person.", selected_name),
Some('F') => println!("Fantastic, {}! You're the chosen one today.", selected_name),
_ => println!("Congratulations, {}! You've been selected.", selected_name),
}
}
This script selects a random name from the list and then uses a match statement to choose a congratulatory message based on the first letter of the selected name.