Blog
Homework extension
Thu Mar 27 8:29:00 EST 2014 The SkipList homework is a bit confusing and some students are having trouble completing it. So I’m extending the homwork until Monday evening: it will be due by 6:00pm before lab.
As a hint: each Element represents one column of the diagram, which means each Element contains a single key (in the diagram, a yellow box with a number in it), a single value (not shown in the diagram, unfortunately), and a list of links to subsequent SkipListNodes (the rightward arrows). Getting the type of links right is tricky. You may want to represent the links as pairs of an Element and a level number, rather than as a Deque Node or some such (it is rather subtle to get the exact type parameter correct). Representing links this way makes it possible to get the linked Element easily, on which you can then use getValue, getKey, etc., and especially getNext.
Final project ideas
Mon Mar 24 5:20:00 EST 2014 Your final project is to implement one of the following two games in Java using the world library. Each project will have a minimal set of required features, and then a set of “whistles” (easier, smaller extensions) and “bells” (harder, larger extensions) that you can implement to embellish your project. NOTE: I may add a few more required features over the next couple of days. Keep an eye out for changes. If you have additional ideas for a whistle or bell, come talk to me about it so we can accurately judge how much work is likely needed.
- Minimum requirements:
The player
At least one level, with walls
Keeping score
A list of food pellets that must be eaten
At least two kinds of “eatables”, for bonus points
Four ghosts that follow the player around
Powerups that make the ghosts vulnerable and last for different times
The clever use of at least one non-list data structure
Tests
- Whistles: (Small extras)
Better graphics
Multiple lives
Making the levels toroidal instead of planar (so the player wraps around to the other side when walking off the edge of the screen)
- Bells: (Big extras)
Multiple levels
Multiple level designs
A “teleport” that moves the player out of harm’s way
A “clone” that mimics your motions and helps eat pellets
- Minimum requirements:
The player
A single row of aliens that moves correctly (back and forth, dropping down, speeding up)
Keeping score
Player motion from side-to-side
Missiles (both player and aliens)
At least two kinds of aliens (that take different number of hits to destroy)
The flying saucer bonus
The clever use of at least one non-list data structure
Tests
- Whistles:
Better graphics
Multiple rows of aliens
Multiple lives
- Bells:
Multiple levels
Shields (either static bunkers to hide behind, or a n-hit shield that follows you around)
The ability to move in two dimensions (but can’t move through static shields, if implemented)
A “rapid-shot” powerup that lets player shoot twice as fast
A “multi-shot” powerup that lets player shoot multiple missiles (possibly at angles instead of just straight up)
No homework for Thursday this week
Tue Mar 18 21:08:12 EST 2014 Study for the exam on Monday. A new assignment will go out Thursday and be due next Thursday.
Final Project Partnerships
Thu Mar 13, 9:30:00 EST 2014
Group 29: Allison Alder, Benji Smith |
Group 30: Chris Panella, Jacqueline Ali Cordoba |
Group 31: Amelia Oon, Will Enright |
Group 32: Sadruddin Saleem, Sinan Pehlivanoglu |
Group 33: Michael Hu, Tracey Lum |
Group 34: Eric Ropiak, Tim Sakharov |
Group 35: Chris Beiser, Sarah Babski |
Group 36: Nam Luu Nhat, Tiffney Kitiratanasumpun |
Group 37: Brian Desnoyers, Will Silva, Kirill Voloshin |
Final Homework Partnerships
Group 20: Allison Alder, Will Enright |
Group 21: Sarah Babski, Jacqueline Ali Cordoba, Nam Luu Nhat |
Group 22: Kirill Voloshin, Tim Sakharov |
Group 23: Amelia Oon, Chris Panella |
Group 24: Sinan Pehlivanoglu, Benji Smith |
Group 25: Chris Beiser, Tiffney Kitiratanasumpun |
Group 26: Brian Desnoyers, Michael Hu |
Group 27: Tracey Lum, Eric Ropiak |
Group 28: Sadruddin Saleem, Will Silva |
Note on Homework 8
Thu Mar 6 10:03:00 EST 2014 It is entirely possible to solve this homework without needing to use type-casts or modifying the IList interface with methods like asConsList or asQuickList. As a hint: my example solution uses three constructors for QuickLists:
class QuickList<T> implements IList<T> {
// Creates an empty QuickList
QuickList();
// Creates a single-element QuickList
QuickList(T t);
// Creates a QuickList with the given forest of elements already set up
// NOTE: Clients should never get to use this!
QuickList(IList<Tree<T>> forest);
}
My solution then has roughly one visitor for each operation you need to implement (reverse, append, get, first and rest), for example:
class ReverseVisitor<T> implements IListVisitor<T, IList<T>> { ... }
To implement cons, though, you have to be a bit clever. Because the algorithm behaves differently when the QuickList’s forest is empty, has one element, or has multiple elements, you need two visitors:
class ForestVisitor<T> implements IListVisitor<Tree<T>, IList<Tree<T>>> {
T elemToConsOntoFront;
ForestVisitor(T t) { this.elemToConsOntoFront = t; }
...
}
class ForestVisitor2<T> implements IListVisitor<Tree<T>, IList<Tree<T>>> {
T elemToConsOntoFront;
Tree<T> firstTreeInForest;
...
}
Note on Homework 7
Tue Feb 25 10:44:00 EST 2014
For this assignment, don’t try to use generic IList<T> types to define schedules. Define an ISchedule and classes NoEvent and ConsEvent accordingly. You’ll need to use type-casts otherwise, which is not a good idea. You may be able to use IList<T> successfully in the string-dictionaries problem, and you won’t need any generics (or lists) at all in the tries problem.
Assignment 7 out
Fri Feb 21 10:53:15 EST 2014
The next assignment is out. It’s long – get started early!
Practice exam questions now available
First exam: In class, Monday 2/10
Tue Feb 4 09:47:40 EST 2014
Chris will not have office hours today, but will hold them instead on Friday, 5–7pm.
Initial Partnerships
Pair 1: Allison Alder, Amelia Oon |
Pair 2: Jacqueline Ali Cordoba, Tiffney Kitiratanasumpun |
Pair 3: Sarah Babski, William Silva |
Pair 4: Christopher Beiser, Christopher Panella |
Pair 5: Brian Desnoyers, Tracey Lum |
Pair 6: William Enright, Michael Hu |
Pair 7: Nam Luu Nhat, Eric Ropiak |
Pair 8: Sinan Pehlivanoglu, Konztantin Gizdarski |
Pair 9: Timothy Sakharov, Sadruddin Saleem |
Pair 10: Benji Smith, Kirill Voloshin |
Follow the bouncing ball
Thurs Jan 9 15:45:00 EST 2014 In class today we started an example of animating a bouncing ball in an object-oriented big-bang program. Part of the challenge was simply to model the bouncing of the ball in a way that was natural for the computation. But the follow-on challenge is to reuse that code to implement multiple bouncing balls – without having to change the implementation of the ball’s class(es). I’ll post the solution to this on Monday, but for now I’ll describe the problem in more detail:
Define a class (or classes) to represent a bouncing ball of radius 10, of some color, moving at some initial velocity and at some initial position. Assume that gravity accelerates the ball at 1 pixel / second / second. You should be able to pass such a ball object into big-bang and have it animate. Next, define a world% class that represents a list of balls. Running this world% should animate all the balls simultaneously. In particular, can you implement world%’s on-tick and to-draw methods without calling any drawing functions?
Correction to HW1
Wed Jan 8 10:40:03 EST 2014 We do not yet have GitHub set up. For now, for homework 1, just email Chris your completed assignment.
We also have not assigned programming partners yet. For homework 1, you can continue to work with the lab partner you worked with on Monday. Make sure that your submitted assignment includes both your names, so we know who worked on what.
Welcome to CS2510H
Fri Jan 4 16:06:59 EST 2013
We hope you’ll have fun.