Giter Site home page Giter Site logo

rust-lang / rustlings Goto Github PK

View Code? Open in Web Editor NEW
49.2K 316.0 9.3K 3.2 MB

:crab: Small exercises to get you used to reading and writing Rust code!

Home Page: https://rustlings.cool

License: MIT License

Rust 93.77% Shell 2.82% PowerShell 1.84% Nix 1.58%
rust rustlings beginner-friendly

rustlings's Introduction

rustlings ๐Ÿฆ€โค๏ธ

Greetings and welcome to rustlings. This project contains small exercises to get you used to reading and writing Rust code. This includes reading and responding to compiler messages!

Alternatively, for a first-time Rust learner, there are several other resources:

  • The Book - The most comprehensive resource for learning Rust, but a bit theoretical sometimes. You will be using this along with Rustlings!
  • Rust By Example - Learn Rust by solving little exercises! It's almost like rustlings, but online

Getting Started

Note: If you're on MacOS, make sure you've installed Xcode and its developer tools by typing xcode-select --install. Note: If you're on Linux, make sure you've installed gcc. Deb: sudo apt install gcc. Yum: sudo yum -y install gcc.

You will need to have Rust installed. You can get it by visiting https://rustup.rs. This'll also install Cargo, Rust's package/project manager.

MacOS/Linux

Just run:

curl -L https://raw.githubusercontent.com/rust-lang/rustlings/main/install.sh | bash

Or if you want it to be installed to a different path:

curl -L https://raw.githubusercontent.com/rust-lang/rustlings/main/install.sh | bash -s mypath/

This will install Rustlings and give you access to the rustlings command. Run it to get started!

Nix

Basically: Clone the repository at the latest tag, finally run nix develop or nix-shell.

# find out the latest version at https://github.com/rust-lang/rustlings/releases/latest (on edit 5.6.1)
git clone -b 5.6.1 --depth 1 https://github.com/rust-lang/rustlings
cd rustlings
# if nix version > 2.3
nix develop
# if nix version <= 2.3
nix-shell

Windows

In PowerShell (Run as Administrator), set ExecutionPolicy to RemoteSigned:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Then, you can run:

Start-BitsTransfer -Source https://raw.githubusercontent.com/rust-lang/rustlings/main/install.ps1 -Destination $env:TMP/install_rustlings.ps1; Unblock-File $env:TMP/install_rustlings.ps1; Invoke-Expression $env:TMP/install_rustlings.ps1

To install Rustlings. Same as on MacOS/Linux, you will have access to the rustlings command after it. Keep in mind that this works best in PowerShell, and any other terminals may give you errors.

If you get a permission denied message, you might have to exclude the directory where you cloned Rustlings in your antivirus.

Browser

Open in Gitpod

Open Rustlings On Codespaces

Manually

Basically: Clone the repository at the latest tag, run cargo install --path ..

# find out the latest version at https://github.com/rust-lang/rustlings/releases/latest (on edit 5.6.1)
git clone -b 5.6.1 --depth 1 https://github.com/rust-lang/rustlings
cd rustlings
cargo install --force --path .

If there are installation errors, ensure that your toolchain is up to date. For the latest, run:

rustup update

Then, same as above, run rustlings to get started.

Doing exercises

The exercises are sorted by topic and can be found in the subdirectory rustlings/exercises/<topic>. For every topic there is an additional README file with some resources to get you started on the topic. We really recommend that you have a look at them before you start.

The task is simple. Most exercises contain an error that keeps them from compiling, and it's up to you to fix it! Some exercises are also run as tests, but rustlings handles them all the same. To run the exercises in the recommended order, execute:

rustlings watch

This will try to verify the completion of every exercise in a predetermined order (what we think is best for newcomers). It will also rerun automatically every time you change a file in the exercises/ directory. If you want to only run it once, you can use:

rustlings verify

This will do the same as watch, but it'll quit after running.

In case you want to go by your own order, or want to only verify a single exercise, you can run:

rustlings run myExercise1

Or simply use the following command to run the next unsolved exercise in the course:

rustlings run next

In case you get stuck, you can run the following command to get a hint for your exercise:

rustlings hint myExercise1

You can also get the hint for the next unsolved exercise with the following command:

rustlings hint next

To check your progress, you can run the following command:

rustlings list

Testing yourself

After every couple of sections, there will be a quiz that'll test your knowledge on a bunch of sections at once. These quizzes are found in exercises/quizN.rs.

Enabling rust-analyzer

Run the command rustlings lsp which will generate a rust-project.json at the root of the project, this allows rust-analyzer to parse each exercise.

Continuing On

Once you've completed Rustlings, put your new knowledge to good use! Continue practicing your Rust skills by building your own projects, contributing to Rustlings, or finding other open-source projects to contribute to.

Uninstalling Rustlings

If you want to remove Rustlings from your system, there are two steps. First, you'll need to remove the exercises folder that the install script created for you:

rm -rf rustlings # or your custom folder name, if you chose and or renamed it

Second, run cargo uninstall to remove the rustlings binary:

cargo uninstall rustlings

Now you should be done!

Contributing

See CONTRIBUTING.md.

Contributors โœจ

Thanks goes to the wonderful people listed in AUTHORS.md ๐ŸŽ‰

rustlings's People

Contributors

abagshaw avatar abdouseck avatar alexxroche avatar allcontributors[bot] avatar apogeeoak avatar bors avatar carols10cents avatar cjpearce avatar danwilhelm avatar delet0r avatar eddyp avatar eroullit avatar exdx avatar hpwxf avatar jrvidal avatar kolbma avatar komaeda avatar magnusrodseth avatar mo8it avatar nidhalmessaoudi avatar nkanderson avatar ryanpcmcquen avatar sanjaykdragon avatar seeplusplus avatar seporterfield avatar shadows-withal avatar sjmann avatar tlyu avatar tostapunk avatar zerotask avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rustlings's Issues

Turn Jake's translations of Ruben's ADT exercises into rustlings exercises

Turn steveklabnik's LazyValue into an exercise

https://twitter.com/steveklabnik/status/694918807832391680
https://play.rust-lang.org/?gist=1612d02b48811005d9d0&version=stable

struct LazyValue {
    c: Box<Fn() -> i32>,
    v: Option<i32>, 
}

impl LazyValue {
    fn new(c: Box<Fn() -> i32>) -> LazyValue {
        LazyValue {
            c: c,
            v: None,
        }
    }
    fn value(&mut self) -> i32 {
        match self.v {
            Some(v) => v,
            None => {
                let v = (self.c)();
                self.v = Some(v);
                v
            },
        }
    }
}

fn main() {
    let f: Box<Fn() -> i32> = Box::new(|| {
        println!("closure called!");

        5
    });
    let mut v = LazyValue::new(f);

    println!("value: {}", v.value());
    println!("value: {}", v.value());
    println!("value: {}", v.value());
    println!("value: {}", v.value());
}

Factorial exercise

I think a factorial exercise would help people learn about Ranges and .fold(). As an example solution:

fn factorial(num: u64) -> u64 {
    (1..num + 1).fold(1, |prod, x| prod * x)
}

Exercises for using common standard library types

For example, Result:

// Make this test pass!

#[derive(PartialEq)]
struct PositiveNonzeroInteger(u64);

#[derive(PartialEq)]
enum CreationError {
    Negative,
    Zero,
}

impl PositiveNonzeroInteger {
    fn new(value: i64) -> Result<PositiveNonzeroInteger, CreationError> {
        Ok(PositiveNonzeroInteger(value as u64))
    }
}

#[test]
fn test_creation() {
    assert!(PositiveNonzeroInteger::new(10).is_ok());
    assert!(PositiveNonzeroInteger::new(-10) == Err(CreationError::Negative));
    assert!(PositiveNonzeroInteger::new(0) == Err(CreationError::Zero));
}

Cargo configuration for easy local running

Currently there is no Cargo.toml for the project, which blocks a possibility to open it locally in an IDE.

Besides that would be very nice to have Cargo to run separate examples independently from each other.

I achieved that with placing all examples to $root/examples. That way Cargo auto-generates running targets like cargo run --example ex1. The problem with that approach was that I wasn't able to tell Cargo to look inside subfolders like $root/examples/variables/

Get inspiration from koans

http://www.rubykoans.com/

There's something that isn't quite what I'm going for about koans, maybe that it's really contrived, maybe that the last time i tried them it... started too early? moved at a weird pace-- hitting really simple stuff but then moving on immediately?

Or maybe I just gave up on the koans too early?

I think I'm going for lots of similar-but-slightly-different exercises/situations. Like repeat one concept over and over until you get it, then move on to the next thing. Maybe.

Wording ambiguous - what should be changed?

Greetings, to me, the wording of several exercises is ambiguous, for example in result1.rs:

Make this test pass!

Until looking at the hints, I was not sure if I should modify the code or the test in order to make it pass.

This is true for a few other exercises which are two-part (eg. main + a function or main + a macro or main + a test) as well (make it compile!). Which part should stay unchanged and what can be changed to make it work?

In a few exercises, this is made clear, but in others it is ambiguous.

Greetings

More exercises on Primitives

Hi there,

The Primitives section has only a couple of exercises, and I think we could add a couple more. Here's a few suggestions:

fn main() {
    let a = // Create an array with 100 elements in it

    if a.len() >= 100 {
        println!("Wow, that's a big array!");
    } else {
        println!("Meh, I eat arrays like that for breakfast.");
    }
}
fn main() {
    let a = [1, 2, 3, 4, 5];

    let three_and_four = // Your slice here

    if three_and_four == [3, 4] {
        println!("Nice slice!");
    } else {
        println!("Not quite what I was expecting...");
    }
}
fn main() {
    let cat = ("Furry McFurson", 3.5);
    let /* your pattern here */ = cat;

    println!("{} is {} years old.", name, age);
}
fn main() {
    let numbers = (1, 2, 3);
    println!("The second number is {}", /* Use a tuple index to access the sec
ond element of numbers */);
}

I'd love to know what you think about these. Thanks!

OPEN THREAD: Exercises that need more hints

I'm going to leave this issue open basically forever, please feel free to comment here if there was an exercise that could use more of a hint than what was there (if there were hints).

Please specify which exercise it is you're discussing, and if you have any ideas about what would make for a better hint, please let me know!

Line number is wrong in hint of exercise #1, Move Semantics

The line number is stated as 8 as to where the error occurs. The actual line is 10. I don't know if the line number is relative to the start of the function or expressed based on actual line numbering. Either case, the line numbering in the hint needs to be clearified or corrected.

More information on running tests

When I got to the "tests" section, I wasn't sure how I was supposed to run them. Every other program, I could run rustc name.rs, but that doesn't work here. The link to the Rust Programming Language talks about making a new cargo project - is that what I am supposed to do? It seems like some more information on setting this up would be helpful. I think directions should be included (perhaps as a hint in tests1.rs)

Add Filename to source code

I really like the interactive session that I can get to from the main page, but I often forget which one I am working on. Having its name in the code would be convenient. I wouldn't mind pushing a change if you agree that this would be a good idea.

rustlings 2.0

Hello! There's been talks about taking this project in a new direction, and I'm excited to say that we have initial plans to move things forward.

A big inspiration for how to make a curriculum that is self-guided, but held together by a single thread is RubyKoans, which provides you with a .zip file containing a bunch of test-driven exercises that introduce you to basic Ruby syntax and concepts. It'd be nice if Rustlings could function the same way, ideally this would be the optimal workflow:

  1. Install Rust
  2. Download the exercises
  3. Everything else should be explained within the thing you download

This would make the project accessible to a lot more people, by making everything self-contained and available offline. Another goal should be to define a formal curriculum. Fortunately, we can probably take inspiration from Rust by Example and other similar projects that already exist, so I don't think this'll be that much of a problem.

Finally, I want to make this a cool project to contribute to! Let's work together to make this possible โญ

There's some things we can do right now:

  • Go through the existing list of issues and sort out the ones that are irrelevant right now or will be irrelevant in the future
  • Introduce some consistent branding
  • Find more people! There's an IRC channel now: #rustlings on Mozilla IRC
  • Lay out plans for a website and update documentation to reflect the new approach
  • Figure out a new curriculum

(roughly sorted in order of important/priority)

If anyone has any suggestions, or wants to contribute or help out, please throw it at me in this issue!

Link to join IRC: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=#rustlings

Open Exercise Links in New Tab

I ran threw some exercises in my spare time, in chrome. The links don't open in a new tab, so maybe replacing them with HTML instead of pure markdown may be a good option so the resource can stay open.

Example:
<a href="http://example.com" target="_blank">http://example.com</a> = http://example.com

I can submit a PR if this gets "approved" by a maintainer ๐Ÿ˜„.

if1.rs silently succeeds

The if1.rs rustling does not provide any feedback that you succeeded when you correctly implemented a solution.

Even though I understood why, it was a bit jarring to not seeing any form of output. Maybe especially so because I worked on if1.rs right after the test rustlings which give nice confirmation of their success and failure.

There are a few options to change the behavior of if1.rs if the current behaviour is deemed problematic. The ones I could think of are listed below.

  1. Make if1.rs a test. pro: This provides instant standardized feedback for both correct and incorrect implementations. con: It could muddle the lesson about `if.
  2. print some output. pro: user has confirmation if they are correct. con: It also could muddle the lesson about if.

I am willing an able to make changes to if1.rs and send a pull request for any improvements that are suggested. I am just opening this issue to discuss if it is a problem at all, and if it is a problem how to improve if1.rs.

Tests?

Could have tests that these fail with the intended error messages....?

Exercise for shared mutability between threads

Something like this, maybe:

// Make this compile!

use std::sync::Arc;
use std::thread;

struct JobStatus {
    jobs_completed: u32,
}

fn main() {
    let status = Arc::new(JobStatus { jobs_completed: 0 });
    let status_shared = status.clone();
    thread::spawn(move || {
        for _ in 0..10 {
            thread::sleep_ms(500);
            status_shared.jobs_completed += 1;
        }
    });
    while status.jobs_completed < 10 {
        println!("waiting...");
        thread::sleep_ms(1000);
    }
}

strings2 output is a bit misleading

I got the correct answer, and the program compiled - but the output of the program said:

Nope, that's not it.

Which led me to spend 10 minutes trying to figure out what I'd got wrong - before realising that this was the correct result!

Slices and ownership

Maybe a variation on this? http://is.gd/gdmetO

fn main() {
    let paths = vec!["foo", "bar", "baz"];
    let first_match = paths.iter().map(|path| {
        let mut absolute_path = std::env::current_dir().unwrap();
        absolute_path.push(path);
        absolute_path.as_path().to_str().unwrap()
    }).filter(|path| {
        path.starts_with("/")
    }).nth(0);

    println!("{:?}", first_match);
}

Exercise for tuple structs

Specifically, this shows how to access/manipulate fields in tuple structs while requiring learners to fix privacy violations on said fields.

// Make this compile!

mod logging {
    pub struct Event(u64, String);

    const BaseEventId: u64 = 1000;
    pub fn create_event(id: u64) -> Event {
        Event(id + BaseEventId, "".to_owned())
    }
}

fn main() {
    let mut event = logging::create_event(13);
    event.1 = "Launched spaceship".to_owned();
    println!("{}", event.0);
}

Code Audit

I did a quit audit of the rustling sources. This is also connected to #80. Generally the examples are looking pretty good/ up to date. Following is a more in-depth breakdown.

  • error_handling โ€“ all good
  • functions โ€“ good, maybe could use more complex examples (see below)
  • if โ€“ ๐Ÿคทโ€โ™€๏ธ It's if
  • macros โ€“ also good, but maybe some more complex examples could help
  • modules โ€“ one of the examples is okay, the other involves references to US politics that are both very western specific and will at some point also be woefully outdated.

Move semantics

  • move_semantics1.rs โ€“ This isn't a very great example in my opinion. Ownership of the vector is given to a function but the compilation error isn't actually about ownership but mutability. This is confusing and I don't think beginners would learn very much from it
  • move_semantics2.rs โ€“ This should be the first example (or slightly simplified)
  • move_semantics3.rs โ€“ Also not a great example, as it's a mutability issue in a function. Also, this issue was already solved in the first example.
  • move_semantics4.rs โ€“ This is okay

Moving on...

  • primitive_types โ€“ These are all good ๐Ÿ‘
  • standard_library_types โ€“ These are generally good. I think arc might be a bit hard, so maybe we can tweak it. The iterator examples are good, although maybe we want to add more. And rename the files to have sensible numbers?
  • strings โ€“ Nice examples ๐Ÿ‘
  • threads โ€“ It's a nice example but maybe a few more could be good
  • variables โ€“ All good ๐Ÿ‘

All in all there should be some work done but most of the examples are looking pretty good ๐Ÿ‘

Things that are missing/ might want to be added

These are more advanced concepts but it might still be nice for people to learn about them in a rustling kind-of fashion.

  • Some functions using impl Trait
  • Generic functions with ...<T>
  • An example with traits

Add jleedev's try!, From, and Error exercise

https://twitter.com/jleedev/status/694549253604184067
https://play.rust-lang.org/?gist=458a30c1943710f9f0a8&version=stable

// Make this compile! Scroll down for hints :)

use std::error;
use std::fmt;
use std::io;

// So many things could go wrong!
//
// Reading from stdin could produce an io::Error
// Parsing the input could produce a num::ParseIntError
// Validating the input could produce a CreationError
//
// How can we lump these errors into one general error?

fn read_and_validate(b: &mut io::BufRead) -> Result<PositiveNonzeroInteger, ???> {
    let mut line = String::new();
    b.read_line(&mut line);
    let num: i64 = line.parse();
    PositiveNonzeroInteger::new(num)
}

/*
fn read_and_validate(b: &mut io::BufRead) -> Result<PositiveNonzeroInteger, Box<error::Error>> {
    let mut line = String::new();
    try!(b.read_line(&mut line));
    let num: i64 = try!(line.trim().parse());
    let result = try!(PositiveNonzeroInteger::new(num));
    Ok(result)
}
*/

fn test_with_str(s: &str) -> Result<PositiveNonzeroInteger, Box<error::Error>> {
    let mut b = io::BufReader::new(s.as_bytes());
    read_and_validate(&mut b)
}

#[test]
fn test_success() {
    let x = test_with_str("42\n");
    assert!(x.is_ok());
    assert_eq!(PositiveNonzeroInteger(42), x.unwrap());
}

#[test]
fn test_not_num() {
    let x = test_with_str("eleven billion\n");
    assert!(x.is_err());
}

#[test]
fn test_non_positive() {
    let x = test_with_str("-40\n");
    assert!(x.is_err());
}

#[test]
fn test_ioerror() {
    struct Broken;
    impl io::Read for Broken {
        fn read(&mut self, _buf: &mut [u8]) -> io::Result<usize> {
            Err(io::Error::new(io::ErrorKind::BrokenPipe, "uh-oh!"))
        }
    }
    let mut b = io::BufReader::new(Broken);
    assert!(read_and_validate(&mut b).is_err());
}

// Sprinkle the try! macro around any Result<> values,
// which under the hood calls From::from
// on the error value to convert it to a
// boxed trait object, a Box<error::Error>,
// which is polymorphic.

#[derive(PartialEq,Debug)]
struct PositiveNonzeroInteger(u64);

#[derive(PartialEq,Debug)]
enum CreationError {
    Negative,
    Zero,
}

impl fmt::Display for CreationError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str((self as &error::Error).description())
    }
}

impl error::Error for CreationError {
    fn description(&self) -> &str {
        match *self {
            CreationError::Negative => "Negative",
            CreationError::Zero => "Zero",
        }
    }
}

impl PositiveNonzeroInteger {
    fn new(value: i64) -> Result<PositiveNonzeroInteger, CreationError> {
        if value == 0 {
            Err(CreationError::Zero)
        } else if value < 0 {
            Err(CreationError::Negative)
        } else {
            Ok(PositiveNonzeroInteger(value as u64))
        }
    }
}

#[test]
fn test_creation() {
    assert!(PositiveNonzeroInteger::new(10).is_ok());
    assert_eq!(Err(CreationError::Negative), PositiveNonzeroInteger::new(-10));
    assert_eq!(Err(CreationError::Zero), PositiveNonzeroInteger::new(0));
}

Rust Playground can not run the code

Rust Playground compiles, but does not run examples!

To reproduce:

  1. I follow a link like https://play.rust-lang.org/?code=%2F%2F+Make+me+compile%21+Scroll+down+for+hints+%3A%29%0A%0Afn+main%28%29+%7B%0A++++x+%3D+5%3B%0A++++println%21%28%22x+has+the+value+%7B%7D%22%2C+x%29%3B%0A%7D%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%2F%2F+Hint%3A+The+declaration+on+line+4+is+missing+a+keyword+that+is+needed+in+Rust%0A%2F%2F+to+create+a+new+variable+binding.%0A

  2. Compiler works and tells you to fix an issue

  3. Fix the example

  4. Hit "RUN"

  5. error 101:

thread '<main>' panicked at 'called Option::unwrap()on aNone value', ../src/libcore/option.rs:367 playpen: application terminated with error code 101

Environment:
Mac OS X, Google Chrome

OPEN THREAD: Exercises that you liked

I'm going to leave this issue open basically forever, please feel free to comment here if there were any exercises that you particularly liked! I'd love to know which ones are most useful to people so that i can make more exercises like those :)

Please specify which exercise you liked and any reasons you liked those better than others! โค๏ธ

Exercises involving derive

Ugh i don't really want it to just be "oh this is missing a #[derive(whatever)]", but I do want the usage of derives to be introduced somehow.... hmmmm...

Exercise for shared ownership between threads

Something like this, perhaps?

// Make this compile!

use std::rc::Rc;
use std::thread;

struct Temperature {
    degrees_in_celsius: i32,
}

fn main() {
    let temperature = Rc::new(Temperature { degrees_in_celsius: 20 });
    let temperature_shared = temperature.clone();
    thread::spawn(move || {
        println!("{:?} degrees farenheit", temperature_shared.degrees_in_celsius as f32 * 33.8);
    });
    println!("{:?} degrees celsius", temperature.degrees_in_celsius);
}

Exercise for closure ownership

Something like this, which yields an error message which explicitly calls out a possible solution:

// Make this compile!

use std::thread;

struct SpaceshipPart {
    weight: f32,
}

fn main() {
    let parts = vec!(SpaceshipPart { weight: 5.5 }, SpaceshipPart { weight: 0.9 });
    let num_parts = parts.len();
    thread::spawn(|| {
        for part in &parts {
            println!("part weighs: {}", part.weight);
        }
    });
    println!("handed off {} parts to another thread", num_parts);
}

OPEN THREAD: Exercises that you didn't like

I'm going to leave this issue open basically forever, please feel free to leave a comment if you find any particular exercises to be:

  • too confusing
  • too frustrating
  • not useful for learning
  • otherwise don't fit your expectations

Please include which exercise you're discussing and explain as best you can what you didn't like about it :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.