Coder Social home page Coder Social logo

xiangqi-core's Introduction

Xiangqi-Core Nuget Package

Description

Xiangqi-Core is a comprehensive library designed to facilitate the development of applications related to Xiangqi (Chinese Chess). It provides a robust set of functionalities including move generation, move validation, game state management, etc. Built with flexibility and performance in mind, XiangqiCore aims to be the go-to solution for developers looking to integrate Xiangqi mechanics into their software.

Features

  • Fluent API: Provides a fluent API for easy configuration and initialization of game instances.
  • Game State Management: Easily manage game states, including piece positions, turn tracking, and game outcome detection.
  • Parsing of Move Notations: Supports parsing of move notations in UCCI, Chinese, and English, allowing for versatile game command inputs.
  • Move Validation: Validate player moves, ensuring moves adhere to the rules of Xiangqi.
  • Utility Functions: A collection of utility functions for piece and board management, including piece movement simulation and position checking.

Installation

Xiangqi-Core is available as a NuGet package. You can install it using the NuGet Package Manager or the dotnet CLI.

dotnet add package Xiangqi-Core

Usage

To get started with Xiangqi-Core, first import the package into your project:

using XiangqiCore;

Here's a simple example of setting up a game board and making a move:

// Create a new game instance with the help of the XiangqiBuilder
XiangqiBuilder builder = new (); 
XiangqiGame game = builder.UseDefaultConfiguration().Build();
	
// Make a move
game.MakeMove("炮二平五", MoveNotationType.Chinese);

Refer to the documentation for more detailed examples and usage instructions.

Contributing

Contributions to Xiangqi-Core are welcome! If you have suggestions for improvements or bug fixes, please feel free to fork the repository and submit a pull request.

License

Xiangqi-Core is licensed under the MIT License. See the LICENSE file for more details.

Contact

For questions or support, please contact [email protected]

xiangqi-core's People

Contributors

chijason99 avatar

Watchers

 avatar

xiangqi-core's Issues

Fen Validation

Create a class called Fen Validator, that can validate the input FEN and return a boolean value.
Unit test for the validator as well

Move method in XiangqiGame

The move method should modify the board position

Move method should have several overloads:

  1. Move notation + move notation enum
  2. Starting coordinate and destination coordinate

Create board after creating the the game instance

After creating a xiangqi game instance with the xiangqi builder, there should be a board inside the Game object. It should be generated from the FEN, and there should be DIfferent pieces and validation. It would be a big feature

documenation

write the documentation for the apis and the project

Move notation

In the board, create a method called generate move notation, that would take the starting coordinate and ending coordinate, and making a move.

Should make custom attributes to simply the work

Note that the pawn would have a different move notation when there are more than two pieces in the same file

Bonus: able to provide options for different type of notation(english notation, chinese notation)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.