SC‐Homework‐02 - TheEvergreenStateCollege/upper-division-cs-23-24 GitHub Wiki
Follow this Software Setup to get a working GitPod workspace on a school computer, or your own personal laptop.
This homework has three parts.
- Reading
- Rustlings
- Refactor Tic-Tac-Toe Solver
10 points per chapter.
Read and do the exercises in The Rust Interaction Book for the first four chapters:
- Rust Book: Chapter 05 - Using Structs to Structure Related Data
- Rust Book: Chapter 06 - Enums and Pattern Matching
- Rust Book: Chapter 07 - Managing Growing Projects with Packages, Crates, and Modules
Make sure to solve all quizzes 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 question.
See Paul to get checked off during a Monday afternoon lab.
3 points per exercise or quiz.
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 25 Rustlings exercises and 2 quizzes by typing into the files
07_structs
08_enums
09_strings
10_modules
11_hashmaps
12_options
13_error_handling
quiz1.rs
quiz2.rs
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 and you'll be checked off in-person.
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 question.
See Paul to get checked off during a Monday afternoon lab.
- 20 points for reading and leaving a question / comment in another team's pull request.
- 40 points for a first commit to a team pull request, including an update to the
README.md
file - 40 points for a second commit to a team pull request, including an update to the
README.md
file
Work on a tic-tac-toe solver prototype according to the chart below with your assigned partner, by taking turns committing and pushing to a common branch.
Examine the new file ranker.rs
and winning.rs
that has been added since our last lab.
You are allowed to copy and use these files if you wish in your solution, but you are not required to.
You are also asked to read one other team's prototype in the prototypes directory, their README.md file and their Rust code.
Leave a question for them in their pull request (it will already be closed and merged to main
already).
In each pair, we will label one partner as X
and one as O
, and we describe the two parts of this activity
below as "First Move", "Second Move", and every other move, until the prototype is complete and doesn't allow any human player to win any game.
This is an analogy to our git-tac-toe exercise. There's no expectation or relationship with which you side you choose in any actual games of tac-tac-toe that you play, or driver-navigator role that we play in lab.
* prototype-01
* X: @pswish
* O: @DawsonWhi
* prototype-02
* X: @AbyssalRemark
* O: @faulkdf
* prototype-03
* X: @MrTimmyJ
* O: @EvergreenSpock
* prototype-04
* X: ddnsc
* O: RyanGeiser
* prototype-05
* X: @de02E
* O: @ndeanon25
* prototype-06
* X: @emoleary
* O: @nathanMcl
* prototype-07
* X: Gavin-Bowers
* O: zimbabwe1
* prototype-08
* X: @pointmeatthesky
* O: @JonahEadieEvergreen
* prototype-09
* X: @whereismyprozac
* O: @CassidyW
* prototype-10
* X: @WinstonShine
* O: Thalia
* prototype-11
* X: @AkinaSS
* O: @kvothethm
If your GitHub username is not listed above, see or message Paul (@learner-long-life on Discord) or Winston (@WinstonShine on Discord)
in the #sos-24sp-sc
channel, or message on Canvas.
Partners should make an attempt to contact each other by Discord, email, or some other channel to decide who will make the first move.
If no response is received, each partner should follow the below steps to get started. Whichever partner completes it first should @mention their partner's GitHub name in the Pull Request description or comments and let them know they are responsible for the Second Move.
Both partners should will open up their gitpod workspace on main
branch, pull the latest changes, and change to their assigned
prototype directory (called prototype-xx
below, but substitute xx
with your assigned prototype up above).
git checkout main
git pull
cd <repo_dir>/sc-24sp/prototypes/prototype-xx
Read the README.md
file in that directory to understand its current status from the last pair that worked on it.
Try to build the project.
cargo build
Note any build errors, and add them to the README.md
file with a description of what you think is causing them.
Pick one file with errors. You are allowed to take one of the following two approaches in consensus with your partner:
- Design and code your own version of this and any other file, documenting your thought process in
README.md
- Copy (and optionally improve) the appropriate file from
prototype-00
in this pull request, documenting what you think the parts of the file do or are useful for, and any improvements, in theREADME.md
Try building the project again, possibly discovering new errors. You don't need to fix all errors in order to proceed to the next step.
- Follow the general form of our Git Workflow.
- Add, commit, and checkout a branch called
prototype-xx
wherexx
is your assigned prototype number.
Then push.
Since this is the First Move, create a new Pull Request by ctrl/cmd + clicking on the link in your terminal that results from pushing a new branch to the GitHub remote for the first time.
This is the only difference between the First and Second Move. The Second Move should skip this Step 5.
@mention your partner's GitHub username in your Pull Request description or comments and let them know your shared prototype is ready for their next move.
Second Move (and all Moves after the First Move): Pull a branch from your Partner's Existing PR, Fix Another File
Follow all the steps from the First Move, except Step 5, since you will be re-using the same Pull Request.
Alternate between Partner X and Partner O doing the steps above
- fixing files or making changes
- communicating in the Pull Request conversation, Discord, in person, or otherwise, with your partner how to proceed
- pushing to GitHub and then pulling your partner's changes
If all files are fixed and compile, then you should fill in code here in your ranker.rs
in order for your solver to actually play back against the human player, and stop forfeiting.
After Partner X and Partner O have both had a chance to each commit twice and document their changes in the README.md, you've completed this assignment.
See Paul with your Pull Request URL to get checked off during a Monday afternoon lab.