Guest User

Untitled

a guest
Jul 22nd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. fn normalize(input: &str) -> String {
  2. let mut normal_input = input.chars().collect::<String>();
  3. normal_input.retain(|x| x.is_alphanumeric());
  4. normal_input.make_ascii_lowercase();
  5. normal_input
  6. }
  7.  
  8. fn find_square_dim(input: &str) -> (u16, u16) {
  9. let col = (input.len() as f64).sqrt() as u16 + 1_u16;
  10. let row = (input.len() as f64).sqrt() as u16;
  11. let tup = (col, row);
  12. tup
  13. }
  14.  
  15. fn build_square(input: &str, dims: (u16,u16)) -> String {
  16. let mut word_table: [String:dims.1] = ["", dims.1];
  17. let mut input_chars = input.chars();
  18. for code_char in input_chars {
  19.  
  20. }
  21. }
  22.  
  23.  
  24. fn main() {
  25. let test = "I am excited! Are you excited?";
  26. println!("{}", normalize(test));
  27. println!("{:?}", find_square_dim(test));
  28. }
Add Comment
Please, Sign In to add comment