06-chess/README.md

2.5 KiB

IF.03.22 POSE - Procedural Programming

Assignment: Chess

Implementation of a chess board using multiple files and unit test.

Introduction

Your task is to implement some basic chess functions. We will focus on management functions (initializing, placing chess pieces on the board, etc.) and initial considerations about how chess pieces can threaten each other (Do two different squares share a movement path of a specific chess piece?).

Basics

Chess is played on a square board with eight columns (files, labeled with the letters "a" to "h") and eight rows (ranks, labeled with the numbers 1 to 8). A square is uniquely identified by the combination of a file label and a rank label. Many of the functions to be implemented will deal with these positions.

For illustration, here is a depiction of a chessboard:

Chess Board

Using the Project

Execution

After a successful build, you can run the program in the following ways:

  • ./chess A chessboard with the pieces in their starting positions will be displayed.
  • ./chess test The automated unit tests will be executed.

Project Components

The project consists of the following files:

  • makefile: Used to control the make utility.
  • chess_main_driver.cpp: Contains the main() function that displays a chessboard with the pieces in their starting positions.
  • chess_test_driver.cpp: Contains the main() function that runs the automated unit tests.
  • test_chess.h: Contains all prototypes for the test functions.
  • test_chess.cpp: Contains the implementation of all test functions and some general data used for the test functions.
  • chess.h: Contains the data structures used in this project and the prototypes of the functions you need to implement.
  • chess.cpp: Contains the skeleton implementations of the functions you need to implement.
  • general.h: Contains macro definitions for MIN and MAX.
  • shortcut.h, shortcut.cpp: Contain functions for executing the automated tests. You do not need to worry about these files.
  • chess_printer.h and chess_printer.c: Contain functions for displaying a chessboard in an ASCII terminal. These are not relevant to your work.
  • mainpage.h, Doxyfile: Files for generating the documentation you are currently reading. You do not need to worry about these files.

Note: for further details read the problem statement (de).