Assignment 1 - Spring 2021

Assigned: Mon, Mar 8
Due: Mon, Mar 15


  1. Open a browser and copy/paste this URL: https://classroom.github.com/a/rB8Krlqz

  2. Login to Github and you will be prompted to accept this assignment
    1. After you click on the [Accept this assignment] button, you will see a new page display in your browser with the message:
      1. You accepted the assignment, Assignment 1. We're configuring your repository now. This may take a few minutes to complete. Refresh this page to see updates.
    2. After you refresh the page you should see a page with the message: “You're ready to go!”
    3. Note: this will create your own copy of Assignment 1 for you to work on, but it's not on your computer yet.

  3. Click on the URL where your assignment repository has been created: https://github.com/Vassar-cs101-mlsmith/assignment-1-yourGitHubID
    1. you are now on the GitHub page for your Assignment 1 repository

  4. Click on the green button to download your [Code]
    1. a “Clone” dialog box will appear, with the HTTPS tab underlined in red (if not, click on the HTTPS tab to select it)
    2. select the last option labeled “Download ZIP” and save it on your computer
    3. move the Assignment 1 zip file from its download location to your cs101 course folder.
    4. extract the contents of the zip file either by double-clicking on it or control-clicking on it and selecting the appropriate option to extract its contents
    5. navigate into your assign1 folder and confirm you see the cat-prog.rkt and gauge-prog.rkt files there.

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 your browser on the GitHub page for your Assignment 1 repository, click on the [Add file] drop-down button and select “Upload files”
  • From your assign1 folder on your desktop, click and drag the cat-prog.rkt and gauge-prog.rkt files onto your browser where it says, “Drag files here to add them to your repository”
    • just below the region of the webpage you should see both files appear; they'll be just above the Commit Changes section of the page.
  • You are now ready to commit changes! Click on the green [Commit changes] button.
  • Your updated cat-prog.rkt and gauge-prog.rkt files file should now be in your Assignment 1 GitHub repository.