Giter Site home page Giter Site logo

cchesslib's Introduction

cchess

cchess是一个Python版的**象棋库,目标是为

这是一个快速的例子:

1.棋盘表示,走子和中文走子显示

from cchess import *

board = ChessBoard()

board.from_fen(FULL_INIT_FEN)

board.print_board()

move = board.move((0,0),(0,1)))

print(move.to_chinese())

2.读取xqf格式棋谱文件,并显示棋谱内容

from cchess import *

game = read_from_xqf("1.xqf")

game.print_init_board()

game.print_chinese_moves()

3.读取txt格式的棋谱文件,并显示棋谱内容

4.加载引擎进行对弈 参见examples/end_game.py

cchess库使用pytest进行单元测试,使用pytest-cov进行覆盖检查,目标实现100%覆盖。 测试执行:pytest -v --pep8 --flakes --cov=cchess .\tests
代码检测:pytest -v --pep8 --flakes .\src
或者直接执行:pytest

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.