Expand description
98-008: Intro to the Rust Programming Language
Iter Lab
The goal of this homework is to make sure you are comfortable with Rust’s Iterators and Closures.
This homework is more puzzle-oriented than the last few homeworks, where instead of implementing one relatively complicated thing, you will implement 6 somewhat-less-complicated things.
Since we’re halfway through the semester, we will be providing less guidance in this writeup. Remember, you just need to make the tests pass!
Since you know how to read tests now, we encourage you to read some of the tests before you start writing any code.
All tests are located in src/tests.rs
.
Part 1: Iterators
Click this hyperlink to go to the documentation for iterators
!
Part 2: Higher-Order Functions
Click this hyperlink to go to the documentation for hofs
!
Submission
Unix
If you are on a unix system, we will try to create a handin.zip
automatically for you,
but you will need to have zip
already installed.
If you do not have zip
installed on your system,
install zip
on your machine or use the CMU Linux SSH machines.
If you need help with this, please reach out to us!
Once you have zip
installed, we will create the handin.zip
automatically for you
(take a peek into build.rs
if you’re interested in how this works!).
Once you have the handin.zip
file, submit it to Gradescope.
Windows
If you are on a windows system, you can zip the src/
folder manually
and upload that to Gradescope.
Note that you don’t need to name it handin.zip
, you can name it whatever you’d like.
Collaboration
In general, feel free to discuss homeworks with other students! As long as you do not copy someone else’s work, any communication is fair game.
All formal questions should be asked on Piazza. Try to discuss on Piazza so that other students can see your questions and answers as well!
You can also discuss on Discord, but try to keep any technical questions on Piazza.
Feedback
We would like to reiterate that you should let us know if you spent anywhere in significant excess of an hour on this homework.
In addition, Rust has a notoriously steep learning curve, so if you find yourself not understanding the concepts, you should reach out to us and let us know as well — chances are, you’re not the only one!
Modules
- This module contains some functions that require higher-order functions to implement them.
- This module contains 4 iterators that you will implement!