将Chess Engine连接到使用Java语言制作的现有GUI [英] Connecting a Chess Engine to an Existing GUI made with Javascript

查看:109
本文介绍了将Chess Engine连接到使用Java语言制作的现有GUI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经编写了自己的GUI,用于下棋和教学象棋。 GUI的外观是使用HTML编写的,而部件的行为则是使用JavaScript编写的。目前,该程序未遵循任何国际象棋规则。用户应正确遵守国际象棋的规则。这样可以自由设置非法位置或多次移动同一侧。在尝试向初学者教授国际象棋时,这非常有用。

I have written my own GUI for playing and teaching chess. The GUI was written using HTML for the appearance, and JavaScript for the behavior of the pieces. Currently the program does not follow any of the rules of chess. It is up to the user to follow the rules of chess correctly. This allows the freedom to set up illegal positions or move the same side multiple times. This is very useful when trying to teach chess to beginners.

我现在正在考虑要将程序连接到国际象棋引擎的想法。我不知道如何去做。大多数象棋引擎,如StockFish或Rybka,都使用UCI与GUI进行通信。我不知道如何使我的程序与UCI兼容。我对编写自己的国际象棋引擎不感兴趣,我只想下载一个引擎并使其与我编写的GUI交互。

I am now looking at the idea that I would like to hook my program up to a chess engine. I haven't a clue on how to go about this. Most chess engines like StockFish or Rybka use a UCI for communicating with the GUI. I don't know how to make my program UCI compatible. I am not interested in writing my own chess engine, I would simply like to download an engine and have it interact with the GUI that I have written.

由div标签组成,这些片段只是PNG,可以完全独立于国际象棋规则地拖放到板上。理想情况下,我希望能够在GUI上设置任意位置,并将该位置发送到引擎进行分析,并返回最佳移动建议。我什至不需要我自己动手做的程序来为我移动板上的各个部分。

My board is made up of div tags, the pieces are just PNGs that can be dragged and dropped around on the board with complete freedom independent of chess rules. Ideally, I'd like to be able to set up any random position on my GUI, and have that position sent to the engine for analysis, with the best move recommendations returned. I don't even really need the program to move the pieces on the board for me as I can do that myself.

有人知道我如何开始该项目吗?

Does anyone have an idea of how I might get started on this project?

推荐答案

您可以将 http://cinnamonchess.altervista.org/ 与包含以下内容的JS版本一起使用实现您所需的所有特征的Chessboard.js和Chess.js。您也可以改善系统。

You can use http://cinnamonchess.altervista.org/ with the JS Version that includes the chessboard.js and chess.js that implement all the caracteristics you need. Also you can improve the system.

这篇关于将Chess Engine连接到使用Java语言制作的现有GUI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆