CS 440 Spring 2023 Homework 0 (10 points)

This homework is just to make sure OCaml is set up properly on your computer (and also to take a quick survey of the class; your survey responses will only be used to help us design lectures and assignments, they won't be published.)

Completing the homework properly is worth 10 points. There are no wrong answers to the survey.

You will edit only the file hw0.ml. When you compile and run your program, it will produce the text file hw0_out. Normally, when your code produces auxiliary files, we will tell you not to commit them to your repo or submit them. This is an exception. Please make sure to add and commit hw0_out when submitting.

Getting the code

  1. Follow the assignment link (https://classroom.github.com/a/t4GMsXj1)
  2. Select your username (should be the same as your iit email before the .hawk).
  3. Accept the assignment invitation and wait for your repository to be created. You may have to wait a bit and refresh the page.
  4. Follow the link to your homework repo.

At this point, if you're familiar with Git and Github, you can clone the repo and start working. If not, read this quick Git tutorial

Long story very, very short (please do read the tutorial though, as there's some setup you'll probably need to do if you haven't set up Git on your (virtual) machine yet), clone the repo:

  1. Click the green "Code" dropdown above the file navigator on the Github repo page.
  2. Click the "SSH" tab.
  3. Copy the URL.
  4. Open a terminal and run

git clone <URL you copied>

to create a new folder called hw0 with your working copy of your homework repo.

Exercises

When you clone the repo, it will have the file hw0.ml, which contains a number of survey questions and answers, as OCaml definitions. For example,

let my_name = "Stefan Muller"

Replace the values with your answers, but don't change the variable names, e.g.,

let my_name = "Your name here"

When you're done, save the file and compile it by running (in the same folder as hw0.ml)

make

This should produce the executable hw0 (and some other files you can ignore). Run the program by running

./hw0

This will not produce any output on the console, but will produce the file hw0_out. You can open this in any text editor or view it in the terminal using

cat hw0_out

The file should contain your survey answers. If everything looks good, commit your changes and the text output with

git add hw0.ml
git add hw0_out
git commit -m "A meaningful commit message"

When you're ready to submit, push your changes to the repo.

git push

You're welcome to push to the repo as many times as you want; this can be useful to back up your work. We will only grade the most recent submission.

Important note: For some assignments (including this one), Github will run some automatic checks on your commits and display whether they pass (it may label this "Autograding"). These are not all of the tests we will run on your code for grading (we run additional automated tests of your code and also do some manual grading), and passing these tests does not mean you get full credit. For this assignment, for example, the Github tests just make sure you remembered to add hw0_out.