remove unneded dep and add kana to stdout
This commit is contained in:
parent
8e38dad6d0
commit
005da0d8c9
|
@ -6,7 +6,6 @@ edition = "2021"
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
dirs = "5.0.1"
|
|
||||||
gtk = { version = "0.8.1", package = "gtk4", features = ["v4_12"] }
|
gtk = { version = "0.8.1", package = "gtk4", features = ["v4_12"] }
|
||||||
|
|
||||||
rand = "0.8.5"
|
rand = "0.8.5"
|
||||||
|
|
|
@ -88,7 +88,7 @@ impl ObjectImpl for GuessingScene {
|
||||||
@strong answer_entry_binding as answer_entry,
|
@strong answer_entry_binding as answer_entry,
|
||||||
@strong stats_label_binding as stats_label => move |_entry: &Entry| {
|
@strong stats_label_binding as stats_label => move |_entry: &Entry| {
|
||||||
let answer: &String = &answer_entry.text().to_string();
|
let answer: &String = &answer_entry.text().to_string();
|
||||||
println!("{} <-> {}? = {}", answer, correct_answer.borrow().to_string(), *answer == correct_answer.borrow().to_string());
|
println!("{} <-> {}({})? = {}", answer, correct_answer.borrow().to_string(), question.borrow(), *answer == correct_answer.borrow().to_string());
|
||||||
*stats.borrow_mut() = if *answer == correct_answer.borrow().to_string() { (stats.borrow().0 + 1, stats.borrow().1) } else {(stats.borrow().0, stats.borrow().1 + 1)};
|
*stats.borrow_mut() = if *answer == correct_answer.borrow().to_string() { (stats.borrow().0 + 1, stats.borrow().1) } else {(stats.borrow().0, stats.borrow().1 + 1)};
|
||||||
stats_label.set_label(format!("Correct|Incorrect: {}|{} ({:.2}%)", stats.borrow().0, stats.borrow().1, 100.0 * f64::from(stats.borrow().0) / f64::from(stats.borrow().0 + stats.borrow().1)).as_str());
|
stats_label.set_label(format!("Correct|Incorrect: {}|{} ({:.2}%)", stats.borrow().0, stats.borrow().1, 100.0 * f64::from(stats.borrow().0) / f64::from(stats.borrow().0 + stats.borrow().1)).as_str());
|
||||||
*question.borrow_mut() = ask(ktr, rtk, hiragana, katakana);
|
*question.borrow_mut() = ask(ktr, rtk, hiragana, katakana);
|
||||||
|
|
Loading…
Reference in New Issue