Problem set 0

# Problem set 0 #

Before we get to the substance of the course, this problem set makes sure that your development environment is set up, that you have access to the OCaml tools, that you’ve got git set up properly, and that you’re generally ready to get to work on the labs and problem sets in the course. We won’t be grading this problem set, so it’s your chance to get all of the kinks out of the development and problem set submission process.

You should start by following the OCaml setup instructions in the “Setting up your OCaml development environment” document. This might take a while, so we suggest getting an early start. Then come back to this document for the rest of the problem set.

You’re back? Great. Good job making it this far. We know that getting your setup ready can be frustrating, but it’s an important part of the process. Now that you’ve done it, you’re ready to write some code.

## Creating and cloning the remote repository #

If you aren’t already familiar with the git version control system or you don’t have a github account, follow the instructions in the “Setting up git” document.

To create your repository for this homework, go to http://url.cs51.io/ps0 and follow the directions to create a remote repository for you to use for this problem set. See the “Setup” section of the “Problem set procedures for CS51” document for more detailed information.

You now have a remote repository to store your problem set, and a local clone of that repository. Using cd, enter the directory that was just cloned. When you run ls, you should see the files ps0.ml, ps0_tests.ml, makefile, and _tags.

## Compiling and running the problem set code #

We’ve provided a makefile that specifies instructions to compile the problem set. When in the root directory for the problem set, you can run the command

% make all


to compile the problem set, generating a file ps0.byte. Then run the compiled file with the command

% ./ps0.byte


You should see:

----------------------------------------
Name: FIRST LAST

Year: Other: I haven't filled it in yet

50?: Other: I haven't filled it out yet

----------------------------------------


## Writing your first OCaml program #

It’s time to write and submit your first OCaml program. Your job is to edit ps0.ml.

Open up ps0.ml in your favorite text editor. (If you don’t already have a favorite text editor, see the “Programmers' editors” handout for our advice on text editors for OCaml programming.) Follow the directions inside ps0.ml.

After you’ve made your changes, you should recompile and run the code. Once it is working to your satisfaction, it’s time to submit the problem set to Gradescope.

## Submitting your problem set #

To submit the problem set, you should read and follow the instructions in the “Submission” section of the document “Problem set procedures for CS51”.