SC‐Homework‐07 - TheEvergreenStateCollege/upper-division-cs-23-24 GitHub Wiki
(Total 101 points)
10 points per chapter.
Read and do the exercises in The Rust Interaction Book for these two chapters:
- Rust Book: Chapter 10 - Generic Types, Traits, and Lifetimes
- Rust Book: Chapter 11 - Writing Automated Tests
3 points per exercise.
In your GitPod workspace, change into the sc-24sp/rustlings
directory and run the command
rustlings watch
You can open another terminal and change to the same sc-24sp/rustlings
directory to run the command
rustlings hint <exercise_file_name>
as needed.
As shown in the screenshot below, complete the 7 Rustlings exercises by typing into the files
14_generics
15_traits
In GitPod, your files are autosaved as you type, and the rustlings watch
terminal will automatically recompile
and let you know whether your current exercise file is complete, or the compile error in the next file if you remove the
comment line // I AM NOT DONE
Do not add or commit your rustlings
work. The rustlings
directory is gitignore
'd.
Our main project for the remainder of the quarter will be implementing Conway's Game of Life, a cellular automata simulation and pixel art experience.
For this homework, read through the Rustwasm Book's tutorial including Chapters 1, 2, 3, and 4, up to Section 4.4, as shown in the screenshot below.

In your local copy of the class monorepo upper-division-cs
, create a personal assignments directory
cd <repo_dir>/sc-24sp/assignments/<your_github_usernames>
The following manual configuration steps are needed to do this lab in this GitPod environment, following the steps in wshine's dev diary.
You may need it on your local laptop as well. Note that the Rustwasm software relies on a very old version of Node (Node v14) which in turn relies on an older version of Python (3.10). You may choose to use GitPod for this lab for this reason.
- Source and install Node Version Manager as the
gitpod
user (it's important not to run this as root, as it's designed to be a single-user installation and not system-wide)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
- Install Node v14
. ${HOME}/.nvm/nvm.sh; nvm install v14
- Install
cargo-generate
as in the Rustwasm book
cargo install cargo-generate
- Webpack Dev Server Host Check
Add this to the end of your
webpack.config.js
devServer: {
compress: true,
disableHostCheck: true, // That solved it
}
Follow the instructions in the Rustwasm Book's setup, including running cargo generate
.
This part of the homework is complete when you can take a screenshot like the following, at the end of Section 4.4.
At the end of each work session, and for your homework submission, commit and push using our Git Workflow.
- 10 points for committing any code that makes progress towards Section 4.4 in the book listings
- 10 points for committing code that compiles
- 10 points for code that produces the web visualization above
Create a dev diary here if you don't have one first.
Add a dev diary entry with screenshots of your quizzes from the Rust Book after you pass them, and add markdown text explaining your answer to each quiz question.
Document any challenges or successes you experience as you complete the Rustwasm Game of Life above.