This page is aimed to explain to you how your homework 9 is graded.  This is intended for people who have concerns about their grades and are looking for a quick answer before filing a re-grade request.

Homework 9 has the following point distribution:

 
Code isLegalPosition(...) 20%
collapseRows(...) 25%
computeMoveQuality(...) 30%
Style Your coding style 15%
Time log Your time log 10%
This document will describe in detail how your three methods are tested and how you may have lost your points.

 

 

isLegalPosition

 
Both your implementation and the solution are given the same test inputs.  If your implementation does not produce the same results as the solution, you will lose points.
Tests Description Correct Behavior Points
 

Placing a piece out of bounds

We attempt to place a "square" piece on an empty board at position (-1, 0) (that is (row, column)) false 1  
We attempt to place a "square" piece on an empty board at position (0, -1) false 1
We attempt to place a "square" piece on an empty board at position (20,0) false 1
We attempt to place a "square" piece on an empty board at position (0,10) false 1
We attempt to place a "horizontal line" piece on an empty board at position (0,7) false 3
We attempt to place a "vertical line" piece on an empty board at position (17, 0) false 3

Placing an overlapping piece

We attempt to place a "square" piece on UnemptyBoard1 at position (14,6) true 2
We attempt to place a "square" piece on UnemptyBoard1 at position (14,4) false 2
We attempt to place a "horizontal line" piece on UnemptyBoard1 at position (16,0) false 2
We attempt to place a "vertical line" piece on UnemptyBoard1 at position (14,3) false 2
We attempt to place a "square" piece on UnemptyBoard1 at position (15,3) false 2
Total ---- 20
UnemptyBoard1 UnemptyBoard2




 

collapseRows

 
Both your implementation and the solution are given the same test inputs.  If your implementation does not produce the same results as the solution, you will lose points.
Tests Description Correct Behavior Points
  0 row test We give your implementation UnemptyBoard2 no collapse 2  
single row tests We give your implementation Board1 (see below) collapse 1 row (19) 5
We give your implementation Board2 collapse 1 row (18) 3
multiple row tests We give your implementation Board3 collapse 2 consecutive rows (18, 19) 5
We give your implementation Board4 collapse 3 non-consecutive rows (11, 18, 19) 5
We give your implementation Board5 collapse 2 non-consecutive rows (11,19) 5
  Total ---- 25




Board1 Board2 Board3 Board4
Board5





 

computeMoveQuality

 
  Since every implementation's scoring system is different, when testing your computeMoveQuality, we first compute the scores of boards of various height (1, 2, 3, 4, 5, 6, 7, 8)  by giving you a board of that height and a piece that has no filled Cell's (an empty piece).  These scores will be referred to as 'target scores'.  Then we give you a different set of boards that have the same heights and extract these 'test scores'.  We then test to see if the test score and the target score are the same for the same height.  They should be the same since that is what the instruction says.

We also take each of your test heights to compare with the next lower height score.  So for instance, we compare the score of height=4 and the score of height=3.  Height=3 should have a higher score than height=4.  This is also part of the HW instruction.

Next, we give you an empty board with a piece of height 1.  We then compare the result score returned with your previous target score at height=1 to determine if you applied the piece to your board correctly.

Lastly, we give you a board with the last row completely filled except for the last column and a piece that consists of one single Cell.  That Cell is filled.  We place the piece at the right position to see if your implementation returns a score equivalent to the score you give for height = 0.  This tests whether your implementation collapse rows.

A Few Notes regarding the Challenge problem

-  If you had done the challenge problem and did not conform the basic instruction that says "boards of the same max height would have the same score", then  you SHOULD submit a regrade request stating as such.
- The challenge problem takes in an extra piece.  In our auto-grade program, that extra piece is always a piece that does not hae any filled Cell (and Empty piece).  This way the evaluation of your computeMoveQuality is not affected by whether you implemented the challenge problem or not.

 
Tests Description Correct Behavior points
Equal Height => equal score 1 height class per test for height = {1,2,3,4,5,6} must be equal 2 per test
Higher height => worse score every 2 consecutive heights per test for height pairs = {(0,1), (1,2), (2,3), (3,4), (4,5), (5,6)} higher height must give lower score 2 per test
Collapse test see above for description must collapse rows properly 3
apply piece to board test see above for description must apply piece correctly 3
 

Total

  30  
 
FAQ:

Q:   It says "You don't seem to be collapsing rows or apply pieces" for my computeMoveQuality method, but I did use them in my method!

A: Calling these methods is NOT enough.  You have to make use of its return value.  If you did

collapseRows(myBoard);

it obviously does not make use of the return value.  You will need to save the return value and then use that return value to compute your quality points:

Cell[][] collapsedBoard = collapseRows(myBoard);
//now compute the quality scores based on collapsed Board.


 
  Updated:

 4-27-2004