feat: couple more lessons

This commit is contained in:
2024-11-13 00:20:16 +01:00
parent 6ad0ec2fc9
commit d078910cbe
4 changed files with 62 additions and 2 deletions

17
src/functions.rs Normal file
View File

@@ -0,0 +1,17 @@
fn fizzbuzz(n: i32) {
for i in 1..=n {
if i % 15 == 0 {
println!("FizzBuzz");
} else if i % 5 == 0 {
println!("Buzz");
} else if i % 3 == 0 {
println!("Fizz");
} else {
println!("{i}");
}
}
}
pub fn functions_module() {
fizzbuzz(10);
}