Coder Social home page Coder Social logo

xmuli / chinesechess Goto Github PK

View Code? Open in Web Editor NEW
669.0 669.0 175.0 43.12 MB

Cross-platform and online battle platform game based on Qt: Chinese Chess. Also known as:『Xiangqi』『**象棋』

Home Page: https://www.bilibili.com/video/av45509758

License: GNU General Public License v3.0

C++ 71.55% QMake 1.42% CMake 12.59% Shell 4.07% Inno Setup 9.01% Makefile 0.73% Batchfile 0.63%
linux macos qt-chinesechess windows xiangqi

chinesechess's Introduction

Hi there, I'm XMuli👋

A boy who sees the world and always stays curious. Loves open source and sharing, worked at Deepin, one of the Linux distributions.

Life is short, better leave something useful for others.

  • 🔭 I'm doing a lot of research on Qt/C++, and a few other languages.i
  • 🌱 I like some things in life worth remembering.
  • 📫 You can find my contact information on the left.
  • 😄 You can get to know me by reading xmuli.tech.
  • ⚡ I like programming 👨‍💻, reading 📚, cooking 🍽,traveling 🍀,and make new friends 🙈.

Platforms:

tools:

Language:



Come and take a look at this little dinosaur?


chinesechess's People

Contributors

bruce-ch avatar hmsjy2017 avatar kira-yamatoo avatar ryanfortner avatar ubuntuser2012 avatar xmuli avatar zjuyk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chinesechess's Issues

需求

支持和朋友对战嘛?

接受外部PR吗

发现项目里有些影响使用体验的小bug 自己练习的时候顺便改了一些 考虑开个分支接受其他人的pull request吗

添加 Linux ARM 构建

chineseChess 不支持 armhf/arm64,有点可惜,树莓派等 arm 设备无法使用,望支持。

高分辨率下界面显示问题

高分辨率下的界面显示如下图。建议在>=5.6的qt上开启高dpi适配。

int main(int argc, char *argv[])
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
    QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
    QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
    //....
}

chooseGUI
ChessBoard

使用包管理器安装 ChineseChess

目前此方法仅支持 Debian/Ubuntu 的 arm/arm64 架构。

  1. 首先安装脚本所需的依赖 curlpython3
sudo apt install -y curl python3
  1. 添加 Raspbian Addons apt 存储库。
python3 <(curl -fSsL https://cdn.jsdelivr.net/gh/raspbian-addons/scripts@master/utils/repo.py)

根据提示选择一个离你最近的镜像站。

  1. 安装 ChineseChess
sudo apt install chinesechess

如果需要卸载,请执行以下命令:

sudo apt remove chinesechess

对将的情况并没有考虑进去

ChessBoard类的:bool canMoveJIANG(int moveId, int killId, int row, int col)函数需要考虑对将的情况

bool ChessBoard::canMoveJIANG(int moveId, int killId, int row, int col)
{
    //对将的情况
    if (killId != -1 && m_ChessPieces[killId].m_emType == m_ChessPieces->JIANG)
        return canMoveCHE(moveId, killId, row, col );
    //请加上这一段

    if(m_ChessPieces[moveId].m_bRed) //红 将
    {
        if(row < 7 || col < 3 || col > 5)
            return false;
    }
    else  //黑 将
    {
        if(row > 2 || col < 3 || col > 5)
            return false;
    }

    int dr = m_ChessPieces[moveId].m_nRow - row;
    int dc = m_ChessPieces[moveId].m_nCol - col;
    int d = abs(dr)*10 + abs(dc);
   
    if(d== 1 || d == 10)
        return true;

    return false;
}

【功能请求】libp2p 联机

libp2p 不协议公网IP 就可以和全世界玩象棋的人联机!

为什么是libp2p
考虑使用 libp2p 作为网络层来创建健壮的 P2P 应用程序有几个原因:

模块化:libp2p 被设计为模块化,允许开发人员混合和匹配不同的组件以满足他们特定应用程序的需要。这使得定制网络堆栈变得容易,以满足任何 P2P 应用程序的特定要求。

广泛的传输可配置性:libp2p 提供了一组可以适应支持各种传输协议的规范,允许 libp2p 应用程序在各种运行时和网络环境中运行,因为丰富的传输协议选择使得在各种场景中使用 libp2p 成为可能。

多功能性:除了支持广泛的传输之外,libp2p 还提供了一系列的发现机制、数据存储和检索模式,并且还以多种编程语言实现,为开发人员在构建 P2P 应用程序时提供了极大的灵活性。

安全性:libp2p 包括几个安全特性,例如使用公钥加密的对等身份验证和使用现代密码算法的对等点之间的加密通信

健壮性:libp2p 是一种健壮可靠的网络协议,旨在承受压力、干扰和变化。它的特性和设计选择确保它能够在广泛的环境中有效和高效地运行,并且能够从中断或故障中快速恢复。它还通过使用缓解技术提供针对网络攻击的保护。

弹性:P2P 网络通常比传统的客户端-服务器网络更具弹性,因为没有单点故障。libp2p 包括对等点发现内容路由等功能,这些功能有助于确保网络保持可用和可访问性,即使某些对等点离线或无法访问也是如此。

效率:P2P 网络可以更有效地利用资源,因为数据分布在多个对等点而不是存储在**服务器上。libp2p 包括各种存储和检索模式,允许开发人员在网络上有效地分发数据,从而可以以经济高效且可扩展的方式存储和检索数据。

穿透 NAT 障碍:libp2p 配备了NAT 遍历功能,即使在 NAT 设备或防火墙后面,也允许对等点之间进行 P2P 通信。这有助于保持网络的连通性,并确保尽管存在这些障碍,网络仍可访问。

消息分发和传播:libp2p 使用的一种模式是发布/订阅 (pubsub),它允许发送者(发布者)向多个接收者(订阅者)发送消息,而发布者不必知道订阅者是谁。libp2p 通过使用像gossipsub这样的协议来实现 pubsub ,为开发人员提供了一种在其 P2P 应用程序中交换数据和消息的灵活有效的方法。

互操作性:不同编程语言中的 libp2p 实现和跨版本的 libp2p 版本旨在相互互操作。这使得来自不同语言生态系统的应用程序能够无缝通信。这有助于促进健康、互联的 P2P 应用生态系统。

去中心化:P2P 网络的主要优势之一是它们的去中心化性质,允许它们在没有**授权的情况下运行。libp2p 旨在促进对等点之间的去中心化通信,从而可以构建 P2P 应用程序以抵抗审查并在面对网络中断时更具弹性。

其他联机协议

devp2p
hyper://
gemini://
Earthstar
Pigeon
Yggdrasil
QUIC 协议

AI无效

用Qt6编译后玩家和AI对战模式下, AI不会自动走子, 效果和玩家自己对战一样.

【功能请求】pc象棋AI,自我深度学习

可以加入AI训练吗?
我们可以训练AI
我们需要最新的AI棋谱
https://katagotraining.org/ 这是一个非常成功的AI训练例子,你可以参考看看。虽然它是围棋的,它现在已经拥有2千万张棋谱,还在不断的增长。
象棋很多人还用那些古谱来练习象棋,那些已经过时了,象棋比围棋更有优势,象棋可以马上让人进入深度计算思维。

仙女鳕鱼 象棋AI引擎
https://github.com/ianfab/Fairy-Stockfish

这里有一个象棋的例子,
https://medium.com/applied-data-science/how-to-build-your-own-muzero-in-python-f77d5718061a https://github.com/chengstone/cchess-zero

佳佳象棋 Ai
https://github.com/leedavid/leela-chess-to-Chinese-Chess
http://www.ggzero.cn/
http://www.ttyes.com/

HelloGitHub 徽章计划

🎉 恭喜!您的项目已被 HelloGitHub 社区收录和推荐,现邀请您加入 HelloGitHub 徽章计划。加入后,您将获得以下特权:

  • 社区认可: 徽章代表你的项目已通过 HelloGitHub 社区的严格筛选,并获得推荐。
  • 提高曝光: 佩戴徽章后,你的项目将获得更多推荐流量,吸引更多用户和贡献者。
  • 增强互动: 用户可通过徽章快速了解项目,并与之互动(点赞、评论、收藏)。
  • 收集反馈: 获取广大用户的真实反馈,持续优化你的项目。
  • 特殊标识: 认证后,你的评论将有显著标识,并获得置顶优先权。

📌 立即点击 完成徽章佩戴,加入 HelloGitHub 徽章计划,让你的开源项目绽放更耀眼的光彩。


HelloGitHub,一个专注于发现、分享、推广开源项目的社区。自 2016 年创立以来,从每月一更的月刊发展到今天,已经成为一个拥有超过 1 万 用户的充满活力的开源社区。我们的足迹遍布多个内容平台,并获得了全网 50 万 粉丝的信赖与支持。

截屏2024-06-12 09 29 42

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.