some formatting
This commit is contained in:
parent
d65978c891
commit
a42744434d
|
@ -5,6 +5,7 @@ pub enum Kanas {
|
||||||
Hiragana,
|
Hiragana,
|
||||||
Katakana
|
Katakana
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Hieroglyph {syllable: String, row: usize, column: usize}
|
pub struct Hieroglyph {syllable: String, row: usize, column: usize}
|
||||||
|
|
||||||
impl std::fmt::Display for Hieroglyph {
|
impl std::fmt::Display for Hieroglyph {
|
||||||
|
@ -85,13 +86,12 @@ pub fn generate_random_hieroglyph(k: Kanas) -> Hieroglyph {
|
||||||
let row: usize = rand::thread_rng().gen_range(0..ROMAJI.len()-1);
|
let row: usize = rand::thread_rng().gen_range(0..ROMAJI.len()-1);
|
||||||
let column: usize = rand::thread_rng().gen_range(0..ROMAJI[0].len()-1);
|
let column: usize = rand::thread_rng().gen_range(0..ROMAJI[0].len()-1);
|
||||||
|
|
||||||
let generated: String = {
|
let generated: String = match k {
|
||||||
match k {
|
|
||||||
Kanas::Romaji => ROMAJI[row][column].to_string(),
|
Kanas::Romaji => ROMAJI[row][column].to_string(),
|
||||||
Kanas::Hiragana => HIRAGANA[row][column].to_string(),
|
Kanas::Hiragana => HIRAGANA[row][column].to_string(),
|
||||||
Kanas::Katakana => KATAKANA[row][column].to_string()
|
Kanas::Katakana => KATAKANA[row][column].to_string()
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if generated == "0" {
|
if generated == "0" {
|
||||||
return generate_random_hieroglyph(k);
|
return generate_random_hieroglyph(k);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue