Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::env;
- fn main() {
- let args: Vec<_> = env::args().collect();
- for w in args {
- for c in w.to_lowercase().chars() {
- if let Some(t) = map(c) {
- print!("{}", t);
- } else {
- print!("{}", c);
- }
- }
- print!(" ");
- }
- println!();
- }
- fn map(c: char) -> Option<&'static str> {
- match c {
- 'а' => Some(":lla:"),
- 'б' => Some(":llb:"),
- 'в' => Some(":llv:"),
- 'г' => Some(":llg:"),
- 'д' => Some(":lld:"),
- 'е' => Some(":lle:"),
- 'ё' => Some(":llyo:"),
- 'ж' => Some(":llzz:"),
- 'з' => Some(":llz:"),
- 'и' => Some(":lli:"),
- 'й' => Some(":llii:"),
- 'к' => Some(":llk:"),
- 'л' => Some(":lll:"),
- 'м' => Some(":llm:"),
- 'н' => Some(":lln:"),
- 'о' => Some(":llo:"),
- 'п' => Some(":llp:"),
- 'р' => Some(":llr:"),
- 'с' => Some(":lls:"),
- 'т' => Some(":llt:"),
- 'у' => Some(":llu:"),
- 'ф' => Some(":llf:"),
- 'х' => Some(":llh:"),
- 'ц' => Some(":llc:"),
- 'ч' => Some(":llch:"),
- 'ш' => Some(":llsh:"),
- 'щ' => Some(":llssh:"),
- 'ъ' => Some(":llis:"),
- 'ы' => Some(":lliii:"),
- 'ь' => Some(":llik:"),
- 'э' => Some(":llee:"),
- 'ю' => Some(":lluu:"),
- 'я' => Some(":llya:"),
- '0' => Some(":ll:"),
- '1' => Some(":ll1:"),
- '2' => Some(":ll2:"),
- '3' => Some(":ll3:"),
- '4' => Some(":ll4:"),
- '5' => Some(":ll5:"),
- '6' => Some(":ll6:"),
- '7' => Some(":ll7:"),
- '8' => Some(":ll8:"),
- '9' => Some(":ll9:"),
- ',' => Some(":llcomma:"),
- '.' => Some(":lldot:"),
- '!' => Some(":llatt:"),
- '?' => Some(":llques:"),
- _ => None
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement