Assignment 1 - Spring 2019

Assigned: Wednesday, February 6
Due: Monday, February 18


Assignment Setup

  1. Use your CS account to login to one of the Linux workstations in the classroom or Asprey Lab.

  2. Open a browser and copy/paste this URL: https://classroom.github.com/a/NapRaJLc

  3. Login to Github and you will be prompted to accept this assignment
    1. Note: this will create your own copy of Assignment 1 for you to work on, but it's not on your Linux account yet

  4. Open a terminal window.

  5. Create a new directory for this assignment in your cs101 directory by entering the following at the Linux prompt:

    cd cs101
    mkdir assign1
    cd assign1

  6. Type the following commands to pull down a copy of this lab from GitHub:
    $ git init
    $ git remote add origin https://github.com/Vassar-cs101-mlsmith-spr2019/assignment-1-yourGithubID
    $ git pull origin master

Description

Program 1: cat-prog.rkt

  • Open cat-prog.rkt in DrRacket
  • Put your name in the header comments
  • Complete Exercises 45 and 46 (on pp. 100–101 of HtDP/2e Section 3.7)
    • be sure to refer to our class notes for a fully worked example of a big-bang program
    • for values that never change, define constants and use them by name.
    • constants I defined were:
      • WIDTH (800) and HEIGHT (200)
      • CAT-y (half the HEIGHT) and
      • MT (the empty-scene with dimensions WIDTH and HEIGHT)
      • in addition to my cat1 and cat2 image constants

Program 2: gauge-prog.rkt

For this program we're going to create a “happiness gauge” for our cat. Later, we'll combine this program with the first program, but for right now we'll keep them separate.

  • Open gauge-prog.rkt in DrRacket
  • Put your name in the header comments
  • Complete Exercise 47 (on pp. 100–101 of HtDP/2e Section 3.7)
    • Some notes:
      • you will need to use two of the overlay functions from the 2htdp/image teachpack, and you can look up examples of how to use them on your own – but ask me or the coaches for help if needed.
      • in particular, you will find the overlay and overlay/align functions helpful.
      • for values that never change, define constants and use them by name.
      • constants I defined were:
        • WIDTH and HEIGHT (same as in first program)
        • MT (the empty-scene)
        • MT-mid-x

From a terminal window, type the following commands at the Linux prompt:

$ git commit -m "finished cat-prog.rkt" cat-prog.rkt
$ git commit -m "finished gauge-prog.rkt" gauge-prog.rkt
$ git push -u origin master