Skip to content

Commit

Permalink
fix links to updated exercises, improve exercise e wording
Browse files Browse the repository at this point in the history
  • Loading branch information
CleanCut committed Jan 4, 2023
1 parent 3f95325 commit 15769d5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ For your convenience, here is a list of all the exercises, with links to view th

- [Exercise A - Variables & Scope](https://github.com/CleanCut/ultimate_rust_crash_course/tree/master/exercise/a_variables)
- [Exercise B - Functions](https://github.com/CleanCut/ultimate_rust_crash_course/tree/master/exercise/b_functions)
- [Exercise C - Simple Types](https://github.com/CleanCut/ultimate_rust_crash_course/tree/master/exercise/c_simple_types)
- [Exercise D - Control Flow & Strings](https://github.com/CleanCut/ultimate_rust_crash_course/tree/master/exercise/d_control_flow_strings)
- [Exercise E - Ownership & References](https://github.com/CleanCut/ultimate_rust_crash_course/tree/master/exercise/e_ownership_references)
- [Exercise F - Structs & Traits](https://github.com/CleanCut/ultimate_rust_crash_course/tree/master/exercise/f_structs_traits)
- [Exercise G - Collections & Enums](https://github.com/CleanCut/ultimate_rust_crash_course/tree/master/exercise/g_collections_enums)
- [Exercise H - Closures & Threads](https://github.com/CleanCut/ultimate_rust_crash_course/tree/master/exercise/h_closures_threads)
- [Exercise Z - Final Project](https://github.com/CleanCut/ultimate_rust_crash_course/tree/master/exercise/z_final_project)
- [Exercise C - Modules](https://github.com/CleanCut/ultimate_rust_crash_course/tree/master/exercise/c_modules)
- [Exercise D - Simple Types](https://github.com/CleanCut/ultimate_rust_crash_course/tree/master/exercise/d_simple_types)
- [Exercise E - Control Flow](https://github.com/CleanCut/ultimate_rust_crash_course/tree/master/exercise/e_control_flow)
- [Exercise ? - Ownership & References](https://github.com/CleanCut/ultimate_rust_crash_course/tree/master/exercise/)
- [Exercise ? - Structs & Traits](https://github.com/CleanCut/ultimate_rust_crash_course/tree/master/exercise/)
- [Exercise ? - Collections & Enums](https://github.com/CleanCut/ultimate_rust_crash_course/tree/master/exercise/)
- [Exercise Z - Image Manipulation](https://github.com/CleanCut/ultimate_rust_crash_course/tree/master/exercise/z_final_project)

# Projects

- [Invaders](https://github.com/CleanCut/invaders) - A terminal-based Space Invaders arcade game clone.
- TBD


[exercises]: https://github.com/CleanCut/ultimate_rust_crash_course#exercises
Expand Down
13 changes: 8 additions & 5 deletions exercise/e_control_flow/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,18 @@ fn main() {

println!("The sum is {}", sum);

// 3. Use a `while` loop to create a vector containing the first 12 multiples of 5.
// 3. Use a `while` loop to add 12 numbers to the `fives` vector.
//
// The loop should continue until `fives.len()` returns 12.
// The loop should continue while `fives.len()` is less than 12.
//
// Each time through the loop, call `fives.push( ... )` to push `current_five` onto the vector,
// and then add 5 to `current_five`.
// Each time through the loop:
// - Call `fives.push(number)` to push (a copy of) `number` onto the vector
// - Add 5 to `number`
//
// If you do this correctly, the vector will be [5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60]

let mut fives: Vec<i32> = vec![];
let mut current_five = 5;
let mut number = 5;

// (write the `while` loop here)

Expand Down

0 comments on commit 15769d5

Please sign in to comment.