comments, flow control
This commit is contained in:
8
branches/Cargo.toml
Normal file
8
branches/Cargo.toml
Normal 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
20
branches/src/main.rs
Normal 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))
|
||||
}
|
Reference in New Issue
Block a user