CSE 116 - Fall 2007 - Banner
   CSE 116 - Fall 2007 - Introduction to Computer Science for Majors II
CSE 116 - Fall 2007 - Left Navigation CSE 116 - Fall 2007 - Lab 1 Contents

Stage 1

Group Assignments

Group assignments for this stage of the project are located here.

Objectives

This is stage #1 of the course project. The main concepts covered are:

  • software development in a small team setting,
  • development of a design for a medium-sized software project,
  • building a suite of unit tests, and
  • developing a simple, flexible and robust design through appropriate use of design patterns.

Description

You have been employed by a small game manufacturer named KnowSys. This company has more programming talent than game-creation talent. Its developers create on-line versions of popular board games. Since the games this company develops cannot be exactly the same as the board games on which they're based, the games produced are always extended and changed in interesting ways (from a programming perspective).

You have been assigned to a development team whose task is to design an on-line game similar to a very popular word game called Scrabble (TM of Hasbro). If you haven't played Scrabble you should try it - it's fun! We're serious! If you haven't played Scrabble, get together with your team members on a Friday night and play. Consider it homework. You will have a much better understanding of the issues involved if you have played the game, even though this game differs in several important respects.

Description of pieces used to play

The game is played on a board with a 12x12 grid and a set of 144 letter tiles. Each tile has an (upper-case) letter from the English alphabet inscribed on it as well as a point value. The point values of the tiles, as well as quantity of each type of tile, is given in the table below:

Letter Number of tiles Point value
A 12 1
B 3 5
C 6 3
D 6 3
E 14 1
F 3 5
G 3 5
H 6 3
I 12 1
J 1 10
K 1 10
L 6 3
M 3 5
Letter Number of tiles Point value
N 10 1
O 12 1
P 3 5
Q 1 10
R 10 1
S 10 1
T 10 1
U 3 5
V 1 10
W 3 5
X 1 10
Y 3 5
Z 1 10

The rows and columns of the board divide it into regions called squares. Note that a square is distinct from a tile. A tile may be place on a square during game play. One of the squares is chosen at random to be the "home square".

Preparing to play

Before the game begins each player is given twelve tiles. These tiles are kept hidden from the other players. The order of initial play is determined at random, but once determined is fixed for the rest of the game.

How to play

Players alternate turns trying to form words on the game board. Words may be formed horizontally (reading left to right) or vertically (reading down), but never diagonally. A word must be at least two letters long.  The first player to place a word must place one of the tiles of their word on the "home square". In subsequent turns the word which a player places on the board must intersect with or touch an existing word on the board. Examples are shown below.

The word placed (which we’ll call the primary word) as well as any other words formed (which we’ll call secondary words) must in general be valid words. Validity checking is very simple for this first stage: any combination of letters is considered to be a valid word. In later stages a more sophisticated form of validity will be required.

If at the end of a player’s turn they have less then twelve tiles they are given tiles to replenish their supply (so that they again have twelve tiles), assuming this is possible. If there aren’t enough tiles to replenish a player’s supply they get all remaining tiles. Once there are no tiles remaining, players continue the game with the tiles they have.

The game ends if no player can form a valid word with the tiles they have, or if one player places all of his or her tiles on the board and there are no more tiles to pick up.

Word placement examples

Here are some examples showing how words can be placed on the board. The first word must be placed over the "home square”, either vertically or horizontally. For example, if the first word played is "dog" it can go in any of the following ways. The letter placed over the “home square” is CAPITALIZED.

Dog

dOg

doG

D    d    d
o O o
g g G

Assume that the first word is placed as shown:

dOg

Player 2 might form the word "save" and place it as shown:

dOgs
a
v
e

Player 3 might form the word "old" using the letters "l" and "d" from their own tiles and the "o" which is already on the board:

dOgs
l a
d v
e

Aside from the first word placed, every word put on the board must use a letter of an existing word (this is what player 3 did) or add a letter to an existing word to form a new word (this is what player 2 did).

Suppose now that player 4 wants to place the word "gag". Assuming we are checking words for validity there is only one placement possible:

  g
a
dOgs
l a
d v
e

The other two placements are not permitted because for either placement the other letter combinations formed are not valid words.  Consider the first alternate placement:

dOgs
laa
dgv
e

This is not allowed since "laa" and "dgv" are not legal words. The second alternate placement (shown below) is also not permitted because "lgag" is not a word, and neither is "gg":

dOgs
lgag
d v
e
In stage one (this stage) all these placements must be allowed, since no validity checking is to be performed.

How to score

At the end of each turn the score for the word that the player placed on the board is calculated and added to the player's overall score. The score for a word is the sum of the point values for each of the tiles that were placed.

Scoring example #1

Suppose the word "dog" is the first word placed on the
board, as in the placement example given above. 
Since
   d has a point value of 3
   o has a point value of 1
   g has a point value of 5

the score is 3 + 1 + 5 = 9.

Scoring example #2

Suppose the word "save" is the second word placed on
the board, as in the placement example given above.  Since two
words were formed by the tile placement, “dogs” and
“save”, both words are scored. 
Since
   d has a point value of 3
   o has a point value of 1
   g has a point value of 5
   s has a point value of 1

the score for “dogs” is 3 + 1 + 5 + 1 = 10, and since

    s has a point value of 1
    a has a point value of 1
    v has a point value of 10
    e has a point value of 1

the score for “save” is 1 + 1 + 10 + 1 = 13.  The total score for this turn is 10 + 13 = 23.

Scoring example #3

Suppose the word "old" is the third word placed on the
board, as in the placement example given above.  Even though only
two tiles were placed on the board by the player on their turn
(“l” and “d”) they get points for all the
tiles that are part of the word.  Therefore,
since
   
   O has a point value of 1
   l has a point value of 3
   d has a point value of 3

the score is 1 + 3 + 3 = 7.

How to win

The player who has the greatest number of points at the end of the game wins.

Stage 1 requirements

Please read the following requirements carefully!  While the final game will require more functionality, the customer expects the following in the first release.

Functionality

The following functionality must be present in the system.  Note that a graphical user interface is NOT desired at this point.  A purely text-based user interface must be provided instead.  The following functionality must be verified via unit tests that you write.

Game set-up

  • Registration of the number of players.  At this point only two players are required.  It is acceptable if the program assumes that there are exactly two players.
  • The names of the players must be entered.
  • Order of play must be determined randomly, and all players must be informed of the order of play.
  • Players must be given their initial tiles.
  • The “home square” must be chosen at random.
  • The initial (empty) board configuration must be shown, with the “home square” clearly identified.

Game play

  • Players must be given an opportunity to play their turn in the order determined in the game set-up.
  • At the beginning of a player’s turn the current state of the board must be shown to the player. This must include a display of the current player's available tiles (but must not include the tiles of any other player, nor the remaining available tiles).
  • On a player’s turn they must be able to,
  • A player will only be allowed to complete their turn if the tiles are placed on the board in a legal configuration (over the home square on the first turn, connecting to an existing word on subsequent turns; furthermore all tiles placed must be in a straight line, and in a contiguous block).
  • A player may complete their turn even if the word placed is not valid (i.e. every word must be considered valid).
  • Once a player has completed their turn all of the words they formed during that turn are scored, and the sum of the scores of all of the words is added to the player’s overall score.  The player receives new tiles from the tile supply, as described above.  The player must be informed of each player’s score, including their own new score, and of how each of their words was scored.

Game completion

  • Once the game is finished the player with the highest score is announced, and the players are listed in order of their score, from highest to lowest, in the following format: “Name : Score”

Package naming

Your code must be placed in packages as appropriate. None of your code may be in the default package.  Your packages must be named “edu.buffalo.cse.teamX.???”, where X is the number of your team and ??? is the name of the package.  You must at a minimum have one package for your code, and one package for your unit tests.

Code documentation

You must document every class and every class member using Javadoc documentation comments. See the Javadoc Tool Home Page for more information. See in particular the page How to Write Doc Comments for Javadoc and javadoc - The Java API Documentation Generator.

Technical guide

You must submit a technical guide which describes the design of your project, testing that you have done, any required functionality which your project does not implement or does not implement properly, etc.  The technical guide must be either a PDF or a Word document.

Teams

Teamwork guidelines

It is important that there is a roughly equal division of labor amongst teammates. It is unacceptable for one person to be expected to do most of the work. Given the structure of the program it is also most unlikely that this person will successfully complete the project. Teammates who are not doing work will receive a grade of 0 for the project.

If you are having trouble with an unmotivated group member you should seek to solve the problem at the group level first. If this does not work, you may seek the aid of the instructor. However, be warned that when seeking the instructor's aid we will verify the teamwork points given to the individual. Bottom line is that if that person had previously been given good reviews, no action will be taken.

Team meetings

To help you manage your time, here are some do's and don'ts for recitation:

  • Do NOT write code during recitation time.
  • Do discuss
    • accomplishments (goals met) since last meeting
    • problems (goals not met) that have come up since last meeting
    • goals for next meeting
    • schedule for the next week for pairs to meet to pair program
  • Do have someone take notes each meeting, and keep notes in your repository. You will be required to submit one set of meeting notes per week.
  • Do compromise.
  • Do NOT exclude team members - use all your team's resources.

Team peer-evaluation mechanism

The project submission for a team is graded as a whole, but each team member receives an individual grade which is based on that submission grade. The procedure for calculating individual grades is described below. The procedure is based on an assessment of each team member's contribution to the overall project submission. To assess individual member's contributions we will use a peer-based evaluation mechanism. Here's how it works. Each person is given 10 points per group member to award. For example, for a team of five, each team member has 50 points to divide amongst all the team members, including themselves. A team member may award a maximum of 15 points to any one person.

Points should be awarded to team members as an indication of your perception of how much work they did relative to others on the team. If you feel everyone did about the same amount of work you should award everyone 10 points.

Notice that you evaluate your own contribution. Notice also that you must award all of the points you have available to you. Finally, be aware that the peer evaluations are submitted individually and are confidential – your teammates will NOT know how you rated them.

After we get all of the peer evaluations we will calculate the average of the points allotted to each team member.

Your individual grade project will be your average score multiplied by the overall project score, divided by 10.

Example

Consider a group made up of Cindy, Peter, Sally and Ulrik. As usual Sally does a fantastic job, Cindy and Ulrik do a moderate job but Peter didn't do much of anything. The table below shows the points that each team member awarded to the others.

 

Sally awards

Cindy awards

Ulrik awards

Peter awards

average

Points awarded to Sally -->

12

15

15

14

(12+15+15+14)/4 = 56/4 = 14

Points awarded to Cindy -->

11

10

9

6

(11+10+9+6)/4 = 36/4 = 9

Points awarded to Ulrik -->

11

9

10

6

(11+9+10+6)/4 = 36/4 = 9

Points awarded to Peter -->

6

6

6

14

(6+6+6+14)/4 = 32/4 = 8

Sally's average score is 14. Cindy and Ulrik each have an average score of 9. Peter trails the pack with an average score of only 8.

If this team's project submission received 80% overall, then Sally would get 112% (!), Cindy and Ulrik would each get 72%, but Peter would get only 64%. Since Peter’s scores were so unbalanced we would look carefully at the documentation in the code to see what each of the team members contributed, and based on this we might adjust (either up or down) the score of any individual; the team as a whole would likely be called in for a meeting to find out what is happening with the team.

In extreme cases I reserve the right to ignore the peer evaluations and grade students based on their documented contribution to the project.

Team Submission

Each team must submit one jar file, exported from your eclipse workspace, containing:

  • Source code, properly javadoc'ed (do NOT include .class files), together with .project and .classpath files, and any UML class diagrams you think may be useful for the graders.
  • Technical guide
  • Team meeting notes

IMPORTANT! Name your jar file with using your team designation as follows. If your team is cse116i, then name your jar file

cse116i-stage1.jar
Note that this is all lower case!

The submission deadline is on or before 11:59.59 PM on Sunday, September 30, 2007. The submission command is "submit_cse116".

Individual Submission

Each member of your team is required to submit a peer evaluation file. You must name your peer evaluation file with the following format:

team-peer-yourLastName-1.txt
For example, if your team is cse116i, and your last name is Smith, then name your peer evaluation file:
cse116i-peer-smith-1.txt
Note that this is all lower case! The submission command is "submit_cse116".

CSE 116 - Fall 2007 - Footer

 

 
Last modified: Mon Oct 1 16:15:32 2007