开发者

Free JavaScript chessboard [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 8 years ago.

Improve this question

Could anybody suggest a free (as in freedom) and open source JavaScript chessboard? My plan is to hook it up with some server-side Python code, most probably it will be the flask web framework.

I need a really minimal set of features:

  • a way to display a position on the board (not only the initial one) when generating the HTML code by the server-side script. The position can be stored in a list of lists (to emulate a two-dimensional array) and optionally in a FEN (Forsyth-Edwards Notation) string.
  • a way to make moves (by dragging pieces with the mouse cursor) and have the moves automatically submitted to the server-side script via HTTP POST. Validation of moves by th开发者_如何转开发e JavaScript code is not mandatory, because I can do this server-side.


I just released http://chessboardjs.com at v0.1.0 and it seems to fit all of your requirements.

It's open source under the MIT license (ie: as in freedom)


You can check this: htmlchess.sourceforge.net


Try pgn4web. It supports PGN strings and even Chess960. Very easy to customize.


I'm about to try jChess, a jQuery plugin that looks promising. However, I don't think the user can move the pieces out of the box.


Here is a chess board which will definitely satisfy your needs. Out of the box it has:

  • set up fen position
  • multiple boards set up
  • moving pieces, removing pieces, adding pieces
  • different themes of pieces
  • flipping the board
  • and a lot of other things

It is easy to set up (just by doing the following):

JavaScript

var ruyLopez = 'r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R';
var board = new ChessBoard('board', ruyLopez);

HTML

<div id="board" style="width: 400px"></div>

You can get

Free JavaScript chessboard  [closed]

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜