Hello world! 👽
Something about me 🚀
struct Myself {
name: String,
objectives: String,
motivation_level: String
}
mod beautify {
pub enum Frame {X(usize), Y}
pub fn print_beautifuly(longest_line: usize, string_list: &[String]) {
for line in string_list {
print_fancy_border(Frame::Y); print!("{}{}", line, {
if line.chars().count() != longest_line {" ".repeat(longest_line - line.chars().count())} else {String::from("")}
}); print_fancy_border(Frame::Y); println!();
}
}
pub fn check_longest(string_list: &[String]) -> usize {
let mut longest: usize = 0;
for line in string_list {
if longest < line.chars().count() {
longest = line.chars().count();
}
}
longest + 1
}
pub fn print_fancy_border(position: Frame) {
match position {
Frame::X(max_repeat) => {print!(" {}", {"-".repeat(max_repeat)});},
Frame::Y => {print!("|");}
}
}
}
fn main() {
// Define my name
let name: String = String::from("ItsTheGuy");
// Define my objectives
let objectives: String = String::from("I want to contribute to make this world a better place.");
// Define my motivation
let motivation_level: String = String::from("∞");
// Define myself
let myself: &Myself = &Myself{name, objectives, motivation_level};
// Show on screen
{
let to_display = [
{String::from(format!(" Hey! My name is {}.", {&myself.name}))},
{String::from(format!(" {}", &myself.objectives))},
{String::from(format!(" My motivation level is {}.", {&myself.motivation_level}))}
];
let line_long: usize = {beautify::check_longest(&to_display)};
println!(); beautify::print_fancy_border(beautify::Frame::X(line_long)); println!();
beautify::print_beautifuly(line_long, &to_display);
beautify::print_fancy_border(beautify::Frame::X(line_long)); println!();
}
}What languages I speak? 👨💻
- Native speaker In Python
🥷 - A little bit of Swift
🦉 - I defend myself in C, C++ and Rust, but I'm not a good speaker in those languages
😂
What I want to learn? 🙇♂️
- A little bit of Golang
💨

