Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions driver_docs/LICENSE.driver.md

This file was deleted.

2 changes: 0 additions & 2 deletions driver_docs/Makefile.driver.md

This file was deleted.

2 changes: 0 additions & 2 deletions driver_docs/README.md.driver.md

This file was deleted.

12 changes: 12 additions & 0 deletions driver_docs/c_cpp_export_test/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!--------------------------------------------------------------------------------->
<!-- IMPORTANT: This file is auto-generated by Driver (https://driver.ai). -------->
<!-- Manual edits may be overwritten on future commits. --------------------------->
<!--------------------------------------------------------------------------------->

The `LICENSE` file in the `c_cpp_export_test` codebase contains the MIT License, granting permission to use, copy, modify, and distribute the software with certain conditions.

# Purpose
The provided content is a software license known as the MIT License, which is a permissive free software license. It grants users broad rights to use, copy, modify, merge, publish, distribute, sublicense, and sell copies of the software, as long as the original copyright notice and permission notice are included in all copies or substantial portions of the software. This license is designed to maximize freedom for users while limiting liability for the authors, as it explicitly states that the software is provided "as is," without any warranties, and disclaims any liability for damages arising from its use. The inclusion of this license in a software project facilitates open-source collaboration and distribution by clearly defining the terms under which the software can be used and shared.

---
Made with ❤️ by [Driver](https://www.driver.ai/)
12 changes: 12 additions & 0 deletions driver_docs/c_cpp_export_test/Makefile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!--------------------------------------------------------------------------------->
<!-- IMPORTANT: This file is auto-generated by Driver (https://driver.ai). -------->
<!-- Manual edits may be overwritten on future commits. --------------------------->
<!--------------------------------------------------------------------------------->

The `Makefile` in the `c_cpp_export_test` codebase is used to compile and build a Chess implementation in C, handling both library and test executable creation with platform-independent configurations.

# Purpose
This Makefile is designed for building a Chess implementation written in C, facilitating the compilation and linking process using the GNU Compiler Collection (GCC). It defines several variables, such as `CC` for the compiler and `CFLAGS` for compiler flags, which include warnings and optional debugging information based on the `DEBUG` flag. The file uses pattern rules to compile source files located in the `src` and `src/chesslib` directories into object files, and it creates a static library `libchesslib.a` from these object files, excluding the test main object. It also specifies platform-independent rules for generating the test executable, `tests`, and includes targets for cleaning up build artifacts and running tests. The Makefile ensures that the necessary directories are created and that the build process is streamlined for both development and testing purposes.

---
Made with ❤️ by [Driver](https://www.driver.ai/)
19 changes: 19 additions & 0 deletions driver_docs/c_cpp_export_test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!--------------------------------------------------------------------------------->
<!-- IMPORTANT: This file is auto-generated by Driver (https://driver.ai). -------->
<!-- Manual edits may be overwritten on future commits. --------------------------->
<!--------------------------------------------------------------------------------->

C and C++ chess game implementation with source code, headers, tests, build instructions, and licensing.

## Folders
- **[cpp_src](cpp_src/README.md)**: C++ source and header files implementing a chess game with classes for pieces, board, player actions, and game logic.
- **[include](include/README.md)**: Header files for managing chess game components such as the board, pieces, moves, and game state.
- **[src](src/README.md)**: Implements a chess library in C with unit tests and function prototypes for various chess components.

## Files
- **[LICENSE](LICENSE.md)**: The `LICENSE` file in the `c_cpp_export_test` codebase contains the MIT License, granting permission to use, copy, modify, and distribute the software with certain conditions.
- **[Makefile](Makefile.md)**: The `Makefile` in the `c_cpp_export_test` codebase is used to compile and build a Chess implementation in C, handling both library and test executable creation with platform-independent configurations.
- **[README.md](README.md.md)**: Instructions for testing the C/C++ export functionality.

---
Made with ❤️ by [Driver](https://www.driver.ai/)
12 changes: 12 additions & 0 deletions driver_docs/c_cpp_export_test/README.md.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!--------------------------------------------------------------------------------->
<!-- IMPORTANT: This file is auto-generated by Driver (https://driver.ai). -------->
<!-- Manual edits may be overwritten on future commits. --------------------------->
<!--------------------------------------------------------------------------------->

Instructions for testing the C/C++ export functionality.

# Purpose
The file contains the single word `test`, which may serve as a placeholder or marker within the software codebase. It can be used to indicate a test environment, a test case, or a test-related configuration.

---
Made with ❤️ by [Driver](https://www.driver.ai/)
37 changes: 37 additions & 0 deletions driver_docs/c_cpp_export_test/cpp_src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!--------------------------------------------------------------------------------->
<!-- IMPORTANT: This file is auto-generated by Driver (https://driver.ai). -------->
<!-- Manual edits may be overwritten on future commits. --------------------------->
<!--------------------------------------------------------------------------------->

C++ source and header files implementing a chess game with classes for pieces, board, player actions, and game logic.


## Files
- **[bishop.cpp](bishop.cpp.md)**: The `bishop.cpp` file implements the Bishop class for a chess game, defining its movement, value, and display characteristics.
- **[bishop.h](bishop.h.md)**: The `bishop.h` file defines a class representing a chess bishop piece, including methods for determining its value, legal moves, and displaying the piece.
- **[board.cpp](board.cpp.md)**: The `board.cpp` file implements a chess board for the ChessProject, including methods for board setup, checking clear paths for moves, and displaying the board state.
- **[board.h](board.h.md)**: The `board.h` file defines a `Board` class representing an 8x8 game board, including methods for accessing squares, checking clear paths, determining end rows, and displaying the board.
- **[game.cpp](game.cpp.md)**: The `game.cpp` file in the `c_cpp_export_test` codebase implements the initialization and management of a chess game, including setting up the board with pieces and handling player turns.
- **[game.h](game.h.md)**: The `game.h` file defines a class for representing a game of chess, including methods for initializing the game and managing player turns.
- **[king.cpp](king.cpp.md)**: The `king.cpp` file implements the behavior of a chess king piece, including its movement rules and display functionality.
- **[king.h](king.h.md)**: The `king.h` file defines a `King` class that represents a chess king piece, including methods for creating the piece, determining its point value, checking legal moves, and displaying it.
- **[knight.cpp](knight.cpp.md)**: The `knight.cpp` file implements the Knight piece for a chess game, including its movement logic and display functionality.
- **[knight.h](knight.h.md)**: The `knight.h` file defines a `Knight` class that represents a chess knight piece, including methods for creating a knight, determining its point value, checking legal moves, and displaying the piece.
- **[main.cpp](main.cpp.md)**: The `main.cpp` file contains the main program logic for playing a chess game, including initializing the game, displaying the board, and handling player moves.
- **[pawn.cpp](pawn.cpp.md)**: The `pawn.cpp` file implements the behavior of a pawn piece in a chess game, including movement, promotion to a queen, and display functionality.
- **[pawn.h](pawn.h.md)**: The `pawn.h` file defines a `Pawn` class representing a chess pawn piece, including methods for movement, location setting, and display functionality.
- **[piece.cpp](piece.cpp.md)**: The `piece.cpp` file implements the `Piece` class for a chess game, handling piece movement, capturing logic, and color assignment.
- **[piece.h](piece.h.md)**: The `piece.h` file defines an abstract class for a game piece, including methods for movement, color determination, and location management.
- **[player.cpp](player.cpp.md)**: The `player.cpp` file implements the `Player` class for a chess game, handling player actions such as making moves, checking for check status, capturing pieces, and calculating scores.
- **[player.h](player.h.md)**: The `player.h` file defines a `Player` class for a chess game, including methods for making moves, checking if the player is in check, capturing pieces, and accessing player attributes such as name, color, and score.
- **[queen.cpp](queen.cpp.md)**: The `queen.cpp` file implements the Queen class for a chess game, defining its movement capabilities and display representation.
- **[queen.h](queen.h.md)**: The `queen.h` file defines a `Queen` class representing a chess queen piece, including methods for determining legal moves, getting its point value, and displaying the piece.
- **[restrictedPiece.cpp](restrictedPiece.cpp.md)**: The `restrictedPiece.cpp` file defines the `RestrictedPiece` class for a chess project, which extends the `Piece` class to include functionality for tracking whether the piece has moved.
- **[restrictedPiece.h](restrictedPiece.h.md)**: The `restrictedPiece.h` file defines a `RestrictedPiece` class for a chess piece that tracks whether it has been moved, extending the functionality of a generic `Piece`.
- **[rook.cpp](rook.cpp.md)**: The `rook.cpp` file implements the Rook chess piece, including its movement logic and display functionality, for the ChessProject.
- **[rook.h](rook.h.md)**: The `rook.h` file defines a class representing a chess rook piece, including methods for determining legal moves, getting its point value, and displaying the piece.
- **[square.cpp](square.cpp.md)**: The `square.cpp` file implements the `Square` class for a chess project, managing the position and occupancy of a square on the chessboard.
- **[square.h](square.h.md)**: The `square.h` file defines a `Square` class for representing a square on a game board, including methods for setting and retrieving the piece occupying the square, as well as its position.

---
Made with ❤️ by [Driver](https://www.driver.ai/)
93 changes: 93 additions & 0 deletions driver_docs/c_cpp_export_test/cpp_src/bishop.cpp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<!--------------------------------------------------------------------------------->
<!-- IMPORTANT: This file is auto-generated by Driver (https://driver.ai). -------->
<!-- Manual edits may be overwritten on future commits. --------------------------->
<!--------------------------------------------------------------------------------->

The `bishop.cpp` file implements the Bishop class for a chess game, defining its movement, value, and display characteristics.

# Purpose
This C++ code defines the implementation of a [`Bishop`](#BishopBishop) class, which is part of a chess game project. The code provides narrow functionality specific to the behavior and characteristics of a bishop piece in chess. It is not an executable file but rather a C++ source file intended to be used in conjunction with other files, likely as part of a larger chess game application. The [`Bishop`](#BishopBishop) class inherits from a `Piece` class, indicating a hierarchical design where [`Bishop`](#BishopBishop) is a specialized type of `Piece`. The class includes methods to determine the bishop's value, check if it can move to a specified square based on chess rules (specifically moving diagonally), and display the bishop's representation on the board. The use of a destructor and constructor suggests proper resource management, although no dynamic memory allocation is evident in this snippet.
# Imports and Dependencies

---
- `bishop.h`


# Data Structures

---
### Bishop<!-- {{#data_structure:Bishop}} -->
- **Description**: [See definition](bishop.h.md#Bishop)
- **Member Functions**:
- [`Bishop::Bishop`](#BishopBishop)
- [`Bishop::~Bishop`](#BishopBishop)
- [`Bishop::value`](#Bishopvalue)
- [`Bishop::canMoveTo`](#BishopcanMoveTo)
- [`Bishop::display`](#Bishopdisplay)
- **Inherits From**:
- `Piece`

**Methods**

---
#### Bishop::Bishop<!-- {{#callable:Bishop::Bishop}} -->
The `Bishop` constructor initializes a Bishop object with a specified color by calling the base class `Piece` constructor.
- **Inputs**:
- `isWhite`: A boolean indicating whether the Bishop is white (true) or black (false).
- **Control Flow**:
- The constructor `Bishop::Bishop(bool isWhite)` is called with a boolean parameter `isWhite`.
- The constructor initializes the Bishop object by calling the base class `Piece` constructor with the `isWhite` parameter.
- **Output**: There is no return value as this is a constructor for initializing a Bishop object.
- **See also**: [`Bishop`](bishop.h.md#Bishop) (Data Structure)


---
#### Bishop::\~Bishop<!-- {{#callable:Bishop::~Bishop}} -->
The `Bishop::~Bishop()` function is the default destructor for the `Bishop` class, which currently performs no specific actions upon object destruction.
- **Inputs**: None
- **Control Flow**:
- The destructor is called when a `Bishop` object goes out of scope or is explicitly deleted.
- Currently, the destructor does not contain any code, so it performs no operations.
- **Output**: There is no output from this destructor as it is empty and performs no actions.
- **See also**: [`Bishop`](bishop.h.md#Bishop) (Data Structure)


---
#### Bishop::value<!-- {{#callable:Bishop::value}} -->
The `value` function returns the fixed point value of a Bishop piece in a chess game.
- **Inputs**: None
- **Control Flow**:
- The function is a constant member function of the `Bishop` class, indicating it does not modify the state of the object.
- It directly returns the integer value `3`, which represents the point value of a Bishop in chess.
- **Output**: The function returns an integer value of `3`.
- **See also**: [`Bishop`](bishop.h.md#Bishop) (Data Structure)


---
#### Bishop::canMoveTo<!-- {{#callable:Bishop::canMoveTo}} -->
The `canMoveTo` function checks if a Bishop can legally move to a specified square by verifying if the path is a clear diagonal.
- **Inputs**:
- `location`: A reference to a `Square` object representing the destination square to which the Bishop intends to move.
- **Control Flow**:
- Initialize a boolean variable `validMove` to `false`.
- Check if the path from the Bishop's current location to the target `location` is a clear diagonal using `Board::getBoard()->isClearDiagonal`.
- If the path is clear, set `validMove` to `true`.
- Return the value of `validMove`.
- **Output**: A boolean value indicating whether the Bishop can legally move to the specified square.
- **See also**: [`Bishop`](bishop.h.md#Bishop) (Data Structure)


---
#### Bishop::display<!-- {{#callable:Bishop::display}} -->
The `display` function outputs the color and type of the Bishop piece to the console.
- **Inputs**: None
- **Control Flow**:
- The function uses the `cout` stream to output the Bishop's color followed by the letter 'B' to represent the Bishop piece.
- **Output**: The function does not return any value; it outputs directly to the console.
- **See also**: [`Bishop`](bishop.h.md#Bishop) (Data Structure)




---
Made with ❤️ by [Driver](https://www.driver.ai/)
36 changes: 36 additions & 0 deletions driver_docs/c_cpp_export_test/cpp_src/bishop.h.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!--------------------------------------------------------------------------------->
<!-- IMPORTANT: This file is auto-generated by Driver (https://driver.ai). -------->
<!-- Manual edits may be overwritten on future commits. --------------------------->
<!--------------------------------------------------------------------------------->

The `bishop.h` file defines a class representing a chess bishop piece, including methods for determining its value, legal moves, and displaying the piece.

# Purpose
The provided code is a C++ header file, `bishop.h`, which defines a class representing a chess bishop piece. This class, `Bishop`, inherits from a base class `Piece`, suggesting a broader chess game application where different chess pieces are modeled as classes. The functionality of this code is relatively narrow, focusing specifically on the behavior and characteristics of a bishop in a chess game. It includes methods for creating a bishop with a specified color, determining its point value, checking if a move to a given square is legal, and displaying the piece. This header file is intended to be included in other parts of a chess program, where the implementation details of these methods would be defined, likely in a corresponding `.cpp` file.
# Imports and Dependencies

---
- `iostream`
- `piece.h`
- `square.h`


# Data Structures

---
### Bishop<!-- {{#data_structure:Bishop}} -->
- **Type**: `class`
- **Description**: The `Bishop` class represents a chess bishop piece in a chess game, inheriting from the `Piece` class. It includes a constructor to initialize the bishop with a color, a destructor, and methods to get the point value of the bishop, determine if a move to a given square is legal based on diagonal movement, and display the bishop on the board. The bishop's value is set to 3, and it can move diagonally across the board if the path is clear.
- **Member Functions**:
- [`Bishop::Bishop`](bishop.cpp.md#BishopBishop)
- [`Bishop::~Bishop`](bishop.cpp.md#BishopBishop)
- [`Bishop::value`](bishop.cpp.md#Bishopvalue)
- [`Bishop::canMoveTo`](bishop.cpp.md#BishopcanMoveTo)
- [`Bishop::display`](bishop.cpp.md#Bishopdisplay)
- **Inherits From**:
- `Piece`



---
Made with ❤️ by [Driver](https://www.driver.ai/)
Loading