GithubHelp home page GithubHelp logo

yanthink / xqpy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bupticybee/xqpy

0.0 0.0 0.0 540 KB

象棋巫师(非官方)python实现

License: GNU Affero General Public License v3.0

JavaScript 51.64% Python 47.64% HTML 0.72%

xqpy's Introduction

XQpy 象棋巫师(非官方)python实现

XQpy,简单而强的纯python**象棋引擎

介绍

XQpy ,实现了一个很强的**象棋ai,所有逻辑均使用python实现。 总代码量只有1000多行,适合爱好者进行搜索算法学习和魔改,以及整合进其他系统。

XQpy 是象棋巫师XQlightweight 的非官方python版本,是著名象棋引擎象眼eleeye的轻量版本。

使用

下载XQpy后,直接运行python3 play_against_ai.py执行和ai的对弈步骤,下面是一个和ai对弈的sample输出:

你想要: 
	1. 执红先行
	2. 执黑后行
	 请选择:
2

  9 俥傌象士将士象傌俥
  8 .........
  7 .砲.....砲.
  6 卒.卒.卒.卒.卒
  5 .........
  4 .........
  3 兵.兵.兵.兵.兵
  2 .炮..相..炮.
  1 .........
  0 车马.仕帅仕相马车
    abcdefghi


电脑的上一步: c0e2
请输入你的行棋步子,比如 c6c5 
悔棋请输入 shameonme :

电脑默认会进行大约5秒的思考。由于python性能问题,如果追求ai强度,推荐使用pypy3替代python执行本程序,并且给予更多的运算时间,计算速度会提升半个数量级。

特性

  1. 具有elephantfish 所有特性,相比elephantfish强很多,但相应的代码量也更多
  2. 实现开局库
  3. 搜索部分使用纯python实现,很容易翻译成其他语言或对外提供接口

如何学习这个项目

  1. 如果没有象棋引擎基础,推荐先学习这里的文章 https://github.com/bupticybee/elephantfish/tree/master/articles
  2. 在掌握MTD二分搜索算法,空着裁剪,力价值表等概念后,先阅读positioin.py,然后阅读search.py即可完成对本项目的学习

License

GNU GPL v3

xqpy's People

Contributors

bupticybee avatar

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.