This commit is contained in:
DavidOnTop 2024-12-10 08:29:25 +01:00
parent a9dc29cfad
commit d28b93267f
No known key found for this signature in database
GPG key ID: 5D05538A45D5149F
3 changed files with 13 additions and 25 deletions

View file

@ -46,7 +46,6 @@ pub mod u6;
pub mod u7; pub mod u7;
pub mod u8; pub mod u8;
pub mod u9; pub mod u9;
mod utils;
fn main() { fn main() {
let ulohy = vec![ let ulohy = vec![

View file

@ -1 +1,13 @@
pub fn main() {} pub fn main() {
let mut input = String::new();
println!("zadajte meno");
std::io::stdin().read_line(&mut input).unwrap();
let input = input.trim();
if !input.chars().all(|c| c.is_alphabetic()) {
println!("Nespravny vstup, zadajte len pismena");
panic!("Invalid input");
}
let mut input = input.to_lowercase();
input = input.chars().enumerate().map(|(i, c)| if i == 0 { c.to_uppercase().next().unwrap() } else { c }).collect();
println!("{}", input);
}

View file

@ -1,23 +0,0 @@
use turtle::Point;
pub struct Vec2 {
pub x: f64,
pub y: f64,
}
impl Vec2 {
pub fn new(x: f64, y: f64) -> Self {
Self { x, y }
}
pub fn from_points(p1: Point, p2: Point) -> Self {
Self {
x: p2.x - p1.x,
y: p2.y - p1.y,
}
}
pub fn size(&self) -> f64 {
(self.x.powi(2) + self.y.powi(2)).sqrt()
}
}