fn main() {
    // var()
    // control_flow()

    let n = 45;
    let big = fib(n);
    println!("{}th fib: {}", n, big);
}

fn var() {
    let mut x = 5;
    println!("The value of x is: {}", x);
    x = 6;
    println!("The value of x is: {}", x);

    let tup: (i32, f64, u8) = (500, 6.4, 1);
    let (_, y, _) = tup;

fn control_flow() {
    let number = 3;

    if number < 5 {
        println!("condition was true");
    } else {
        println!("condition was false");
    }

    let a = [1, 2, 3, 4, 5];
    for e in a.iter() {
        println!("I'm looping {}", e)
    }

    for number in (1..4).rev() {
        println!("{}!", number)
    }
    println!("LIFTOFF!!!")
}

fn fib(n: u32) -> u32 {
    if n == 0 {
        1
    } else if n == 1 {
        1
    } else if n == 2 {
        2
    } else {
        fib(n - 1) + fib(n - 2)
    }
}
    println!("The value of y is: {}", y);
    println!("The value if x is: {}", tup.0);
}