General Info
| Syllabus
| Assignments
| Labs
| Textbooks
| Advice
| Blog
Course Contract
Lectures: | MWTh, 4:35 PM – 5:40 PM, 170 West Village F | ||
Labs: | Th, 11:45 AM – 1:25 PM, 210 West Village H | ||
Note: Office hours have ended for the semester. | |||
Instructor: | Jesse Tov | tov@ccs | Office hours: M, 2 PM – 4 PM, 308 West Village H (or by appointment) |
TAs: | Stevie Strickland | sstrickl@ccs | Office hours: T, 3 PM – 5 PM, 308 West Village H |
Vincent St-Amour | stamourv@ccs | Office hours: F, 2:30 PM – 4:30 PM, 308 West Village H | |
Tutors: | Nikko Patten | npatten@ccs | Office hours: M, 12 PM – 1 PM, 102 West Village H |
Chris Souvey | souvey@ccs | Office hours: M, 8 PM – 10 PM, 102 West Village H | |
Ryan Cassidy | rcassidy@ccs | Office hours: T, 5 PM – 7 PM, 102 West Village H |
This course is an introduction to computing and programming. Its major goal is to introduce students to the principles of systematic problem solving through programming and the basic rules of computation.
The course assumes a basic familiarity with arithmetic and algebra. It demands curiosity, self-discipline, and some amount of people skills, because all computer scientists end up working with others interactively all the time, including in this course.
The course does not assume any prior programming experience. It is therefore suitable for first-year students—majors and non-majors alike—who wish to explore the intellectual ideas of the discipline.
Many of you have one burning question on your mind as you start your college careers:
How am I going to get an A in this course?
We have some news for you: you are in college now, and in college, it really is about learning something and not (just) getting a grade. As a matter of fact, if you are taking a course and the A comes easy, you are either cheating yourself or you are allowing the instructor to cheat you.
Here is the positive take-away from this section: College is your last chance to learn how to learn by yourself, without pressure from parents, teachers, or peers. You want to learn that, because the quality of your life depends on it. Your life. Nothing more, nothing less.
Naturally, we understand that you want some feedback, both in terms of specific corrections and in terms of a grade. You want feedback so that you can improve your learning process. And we will give you that feedback. It is our end of the bargain. Your end is to demonstrate that you actually use the methods and tools for learning that work best in our experiemce. After all, you don’t want to waste your time, and we don’t want to waste ours either.
So, if you wish to earn a grade in this course, you must print the Course Contract, sign and date it, and turn it in at the instructor’s or TAs’ office hours. Your signature acknowledges that you have read and understood the contract and its implications. As long as you will live up to its spirit, we will stand by you during this semester.
In a large freshman course such as CS2500 you typically encounter three kinds of people, listed in increasing order of relevance to you:
Jesse Tov
Vincent St-Amour
Stevie Strickland
TAs teach labs, supervise the grading of homework sets, hold office hours, and occasionally substitute in lectures. In general, they are apprentice teachers and are here to learn how to run a course.
Nikko Patten
Ryan Cassidy
Chris Souvey
Tutors hold office hours and group meetings in colleges and labs, grade homeworks and provide feedback about the class’s progress. In general, they are undergraduate and graduate students who know that to learn something really well, you need to teach it.
Class consists of lectures and lab meetings (CS2501).
Lectures meet on Mondays, Wednesdays, and Thursdays from 4:35 to 5:40 PM in 170 West Village F.
The course also has two lab sections, aka CS2501. Both labs are held on Thursdays from 11:45 AM to 1:25 PM in 210 and 212 West Village H. The purpose of labs is to give you some hands-on experience with the actual tools, and to explain some of the principles from lecture with hands-on examples.
We will use DrScheme v4.2, a programming environment for the Scheme programming language, some dialects of Java, Algol 60, Ocaml, and a few others. For CS2500, we will stick to the HtDP teaching languages plus teachpacks. DrScheme is installed on the CCS computers. It is also freely available on the Web, in case you wish install it on your own computer.
DrScheme runs on most popular platforms (Windows XP/Vista/7, Mac OS X, Linux, and other UNIX systems). Programs written in DrScheme work the same on all platforms. You therefore do not need to worry what kind of machine you use when you run DrScheme programs.
Most actual learning happens while completing problems sets, and problem sets will help to prepare you for the exams
There will be weekly problem sets. Some problems are drawn from HtDP, the textbook; others are constructed for this instance of CS2500. We will grade some but not all problems from each set.
We will drop the homework grade with the worst impact on your final grade from consideration for the final grade. Thus, if you choose to skip an assignment set or if you just don’t get it one week, nothing is lost. The story is different for the second or third or ... time.
You may only collaborate on problem sets with your partner (see below). You must acknowledge your collaborator/partner on your cover page. Any other collaboration is cheating; we will report cases to the university administration.
You must work on your problem sets (2 – 11) in pairs. Your lab TA will assign you a partner. Every few weeks, you will get a new partner.
Pair programming means that you and your partner work on the problem sets jointly. You read them together and you work on the solutions together. One of the lab’s purposes is to teach you how to work in pairs effectively; indeed, pairs are provably more effective than individuals in programming. The rough idea is this: One of you plays pilot, the other co-pilot. The pilot works on the keyboard and explains aloud what is going on; it is the co-pilot’s responsibility to question everything. After a problem is solved to the satisfaction of both, you must switch roles.
We will have two three-hour evening exams to assess your progress:
The exams will test material similar to that assigned in weekly homeworks. You will take the exams by yourself. Collaboration is not tolerated. If you can solve every homework problem on your own, the exams will be easy. If not, you will have a difficult time.
We will have the daily quiz. It is our one concession to “high school thinking.” (Consider it a crutch for your self-discipline.) Each week we will randomly select at most one of these quizzes for grading, and the remainder are thrown away.
For the final grade, we will assign a weight of 30% to your overall homework grade and 30% to each of the two midterm exams. Each week’s homework grade is multiplied by that week’s lab quiz grade (0 or 1); students who fail a lab quiz have a week to come to office hours and convince an instructor or TA that they have learned the material, in order to receive homework credit. (Students who miss a lab quiz must email the instructor by the day of the lab to be eligible to make up the lab quiz.) The remaining 10% depends on the quizzes, lab participation, and the discretion of the instructor. Additionally, you must have a passing grade for your homeworks alone in order to pass this course.
This table specifies the reading and lecture schedule. The link in the first column connects this page to the homework that you will be working on for the corresponding week. The second column gives the date for Monday of each week. The third column lists the sections in How to Design Programs that cover the lecture material. The fourth through ninth columns give the pages or sections for your reading for that day.
This daily reading schedule is intentionally not tied to the lecture schedule. Instead it is designed to cover a reasonable amount of material on a regular basis. On the average, you will need to read six to twelve pages a day, which in our experience is an appropriate speed of reading. As a result you will occasionally be behind the lecture schedule, and most of the time you will be ahead, which will help you and us to make lectures interesting.
(Reading schedule last updated Fri, 15 Jan 2010 01:19:06 -0500.)
# | wk. of | Topic | M | T | W | Th | F | S/S |
1 | Jan. 11 | Preliminaries | §1 † | §2.1–2.1.7 † | §2.2–2.2.3 † | |||
2 | Jan. 18* | Atomic and compound data | §2.3–2.3.5 † | §2.3.6–2.3.7 † | §2.4–2.4.4 † | §2.4.5–2.4.7 † | §2.5–2.5.1 † | §2.5.2–2.5.7 † |
3 | Jan. 25 | Unions | §2.6–2.6.1 † | §2.6.2–2.6.3 † | 118–128 | 128–137 | 138–151 | 168–180 |
4 | Feb. 1 | Self-referential unions | int. 2 | 189–199 | 209–217 | 217–221 | §16 | 228–239 |
5 | Feb. 8 | Self-referential unions | 240–247 | int. 1 | §14.4 | §17.7 | 249–258 | 259–269 |
6 | Feb. 15* | Recursion in all forms | 269–280 | exam prep. | exam | 283–292 | 293–298 | 299–305 |
7 | Feb. 22 | Abstraction | 306–312 | int. 4 | 313 | 319–25 | §21.3 | 334–340 |
- | Mar. 1 | Spring break | ||||||
8 | Mar. 8 | Abstraction | 342–349 | 357–367 | §26 | 381–386 | 387–396 | 399–401 |
9 | Mar. 15 | Loop functions | 407–413 | 417–426 | 426–436 | 441–445 | 445–450 | 450–457 |
10 | Mar. 22 | Generative recursion | 460–466 | 472–477 | slack | slack | 21–27 | 90–93 |
11 | Mar. 29 | Generative recursion | 94–96 | 168–175 | 176–180 | 221–228 | int. 6 | exam prep. |
12 | Apr. 5 | Generative recursion | exam prep. | exam prep. | exam | 491–498 | 499–504 | 505–507 |
13 | Apr. 12 | Generative recursion | §36 | |||||
14 | Apr. 19* | Conclusion | Last day of class is Wed., Apr. 21 |
* No class Monday for MLK Day (1/18), Presidents’ Day (2/15), or Patriots’ Day (4/19).
† These readings with the aqua background are from How to Design Programs, Second Edition, which is available online only. Be sure to use the links in the table above, because these section numbers do not align with the first edition (i.e., your printed textbook and the online version at htdp.org).
Homework is generally due at 11:59 PM on Tuesdays, though you should check each individual assignment to be sure. Please let the teaching staff know ASAP if you have trouble submitting, because turning in homework on time is your responsibility. Barring exceptional circumstances, late homework will not be accepted.
Link | Assigned | Due |
Problem Set 12 | Wednesday, April 7 | Tuesday, April 20 at 11:59 PM |
Problem Set 11 | Tuesday, March 30 | Tuesday, April 6 at 11:59 PM |
Problem Set 10 | Tuesday, March 23 | Tuesday, March 30 at 11:59 PM |
Problem Set 9 | Tuesday, March 16 | Tuesday, March 23 at 11:59 PM |
Problem Set 8 | Tuesday, March 9 | Tuesday, March 16 at 11:59 PM |
Problem Set 7 | Thursday, February 25 | Tuesday, March 9 at 11:59 PM |
Problem Set 6 | Tuesday, February 16 | Tuesday, February 23 at 11:59 PM |
Problem Set 5 | Tuesday, February 9 | Tuesday, February 16 at 11:59 PM |
Problem Set 4 | Tuesday, February 2 | Tuesday, February 9 at 11:59 PM |
Problem Set 3 | Tuesday, January 26 | Tuesday, February 2 at 11:59 PM |
Problem Set 2 | Wednesday, January 20 | Tuesday, January 26 at 11:59 PM |
Problem Set 1 | Tuesday, January 12 | Wednesday, January 20 at 4:35 PM |
Please submit your homework sets according to the instructions on the web page for the individual assignments, following the guidelines for turning in homework.
For Problem Set 2 and subsequent assignments, we will be using online submission for the programming component of all assignments in this course. Instructions for using the homework server are below. We will go over them in lab, but keep this page bookmarked as you will need to do this each week.
Download the plugin to your computer. Use the “File” / “Install .plt file” menu option to install this file. Once it completes you must restart DrScheme. If it installs correctly, you will have a CS 2500 Handin button in your DrScheme window.
Each of you should have an account in the homework server. Your username is your MyNEU account name (for instance, my account is “strickland.t”) and your password is the last 4 digits of your student ID. Use the “File” / “Manage CS 2500 Handin Account” menu option and the “Change Info” tab to get the current information on your account. Enter your username and “old” password, then click “Get Current Info”. Update any incorrect information and change your password to something you will remember. Then click “Change Info” or “Set Password” as appropriate.
To submit your homework, make sure it is open in DrScheme’s current Definitions window as well as saved to disk. Then click “CS 2500 Handin” to open the popup window. For pair submissions, enter both usernames joined by “+”, as in “strickland.t+stamour.v”. Enter either person’s password. Select the correct homework name. When you are ready, click “CS 2500 Handin” within the popup window. DrScheme will report whether your submission is successful at the top of the window. If it fails, READ the error message and correct your submission appropriately.
Log in to this page using your handin server username and password. It will take you to a page listing all of the homeworks so far. For each homework, it shows whether you have handed in yet, a link to the latest submission once you’ve handed in, and your grade once we enter it.
When you turn in homework on paper, make sure to follow these instructions:
Use a cover page that lists the assignment number, your names, and which lab section you are in.
If you had collaborators, enumerate them, too. Not doing so imperils your grade.
+---------------------------------------+ | | | | | | | Assignment 2 | | Alyce H. Acker | | Bob Pue | | 212 Lab | | | | | +---------------------------------------+
Your daily readings come from:
If you wish to learn to use Scheme as a tool, which is not the goal of this course, then take a look at the following:
You cannot learn everything you need to know in lectures and/or homeworks. You must:
Read the Book (How to Design Programs).
Try to stay ahead of the game and read material before it is covered in class. If you have questions, write them down. If these questions don’t get covered, ask in class and/or meet with the tutors, lab coordinator, or professor.
Attempt to solve additional problems.
Try to solve as many exercises as possible as you read sections in the book. If you can’t do them, read the material again.
Attend the lecture and tutorials (aka “labs” at Northeastern).
Every professor has a personal understanding of a course and teaches the material according to a personal style. It is important to get used to and to exploit this “personalization of courses”; otherwise, you’re wasting your money.
The tutorials cover the practical know-how (how to edit, how to evaluate, how to print, etc.) and illustrate the material from a different angle.
Talk to the course staff.
If the lecture and the notes leave you with questions on the material, see your teacher(s) during office hours or make an appointment. Mark the passages in the book(s) that you haven’t understood and prepare questions that express what you haven’t understood.
Keep up.
Experience proves that students who fall behind quickly drop out. So, keep up with the readings, tutorials, and the homeworks. Ask for additional problems, if the homeworks failed to make a point.
Posted Tuesday, 04 May 2010 [link]
Posted Monday, 19 April 2010 [link]
Posted Friday, 16 April 2010 [link]
Posted Thursday, 15 April 2010 [link]
Posted Wednesday, 14 April 2010 [link]
Posted Saturday, 10 April 2010 [link]
Posted Friday, 09 April 2010 [link]
Posted Thursday, 08 April 2010 [link]
Posted Wednesday, 07 April 2010 [link]
Posted Wednesday, 07 April 2010 [link]
Posted Wednesday, 07 April 2010 [link]
draw.ss
teachpack, which works very differently from the
image.ss
and universe.ss
teachpacks that we
use now.
draw.ss
teachpack relies on side
effects. A side effect is when calling a function, in addition to
returning some answer, causes something to happen. In this
particular teachpack, for example, there is a line
function
that always returns true
, but also causes a line to appear
on the screen. Everything we do using the image.ss
teachpack is about returning images, not about causing things to happen
on the side. (Even when you use big-bang
, all the
functions you write are about computing values, not doing things.
Things happen, but that’s something that big-bang
takes
care of for you.)
sierpinski
from the book:
;; sierpinski : posn posn posn -> true ;; to draw a Sierpinski triangle down at a, b, and c, ;; assuming it is large enough (define (sierpinski a b c) (cond [(too-small? a b c) true] [else (local [(define a-b (mid-point a b)) (define b-c (mid-point b c)) (define c-a (mid-point a c))] (and (draw-triangle a b c) (sierpinski a a-b c-a) (sierpinski b a-b b-c) (sierpinski c c-a b-c)))]))
(too-small? a b c)
, and the trivial solution is to draw
nothing else to the screen, so it returns true
. Otherwise,
it uses and
to sequence four side-effecting
operations: First it draws a triangle at the requested points on the
screen, and then it recurs three times to draw the subfractals
(subproblems) to the screen. This is following the recipe for
generative recursion, but in terms of drawing, it is quite different
from how we do things.
;; sierpinski-helper : Posn Posn Posn Scene -> Scene ;; To add a Sierpinski triangle at points a, b, and c ;; to the given scene, assuming it is large enough to see (define (sierpinski a b c scene) (cond [(too-small? a b c) scene] [else (local [(define a-b (mid-point a b)) (define b-c (mid-point b c)) (define c-a (mid-point a c))] (sierpinski c c-a b-c (sierpinski b a-b b-c (sierpinski a a-b c-a (add-triangle a b c scene)))))]))
too-small? : Posn Posn Posn -> Boolean
and
add-triangle : Posn Posn Posn Scene -> Scene
.
sierpinski-carpet
, the recursive function had to be a
helper to a Natural -> Scene
function that creates the
empty scene and calls the helper to add the carpet to it.
Posted Sunday, 04 April 2010 [link]
Posted Saturday, 03 April 2010 [link]
Posted Friday, 02 April 2010 [link]
Posted Wednesday, 31 March 2010 [link]
Posted Wednesday, 31 March 2010 [link]
Posted Tuesday, 30 March 2010 [link]
Posted Thursday, 18 March 2010 [link]
Posted Saturday, 13 March 2010 [link]
;; A QTree is one of: ;; – "Q" ;; – (make-single QTree) ;; – (make-double QTree QTree) ;; – (make-triple QTree QTree QTree) (define-struct single (only)) (define-struct double (this that)) (define-struct triple (left middle right)) ;; Template for QTree: (define (process-qtree qt) (cond [(string? qt) ...] [(single? qt) ... (process-qtree (single-only qt)) ...] [(double? qt) ... (process-qtree (double-this qt)) ... ... (process-qtree (double-that qt)) ...] [else ... (process-qtree (triple-left qt)) ... ... (process-qtree (triple-middle qt)) ... ... (process-qtree (triple-right qt)) ...])) ;; q-count : QTree -> Natural ;; To count the number of "Q"s in a QTree. (define (q-count qt) (cond [(string? qt) 1] [(single? qt) (q-count (single-only qt))] [(double? qt) (+ (q-count (double-this qt)) (q-count (double-that qt)))] [else (+ (q-count (triple-left qt)) (q-count (triple-middle qt)) (q-count (triple-right qt)))])) ;; Examples/Tests: (check-expect (q-count "Q") 1) (check-expect (q-count (make-double (make-single "Q") "Q")) 2) (check-expect (q-count (make-triple (make-double "Q" "Q") (make-single (make-single "Q")) "Q")) 4)
Posted Friday, 12 March 2010 [link]
Posted Wednesday, 10 March 2010 [link]
Storing a velocity in your representation of an enemy (or shot) implies that the velocity will be different for different enemies (or shots) or at different times. Above, you included those velocities in your list of constants, but you’re also including velocities in your data representation. Which is it? Storing the same constant everywhere for some value that doesn’t change just makes your code more complex.
Your list of functions is a good start, but you may want to think this through a bit more before you start coding.
Most of your contracts just take worlds to worlds, but I’m certain you’ll actually have many functions that deal with only part of the world.
Might you want some rendering helpers or helpers for generating new enemies?
Hint: Use place-image
to add each enemy (and shot) to the
scene.
Avoid overlay/xy
. Trying to assemble several different scene
elements by overlaying them before adding them to the world will just
cause you trouble.
You aren’t sure yet how you’ll do collision detection. You may benefit from the concept of a bounding box. The displayed shape of a thing might be complicated, but as long as it’s pretty small (enemies and bullets both count), for collision detection it’s often best to treat it as a rectangle. It’s very easy to tell when two rectangles overlap. If you have two rectangles centered at (x1, y1) and (x2, y2), with dimensions w1 by h1 and w2 by h2, then they overlap when x1 and x2 are no more than (w1 + w2) / 2 apart and y1 and y2 are no more than (h1 + h2) / 2 apart.
Circles and points are good, too. It’s very easy to tell when a point intersects a circle, a circle intersects a circle, or a point intersects a rectangle.
Be careful not to write helpers that you may turn out not to need, or to need with a substantially different interface.
Random enemy generation is hard; I found it to be the hardest part. I’d recommend doing it near the end. Before that, you can use a hand-made list of enemies that you make yourself.
Posted Tuesday, 09 March 2010 [link]
Posted Monday, 08 March 2010 [link]
Posted Sunday, 07 March 2010 [link]
Posted Sunday, 28 February 2010 [link]
random
.
I put ‘function’ in quotes there because unlike
every Scheme function we’ve seen so far,
random
may return different results when given the exact
same arguments.
It’s not truly a function in the mathematical sense, but
it’s useful for what we want to do in Scheme.
Posted Thursday, 25 February 2010 [link]
Posted Thursday, 25 February 2010 [link]
Posted Thursday, 25 February 2010 [link]
Posted Monday, 22 February 2010 [link]
(alpaca-dam (alpaca-dam a))
, this is a sign
that you need some recursion. (Follow the shape of the data
definition!)
(alpaca-dob (alpaca-sire a))
,
that indicates the need for a helper function.
Posted Monday, 22 February 2010 [link]
Posted Saturday, 20 February 2010 [link]
Posted Thursday, 18 February 2010 [link]
Posted Wednesday, 17 February 2010 [link]
n
to every number in a list or find the length
of every string in a list?n
?n
?
Posted Sunday, 14 February 2010 [link]
Posted Friday, 12 February 2010 [link]
Posted Friday, 12 February 2010 [link]
Posted Wednesday, 10 February 2010 [link]
Posted Wednesday, 10 February 2010 [link]
Posted Wednesday, 10 February 2010 [link]
Posted Tuesday, 09 February 2010 [link]
Posted Monday, 08 February 2010 [link]
Posted Monday, 08 February 2010 [link]
Posted Sunday, 07 February 2010 [link]
5
in a DrScheme buffer, and they would submit it as
st-amour.v+strickland.t to the dummy assignment “partners2.”
Please do this by noon on Sunday if you have a preference.
We will consider your request, but we won’t necessarily honor it.
Posted Friday, 05 February 2010 [link]
Posted Tuesday, 02 February 2010 [link]
Posted Monday, 01 February 2010 [link]
Posted Thursday, 28 January 2010 [link]
big-bang
in one file. It’s okay to comment out your
big-bang
s, provided that each one works when uncommented.
Posted Monday, 25 January 2010 [link]
Posted Friday, 22 January 2010 [link]
Posted Thursday, 21 January 2010 [link]
Posted Thursday, 21 January 2010 [link]
Posted Wednesday, 20 January 2010 [link]
Posted Friday, 15 January 2010 [link]
Posted Friday, 15 January 2010 [link]
Posted Thursday, 14 January 2010 [link]
(rectangle 10 10 "solid" "green")and DrScheme complained: “reference to an identifier before its definition: rectangle.” There’s nothing wrong with that Scheme expression, but you need to tell DrScheme ahead of time that you want to work with images (and eventually, animations), by loading the universe.ss “teachpack.” You can do this by going to the Language>Add Teachpack... menu and selecting universe.ss at the bottom of the list.
Posted Wednesday, 13 January 2010 [link]
Posted Tuesday, 12 January 2010 [link]
Posted Monday, 11 January 2010 [link]
Posted Monday, 11 January 2010 [link]
Last updated Tuesday, 04 May 2010