Professional Documents
Culture Documents
0. Introduction
This document endeavours to get you up-to-speed on the basic tools necessary
to succeed in CS51. These will be useful throughout the class, so we recommend
you download or bookmark this for future reference!
GitHub Classroom is the platform CS51 uses to distribute problem sets. We also
expect students to version control their code using git and GitHub.
1.1. Accessing the distribution code. Each problem set specification, downloaded
from Canvas under Assignments, contains a link to the git repository for that
10 problem set. To download all of the materials for a problem set, all you need to do
is click on this link to the repository and on the right of the page above the problem
set files, you should see a Clone or Download option. Click on this option and
copy the https link to your clipboard. Open your terminal and navigate to the
folder where you want your problem set to be saved. Once there, execute:
15 $ git clone [URL from your clipboard] X
This will download the starter code for Problem Set X in a folder named X.
1.2. Working with a partner. On partner problem sets, one member of your pair
should follow the link on the problem set specification. After clicking this link
there is a Create team option. Once you enter a name for your team and submit it,
20 your partner can follow the link on the problem set specification and choose that
team.
If you want to work solo on a partner problem set, create a team for yourself.
1.3. Using git. Git is a version-control system that allows you to keep track of
your changes.
25 To keep track of your code, commit all your changes and push them to the git
repository by running git commit -am "commit message here" followed
by git push from the directory your files are in. Pushing your code to git is not
the same as submitting it for grading (see Using Gradescope section) but it is good
practice as it allows you to revert to earlier versions of your code and collaborate
30 more easily with your partner.
1
2 CS51 REFERENCE
If you want a succinct reference for your git usage, see Eddie Kohlers great
guide to Git, as well as TF Brian Yus video about git for CS 51.
In Problem Set 1, we provide a Makefile that allows you to compile your code
without directly calling ocamlbuild, the compiler that takes your .ml files and 35
mapfold: mapfold.ml
ocamlbuild mapfold.byte
expression: expression.ml
ocamlbuild expression.byte
Above, we see a Makefile with three targets:
all (called with make all or just make) compiles mapfold and expres-
sion, by listing mapfold and expression as dependencies.
mapfold (called with make mapfold) compiles only mapfold.ml. 45
So, for example, you might have noticed that compilation produces a _build
folder and some annoying .byte files in your directory, which can be pesky to
manually delete. As such, you might want to consider including a make clean
target in your Makefile, which upon execution will automatically rm files you dont
need. You might also want to consider writing targets for your testing files, so you 55
3. Using Gradescope
60 Gradescope is the platform CS51 uses to grade problem sets and labs.
3.1. Submitting problem sets. In order to submit your problem set, log into
Gradescope and navigate to the Assignments tab on the side bar. From there you
should be able to access the relevant problem set and upload your .ml files. The
final submission before the problem set deadline will be graded. When problem
65 set grades are released you will be able to see your grade under the Assignments
tab on Gradescope.
Before submitting, please ensure your code compiles by running make while
in the main directory. Also be sure that any tests you have written run without
raising exceptions.
70 Evaluating definitions in the toplevel, while useful during development, does
not guarantee the code will compile. Submissions, or parts of submissions, that do
not compile will receive no credit!
3.2. Submitting labs. Labs are graded on participation and should be submitted
to Gradescope in the same way as the problem sets, however, upon submitting
75 your lab assignments Gradescope will display which tests you have passed or
failed.
4. Conclusion
If you have questions on anything in this document, Piazza is the place to be!