List of Common Mistakes for the 'Snakes And Ladders' (XNA-based) Assignment:

Category

Mistake

Suggested Percentage Of Assignment
(explanation here)
  GameCell:

20

Correctness You don't set the default number of gold points to zero in the GameCell's constructor -3%
Correctness Your code only allows for 0 or 1 gold points - you need to use an int, instead -3%
Correctness Your getCellsToSkip method doesn't return the correct distance -3%
Correctness getCellIndex doesn't return the same index value that was passed into the constructor. -3%
Object Oriented Programming You don't properly encapsulate your classes (the data fields should be declared private, and only those methods that are intended to be used by other classes should be marked public) -4%
  GameBoard:

30

Efficiency

(maybe correctness, too)

Your code allocates objects, but then immediately discards them by overwriting the variable with an existing reference.

(this is the classic
Element e = new Element(...);
e = existingObjRef;
mistake)

-5%
Modular design / Functional Decomposition

You should factor your code into smaller, easier to understand method(s), rather than having a small number of larger methods

-10%
(Failure to abide by the restrictions set forth in the assignment)

The GameBoard object should store the references to the GameCell objects in a 1-dimensional array.

-10-30%
(Failure to abide by the restrictions set forth in the assignment)

The GameBoard object should use the value null to represent cells that have neither gold, nor ladders, in them

-10%
Object Oriented Programming You don't properly encapsulate your classes (the data fields should be declared private, and only those methods that are intended to be used by other classes should be marked public) -4%
  GameBoard.getMaxColumn

5

Correctness

You didn't return the correct number of columns (as specified by the parameter that was passed to the constructor)

-5%
  GameBoard.getBoardSize

5

Correctness

You didn't return the correct number of cells (as specified by the parameter that was passed to the constructor)

-5%
  GameBoard.getCell

5

Correctness

GetCell didn't check that the provided parameter is in the bounds of the array

-2%
Correctness

(Failure to abide by the restrictions set forth in the assignment)

GetCell didn't return null, when the parameter was outside the bounds of the array

-3%
  GameBoard.setPlayerCellByIndex

5

Correctness

SetPlayerCell didn't check that the provided parameter is in the bounds of the array

-2%
Correctness

(Failure to abide by the restrictions set forth in the assignment)

SetPlayerCell didn't set the player's current index to be zero, when the parameter was outside the bounds of the array

-3%
  GameBoard.getCellContainingPlayer

5

Correctness

You don't properly return the GameCell object that the player is currently in (including returning the value null when there is no gold/snake/ladder on the player's cell)

-5%
  GameBoard.getPlayerCellIndex

5

Correctness

You don't properly return the index of the cell that the player is currently in.

-5%
  GameBoard.getTotalGoldOnBoard

10

(Failure to abide by the restrictions set forth in the assignment)

getTotalGold doesn't calculate the total amount of gold by traversing the array
('caching' the answer is nice, and cleverly done, but specifically prohibited by the assignment)

-10%
Correctness

getTotalGold doesn't deal with nulls when traversing the array

-8%
  GameBoard.createRandomSnakeOrLadder

10

(Failure to abide by the restrictions set forth in the assignment)

You didn't checked that the array slot is blank (i.e., that the cell doesn't contain a snake/ladder already)

-4%
Correctness

You didn't created a new object when it should

-10%
Correctness

You didn't ensure that the destination is within the bounds of the array

-5%
(Failure to abide by the restrictions set forth in the assignment)

You didn't chose the destination randomly

-10%
(Failure to abide by the restrictions set forth in the assignment) You didn't ensure that it will not create a link back to the current cell -3%
  Computer Efficiency            (Efficient use of resources, such as memory)

10

Don't create unused variables The variables r1, x, and y are unused – remove them. -1%
 Don't create unneeded local variables

For something like:
double distance = Math.Sqrt(((_centerX - x)*(_centerX - x)) + ((_centerY - y)*(_centerY - y)));
return distance;

you can instead write:
return Math.Sqrt(((_centerX - x)*(_centerX - x)) + ((_centerY - y)*(_centerY - y)));  

-1%
  Style / Presentation

10

Commenting

You didn't comment any of your code. 

-1%
Identify the author of each file

You didn't put your name, etc, at the top of EVERY  source code file, including any files given to you. (The "etc" part includes the name of this class (“Computer Science 1xx”), and the year and quarter, and the assignment number, including the revision number) 

-1%
Quality of presentation

(Make sure that what you've handed in looks good)

Code that you've commented out, because you're no longer using it, should be removed before handing in the assignment.

-1%
Horizontal Indentation Your code isn't formatted entirely consistently – in your C# file, try doing a "Select All", then under the "Edit" menu, under "Advanced", do "Format Selection" -1%
Vertical White Space Your code contains excessive numbers of blank lines in at least one place.   
  OOP-related
(OOP isn't required, nor expected, on this assignment, but sometimes students will have (and use)  prior knowledge anyways)

<NONE>

Proper encapsulation

Within your classes (for this, and future assignments) all data field, methods, properties, etc, should be marked public or private (or protected, or internal, if you choose to look those up on your own, etc) – you left this out in several places.

No points deducted, but feedback to students is good.
C# language specifics

If you're interested, look at the differences between  a class & struct – your AssignmentFunctions is a perfect example of where to use a struct (since it basically just exists to hold data)

No points deducted, but feedback to students is good.
  General Assignment Mistakes  
Submission Mistake You included the "Debug", "bin", or "obj" directories, and you shouldn't have. The assignment specifically said not to do this.

These result in point penalties, since the student has failed to complete one or more parts of the assignment, even though no particular percentage has been assigned to this category.

Submission Mistake

You didn't include the project files, please do so in the future. The assignment specifically said to do this.

 

 

Explanation of Percentages assigned:

Please note that for any given category, the total of the penalties may add up to more (or less) than the total for the category ; many of the mistakes are mutually exclusive (and since they therefore can't all apply, it's ok to add up to more than the category total), and if the student doesn't include any work in a particular category, it is suggested that you remove all points from that category (even if the individual items don't add up to the category total)


This document and the related materials are developed with support from Microsoft Research Computer Gaming Initiative under the Computer Gaming Curriculum in Computer Science RFP, Award Number 15871.