Skip to content
/ chess Public

A C++ command-line chess game with basic mechanics, including piece movement, promotion, and turn-based play. It uses modular classes for game logic and board management.

License

Notifications You must be signed in to change notification settings

Wisoxx/chess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chess CLI Game

C++

Introduction

This project is a command-line interface (CLI) chess game implemented in C++. It provides a simple and interactive way to play chess directly from the terminal. The game follows standard chess rules, with some exceptions (e.g., castling and en passant are not implemented).

Features

  • Fully interactive CLI-based gameplay
  • ASCII symbols representing chess pieces
  • Alternating turns between black and white pieces
  • Movement restricted to legal chess moves (except castling and en passant)
  • Pawn promotion with selectable piece options
  • Win condition when a king is captured
  • Board rotation for perspective switching
  • Simple command-based controls:
    • exit - Quit the game
    • swap - Rotate the board
    • Move a piece using coordinate chess notation (specifying only start and end square e.g., c2-c4)

Project Structure

Object-Oriented Design:

  • Base Piece class with derived classes for each chess piece
  • Board class managing game state and piece placement
  • Side class organizing pieces by color
  • Game class handling gameplay logic
  • IO module for user interaction and board visualization

Data Structures Used:

  • std::list for dynamic piece management
  • std::vector<std::string> for storing possible moves
  • std::wstring for Unicode-based board rendering
  • bool flags for tracking game state

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A C++ command-line chess game with basic mechanics, including piece movement, promotion, and turn-based play. It uses modular classes for game logic and board management.

Topics

Resources

License

Stars

Watchers

Forks

Languages