pset5 - MIT OpenCourseWare http:/ocw.mit.edu 6.00...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
MIT OpenCourseWare http://ocw.mit.edu 6.00 Introduction to Computer Science and Programming Fall 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms .
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6.00: Introduction to Computer Science and Programming Problem Set 5: Wordgames Handed out: Thursday, October 2, 2008 Due: 11:59pm, Thursday October 9, 2008 Introduction As children, we loved wordgames like Ghost. So, like any good parent or teacher, we'll now force you to do the things that interested us when we were younger. In this problem set, you'll implement two wordgames : first, we'll help you through implementing the 6.00 wordgame, and then you'll implement Ghost on your own. Don't be intimidated by the length of this problem set. It's a lot of reading, but it is very doable. Let's begin by describing the 6.00 wordgame: This game is a lot like Scrabble or Text Twist, if you've played those. Letters are dealt to players, who then construct one or more words out of their letters. Each valid word receives a score, based on the length of the word and the letters in that word. The rules of the game are as follows: Dealing A player is dealt a hand of n letters chosen at random (assume n=7 for now). The player arranges the hand into a set of words using each letter at most once. Some letters may remain unused (these won't be scored). Scoring The score for the hand is the sum of the score for the words. The score for a word is the sum of the points for letters in the word, plus 50 points if all n letters are used on the first go. Letters are scored as in Scrabble; A is worth 1, B is worth 3, C is worth 3, D is worth 2, E is worth 1, and so on. We have defined the dictionary SCRABBLE_LETTER_VALUES that maps each lowercase letter to its Scrabble letter value. For example, 'weed' would be worth 8 points (4+1+1+2=8), as long as the hand actually has 1 'w', 2 'e's, and 1 'd'. As another example, if n =7 and you get 'waybill' on the first go, it would be worth 65 points (4+1+4+3+1+1+1=15, +50 for the 'bingo' bonus of using all seven letters). Workload Please let us know how long you spend on each problem. We want to be careful not to overload you by giving out problems that take longer than we anticipated. Collaboration You may work with other students. However, each student should hand in the assignment separately. Also, be sure to indicate with whom you have worked. This is the collaboration policy for all the problem sets in this course. Getting Started 1. Download and save ps5.py: the skeleton you'll fill in for Problems 1-5 test_ps5.py: Unit tests for some of your code (more on this later) ps5_ghost.py: the skeleton you'll fill in for Problem 6 words.txt: the list of valid words (all words acceptable in North American Scrabble up to 10 letters long)
Background image of page 2
Make sure to put all of the files in the same directory! 2. Run the code
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/12/2010 for the course EECS 6.00 taught by Professor Grimson during the Spring '08 term at MIT.

Page1 / 12

pset5 - MIT OpenCourseWare http:/ocw.mit.edu 6.00...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online