Setting verse key by text

Add the ability to set a very key by text
Make the main.rs iterate random verses in John 3
This commit is contained in:
Greg Hellings
2025-02-25 00:06:12 -06:00
parent 0c3e46497c
commit 2a890a53cb
6 changed files with 109 additions and 2 deletions
+9 -1
View File
@@ -1,3 +1,4 @@
use rand::Rng;
use sword_rs::mgr::Mgr;
fn main() {
@@ -5,6 +6,13 @@ fn main() {
for mod_name in mgr.get_modules() {
let mut module = mgr.get_module(&mod_name);
println!("Module: {}", module.get_name());
println!("Text: {}", module.strip_text());
let random_number: i32 = rand::rng().gen_range(1..=20);
let random_number_str = format!("John.3.{}", random_number);
module.set_key_text(&random_number_str);
println!(
"Text John 3:{} is \"{}\"",
random_number,
module.strip_text()
);
}
}