Assignment 1 - Spring 2021
Virtual Cat World
Assigned: Mon, Mar 8
Due: Mon, Mar 15
Assignment Setup
- Login to Github and you will be prompted to accept this assignment
- After you click on the [Accept this assignment] button, you will see a new page display in your browser with the message:
- 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.
- After you refresh the page you should see a page with the message: “You're ready to go!”
- Note: this will create your own copy of Assignment 1 for you to work on, but it's not on your computer yet.
- Click on the URL where your assignment repository has been created: https://github.com/Vassar-cs101-mlsmith/assignment-1-yourGitHubID
- you are now on the GitHub page for your Assignment 1 repository
- Click on the green button to download your [Code]
- a “Clone” dialog box will appear, with the HTTPS tab underlined in red (if not, click on the HTTPS tab to select it)
- select the last option labeled “Download ZIP” and save it on your computer
- move the Assignment 1 zip file from its download location to your
cs101
course folder. - 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
- navigate into your
assign1
folder and confirm you see thecat-prog.rkt
andgauge-prog.rkt
files there.
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
andoverlay/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
Submitting your work
- 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
andgauge-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
andgauge-prog.rkt
files file should now be in your Assignment 1 GitHub repository.