comments, flow control

This commit is contained in:
2022-12-16 10:00:30 -05:00
parent 6db7d9edf7
commit 9a7a9558b5
5 changed files with 101 additions and 0 deletions

8
branches/Cargo.toml Normal file
View File

@ -0,0 +1,8 @@
[package]
name = "branches"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

20
branches/src/main.rs Normal file
View File

@ -0,0 +1,20 @@
fn main() {
let number = 3;
let b = if number < 5 { "duh" } else { "blwewew" };
println!("{number} {b}");
let mut x = 0.0;
let mut y = 0.0;
let q = 'outer: loop {
x += 0.1;
loop {
y += 0.1;
if y > 2.0 {
break 'outer y
}
println!("x: {}, y: {}", x, y);
}
};
println!("y: {q}");
println!((1..4))
}