| CPSC 231 - Assignment 5 Marking key | |||
| Note: Your solution to this assignment is supposed to be object-oriented. The max score is 60% if classes and objects are not used (functionality and style marks may be awarded as appropriate but the total score won’t exceed the above value) | |||
| Description | Marks | ||
| Actual | Max | ||
| Coding style | |||
| Appropriate use of white space | 1 | ||
| Self-documenting variable, constant and function names. | 3 | ||
| No global variables (global constants are OK) | 2 | ||
| No magic numbers (using named constants instead) | 2 | ||
| Deep nesting of if statements and loops is avoided (max 3 levels of nesting) | 2 | ||
| Arithmetic expressions are simple and easy to read | 1 | ||
| Boolean expressions are simple and easy to read | 1 | ||
| Sub-total for style | 12 | ||
| Documentation | |||
| Header documentation includes name and tutorial section | 1 | ||
| Header documentation contains description of program. | 2 | ||
| In line documentation used for blocks of code. | 3 | ||
| Sub-total for documentation | 6 | ||
| Code Design: (Using partial solution provided. If you provide you own solution, marks for code design are assigned at markers discretion.) | |||
| Additional functionality for class Board implemented in 5 methods (with possible additional supporting methods.) | 2 | ||
| Each method has at most 30 lines of code. | 3 | ||
| Each method has a single well-defined task | 3 | ||
| All functionality is implemented in a method of a class and not a function | 3 | ||
| All instance variables (with class scope) are logical attributes of the class (not convenience variables used by various methods). | 2 | ||
| Sub-total for design | 13 | ||
| Functionality (only qualify for these marks if the program runs) | |||
| Can read saved games from file | 4 | ||
| Writes saved games to file (half marks if the saved game cannot be reloaded again) | 4 | ||
| Can enter location of piece to move. | 0.25 | ||
| Program checks that the color of a piece selected matches the turn | 4 | ||
| Can enter a direction of movement for a piece | 0.25 | ||
| Can move a piece (consists of multiple components) | |||
| 1) Correctly determines coordinates of the destination | 4 | ||
| 2) Checks that the destination is empty | 2 | ||
| 3) Ensures piece does not move beyond the bounds of the board | 2 | ||
| 4) Piece actually moves (source emptied, piece moves onto destination) | 3 | ||
| Can capture a piece (consists of two components) | |||
| 1) Checks that the destination is empty and within bounds | 2 | ||
| 2) Captured piece is removed from the game | 2 | ||
| Player can pass on a turn | 0.25 | ||
| A player can win the game | 0.25 | ||
| Sub-total for functionality | 28 | ||
| ASSIGNMENT TOTAL | 59 | ||