|CS 220 01 / Zelle||Winter 2016|
|Syllabus||Handouts||Python Resources||Textbook Resources||Manhattan VC||Dr. Zelle|
Chapter 1 Review Questions (pt 1) (due 1/8, class time)
Do T/F questions 1--5 and Multiple Choice 1--3 from pp 33,34. Write answers on paper suitable for hand-in at the start of class.
Stats Design Exercise (due 1/11)
Do programming exercise #7 (page 38), but only up to the design stage. You should write the function signatures + pre and post conditions for any existing functions that you modify or new functions that you propose.
Do NOT implement your design yet. Just write your function specifications on paper and bring them to class suitable for hand-in.
Stats Library Implementation (due 1/13, midnight)
Complete the stats library as specified in stats_mod.py. Your library should sucessfully pass the testing code at the bottom when run as a stand alone program. You will have to test the get_scores function manually; you can call get_scores() in the IDLE Python shell to do this.
Turn your program in on Socrates. I will have the accounts set up sometime on 1/12.
rollDice and score functions (due 1/15, classtime)
Complete the implementation of the rollDice and score functions that we specified in class on Weds. You should have hardcopy of these functions suitable for handing in at the beginning of class.
complete Risk Dice simulation (due 1/18, midnight)
Finish the Risk Dice program as discussed in class. You don't necessarily need pre and post conditions for every function, but every function should have a doc string that succinctly and precisely describes it's behavior. At a very minimum, this includes a description of the inputs parameters and a description of the return value. Turn your program in on Socrates.
program inputs: attacker dice roll (3 ints), number of trials to run program outputs: average attacker score against single roll defense and average attacker score agains double roll defense.
Read/Study section 1.3 (due 1/20, class time)
You should be ready to discuss and apply this material. If you don't understand it, prepare some questions to ask. If you have no questions, you will be expected to answer my questions ;-).
Chapter 1 Review (pt 2) (due 1/22, class time)
Do multiple choice questions 6--10, and short answer questions 3,4,6,7 from pages 34--36.
Study Card Class (due 1/25, class time)
Study sections 2.1--2.3. Pay particular attention to the Card class. You should come to class with a couple specific questions about what you read. If there are no questions, then I assume you can ace a quiz over the material.
Reimplement the Card class (due 1/27, midnight)
Redo the Card class along the lines discussed the book (section 2.3.3). As discussed in class, your new version will have a single instance variable, cardnum. The specifications for the class (including the parameters of __init__) remain unchanged from the original. You should also write a test function that exercises all the methods of the class to ensure that your new version meets the spec. You might use the test function at the bottom of our stats_mod project as an example.
Study Sections 2.4 and 2.5 (due 1/27, class time)
Study sections 2.4--2.5. Pay particular attention to the Dataset and Rational classes. You should come to class with a couple specific questions about what you read. If there are no questions, then I assume you can ace a quiz over the material.
Rational.py/rational_test.py (due 2/5, midnight)
Complete the Rational class with all appropriate unit tests. You can find the files we worked on in class today here.
Egyptian Fractions(due 2/8, midnight)
Write a program to compute an Egyptian fraction.
input: a positive proper fraction (<1) output: the terms of an equivalent egyptian fraction
As a fun bonus, write an additional program that finds the fraction having the "worst" Egyptian representation.
input: Maximum denominator to consider (md) output: Fraction between 1/2 and (md-1)/md having the worst egyptian representation; where worst is defined as having the term with the largest denominator.
Study sections 3.1--3.4 (due 2/8, class time)
Counting Bridge Hands (due 2/15, midnight)See the assignment here.
Chapter 3 Review (due 2/17, class time)Do the True/False and Multiple Choice questions from the end of Chapter 3.
ANNOUNCEMENT: Meet in lab on 2/15We will be doing an in-class lab on Monday, so class will meet in the Linux Lab.
CDCollection (due 2/17, midnight)Complete the Building a Linked Data Structure lab and hand it in on Socrates. You can do this either in your lab teams or as an individual.
Marble Clock (due 3/9, midnight)This is a generalization of a problem from the textbook. The project description is here.
Chapter 5 Review (due 3/14, class time)Do the True/False and Multiple Choice questions from the end of Chapter 5.
Extra credit queue project (by end of term)Implement the Karplus-Strong algorithm for string syntehsis. Test your algorithm by creating a program that reads a song file and produces a corresponding wave file suitable for playing on standard audio players. You can find starter files here, and you might find this Wikipedia piano key frequencies page useful.
Arrow Fractal (due 3/23)
Complete the "arrow" fractal we discussed in class today. The generator is a "hump" created by tracing the "outline" of two side-by-side equilateral triangles. This generator is alternated similar to the dragon curve, except the first bump is "in" rather than "out". Here are pictures of the level 1, 2 and 3 curves:
Maze Solver (due 4/1)
Do Exercise 13 from page 220 with the following modifications:
Your program will read a maze from a file, display it on the screen and then solve it. I have put 4 sample maze files here. Here is an example of how the program might look when it runs.
Welcome to the amazing maze solver! Please enter the name of the maze file: test2.txt Here is the initial maze: - - - - - - - - x - x x x - - x x x x x - - x - - - - - x - - x x x - x - x x x x x x - - - - - - Press <Enter> for a solution > > > > > > v - x - x x x v - x x x x x v - x v < < < < x v < x x x - x v x x x x x x > > > > > - Thanks for using the amazing maze solver!
I'd suggest the bulk of your program should be a Maze class. You will have to pick a suitable data structure for storing the map of the maze. Either a list of lists or a dictionary would be a good choice. You might consider the following methods for your class:
__init__(self, filename) show(self) isOpen(self, location) mark(self, location, markerCharacter) unmark(self, location) solve(self) pathToExit(self, location)You will also have to consider how to handle out-of-bounds locations. The easiest thing is probably just to have isOpen return False for these.
Adding a graphical interface would be a nice touch for extra credit points. A graphical maze would use squares and open spaces to display the maze and arrows to show the path. An interesting touch would be to animate the process of finding the path.
Chapter 6 Review (due 4/1, class time)
Do the True/False and Multiple Choice questions from the end of Chapter 6.
decompress.py (due 4/11, midnight)
Do programming exercise 8 from page 249-250. Your program should accept a file name as input and then print out the resulting (decompressed) string to the screen. The example file can be found here.
Chapter 7 Review (due 4/11, classtime)
Do the T/F and multiple choice questions from the end of Chapter 7.