Project 4

This is a new project unrelated to the previous projects.

§1 Task #

In this final project, you will apply many of the concepts and skills you’ve learned throughout this course. Object-oriented programming often operates in the abstract, where “objects” have little connection to real-world entities, this project bridges the gap between theoretical concepts and a tangible system. Your task is to implement a simplified version of the game of chess.

This project challenges you to implement a chess game using object-oriented principles. You will create objects that represent the various components of chess, such as the pieces, board, and the rules governing movement and gameplay. Each object will encapsulate its own state and behavior, allowing you to model the interactions between these objects in a clean and modular way.

If you are not familiar with the game of chess, chess.com provides a helpful cheat sheets on the basic rules and piece moves: https://www.chess.com/terms/cheat-sheet-chess

§2 Info #

In the field of programming, projects are commonly categorized as “Greenfield” or “Brownfield.” These terms refer to the starting conditions of a software project. A “Greenfield” project refers to a new software development initiative that starts from scratch, without any constraints from an existing codebase. A “Brownfield” project involves working with an existing system, which may include modifying, extending, or maintaining an established codebase or infrastructure.

This project is a “Brownfield” project, where you will work with existing code and extend or modify it to accomplish the given tasks.

For this project, I have provided starter code that includes a terminal-based game input handler and renderer. This will allow you to focus on implementing the game logic and rules. You are allowed to make minor modifications the provided rendering code, provided your final implementation adheres to the following requirements:

I suggest working on easier pieces first, in my opinion, easiest to most difficult:
– King, Knight, Pawn, Rook, Bishop, Queen

§3 Base Requirements #

you will implement all the individual chess pieces as classes with a method to calculate valid moves for each piece.

Requirements which are already handled by the starter code:

§4 Extra Credit #

You can earn extra credit by implementing further functionality beyond the chess piece move sets.
You may only earn extra credit if all standard piece move sets are implemented correctly.

(you may implement any or all extra credit items listed here regardless of order):

§5 Non-Extra Credit #

To limit the scope of this project, the following special rules will not count for extra credit if implemented:

§6 Examples #

Expected starting positions, and a valid move set for a knight and bishop, note how each piece is not able to attack its own team:

clean start

valid knight

valid bishop

This next image depicts an invalid move set for a bishop, here this bishop can attack own pieces and move through pieces, which are not valid moves:

invalid bishop

§7 Rubric #

A “correct” implementation of a piece assumes:

Extra Credit:

Maximum Score: 100% + 25% Extra Credit.

WARNING: You will fail with a 0 if the following two requirements are not met:

§8 Starter Code #

The provided starter code is meant to allow you to focus on implementing the chess pieces. This is a basic implementation of the model-view-controller pattern.

Here is how it works:

The terminal-based renderer uses the terminal alt-display to print, which means that a segfault crash will leave your terminal in a broken state. You will still be able to type reset to reset your terminal, then use the up and down arrows to cycle previous commands and run your program again.

Second note: if you see an “unknown character” icon ( or ) instead of unicode characters, this means your terminal does not support unicode, the visual studio code built-in terminal supports unicode on all operating systems, but if you wish you may use ascii representations for the chess pieces instead of unicode icons.

UML example:

UML

§9 Write Up #

Answer the following questions:

§10 Submission #

You will submit:

If you are attempting to earn extra credit, mention what you attempted in your write-up.