SC‐Homework‐07 - TheEvergreenStateCollege/upper-division-cs-23-24 GitHub Wiki

Software Construction, Homework 07

(Total 101 points)

Part 1. Reading and Quizzes (20 points)

10 points per chapter.

Read and do the exercises in The Rust Interaction Book for these two chapters:

Part 2. Rustlings (21 points)

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

image

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.

Part 3. Rustwasm Game of Life (30 points)

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.

image

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>

Additional Setup

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.

  1. 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
  1. Install Node v14
  . ${HOME}/.nvm/nvm.sh; nvm install v14
  1. Install cargo-generate as in the Rustwasm book
cargo install cargo-generate
  1. 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.

image

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

Part 4. Dev Diary (40 points)

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.

⚠️ **GitHub.com Fallback** ⚠️