codewars/
main.rs

1//use dialoguer::{theme::ColorfulTheme, Select};
2use l5kyu::fundamentals::*;
3use l6kyu::algorithms::*;
4use l6kyu::arrays::*;
5use l7kyu::fundamentals::*;
6use l7kyu::strings::*;
7use l8kyu::arrays::*;
8use l8kyu::fundamentals::*;
9use l8kyu::math::*;
10use l8kyu::strings::*;
11
12fn main() {
13    // let options = vec!["Option 1", "Option 2", "Option 3", "Option 4"];
14    // let selection = Select::with_theme(&ColorfulTheme::default())
15    //     .with_prompt("Select an option")
16    //     .default(0)
17    //     .items(&options)
18    //     .interact()
19    //     .unwrap();
20    // println!("You selected: {}", options[selection]);
21
22    println!("isLove {}", is_love(5, 7));
23    println!("the summation is {}", summation(8));
24    println!("square_sum is {}", square_sum(vec![5, 3, 4]));
25    println!(
26        "create_phone_number is {}",
27        create_phone_number(&[1, 2, 3, 4, 5, 6, 7, 8, 9, 0])
28    );
29    println!("boolean_to_string is {}", boolean_to_string(false));
30    println!("solution is {}", solution("abc", "bc"));
31    println!("{}", multi_table(5));
32    println!("Encipher 'ABCD' is '{}'", encipher("ABCD"));
33    println!("Decipher 'GBCE' is '{}'", decipher("GBCE"));
34    println!(
35        "Encipher_digital is '{:?}'",
36        digital_encipher("Scout".to_string(), 1939)
37    );
38    println!(
39        "crack is {:?}",
40        crack("86aa400b65433b608a9db30070ec60cd".to_string())
41    );
42    println!("Derive is {}", derive(7, 8));
43    println!("{}", code("Alan Turing"));
44    println!(
45        "Decode is {}",
46        decode("\x0bi A\n\x0bnTl\n\x0bgua\n\x0b\x0brn")
47    );
48    println!(
49        "Alternate case for 'Hello World' is '{}'",
50        to_alternating_case("Hello World")
51    );
52    println!(
53        "No spaces is {}",
54        no_space(String::from("8 j 8   mBliB8g  imjB8B8  jl  B"))
55    );
56    println!(
57        "Even is multiplied by 8 so 4 is {}",
58        simple_multiplication(4)
59    );
60    println!(
61        "Odd is multiplied by 9 so 5 is {}",
62        simple_multiplication(5)
63    );
64    println!("The decimal of hex a is {}", hex_to_dec("a"));
65    println!(
66        "first non consecutive is {:?}",
67        first_non_consecutive(&vec![1, 2, 3, 4, 6, 7, 8])
68    );
69    println!(
70        "Remove first and last char gives {}",
71        remove_char("eloquent")
72    );
73    println!(
74        "Merge array is {:?}",
75        merge_arrays(&[1, 2, 3, 4], &[5, 6, 7, 8])
76    );
77}