10 ms·
ChessBoardJS
- jiggy2011 13y agoThis doesn't seem to actually play chess.
- omra 13y agoI don't think it's meant to play chess, it's just to show chess positions (see the example page: http://chessboardjs.com/examples http://chessboardjs.com/examples). It is in a similar vein to this: http://andrewphoy.github.io/chess-replayer/ http://andrewphoy.github.io/chess-replayer/. (Which is more full-featured.)
- twistedpair 13y agoNot much to see here. Why is this JS? Usually JS requires some interaction. Even lightbox flew around and did something. This would be even easier as a chessboard PNG rendering REST service.
- Nilzor 13y agoBecause PNG-rendering REST services wouldn't make it to the front page of HN
- chrisoakman 13y agoChessBoard supports drag-and-drop pieces: http://chessboardjs.com/examples#2006 http://chessboardjs.com/examples#2006
- nilliams 13y agoDrag and drop pieces and the pieces can take each other, so you could use this to animate/play-back a full game, or as the basis for a chess game.
- twistedpair 13y agoTouche, tried dragging all the pieces I saw on the demos. Perhaps it's too late on a Friday for them to move.
- chrisoakman 13y agoChessBoard is designed to be "just a board" and integrate easily with chess engines, etc. https://github.com/oakmac/chessboardjs/blob/master/README.md https://github.com/oakmac/chessboardjs/blob/master/README.md I have an issue to build an example that demonstrates integration with chess.js and only allows legal moves (https://github.com/oakmac/chessboardjs/issues/19 https://github.com/oakmac/chessboardjs/issues/19)
- defrex 13y agoThis project needs a better example on the homepage, I think. This one is interesting: http://chessboardjs.com/examples#3004 http://chessboardjs.com/examples#3004
- notjustanymike 13y agoAgreed, it demonstrates that you could theoretically animate an entire chess game with a setInterval.
- chrisoakman 13y agoFunny; I actually built a demo that did this for the homepage, but decided it was too complex and scrapped it for later.
- gidan 13y agoNothing related but see: http://lichess.org/ http://lichess.org/ (source code https://github.com/ornicar/lila https://github.com/ornicar/lila)
- johnwards 13y agoAlso has the best CAPTCHA ever. http://en.lichess.org/signup http://en.lichess.org/signup
- jonnymkramer 13y agoWorst CAPTCHA ever. Trivial for a computer to work out, hard for a human.
- ca98am79 13y agohaha, nice! Although wouldn't computers be way better than humans at this?
- antoinec 13y agoYeah, probably, I took a look at the code, it seems easy to extract positions with few jquery lines, and I guess there is probably an API for resolving chess mates problems!
- cgore 13y agoAlthough, they would probably prefer having computers capable of playing chess sign up than humans that can't.
- kristopolous 13y agoreminds me of the js1k/2010 #2 winner: http://js1k.com/2010-first/demo/750 http://js1k.com/2010-first/demo/750 This one is playable.
- sneak 13y agohttps://en.wikipedia.org/wiki/List_of_burn_centers_in_the_United_States https://en.wikipedia.org/wiki/List_of_burn_centers_in_the_Un...
- eksith 13y agoOuch ;) On a less painful note, these types of scripts that do so much with so little are exactly the type of problem that interest me. I don't even care that I was beaten; I just love the fact that something like this exists. Just goes to show how algorithmic chess can be. And code, no matter how "primitive" will trump neurons when it comes to algorithms.
- cschneid 13y agoPlease don't bring reddit style here. There's plenty of reddit on reddit. This kind of snark detracts from what makes this site good.
- Kiro 13y agoI don't understand.
- gamegoblin 13y agoIn American English, slang for an insult is a "burn". e.g. "You got burned" = "You were insulted" The poster was making a joke that the OP had been insulted because this other JavaScript board is superior or something, hence, he directed him to treatment centers for a "burn". This is very common on reddit.
- ca98am79 13y agoyeah that's really awesome. But you can't castle, and a promoted pawn always becomes a queen
- kayoone 13y agoShould be fairly easy to make this understand the basic movements. Add some node-js multiplayer and off you go.
- Oculus 13y agoThat actually sounds like a fun little practice project.
- AnIrishDuck 13y agoI actually built almost exactly this on top of dotcloud a while back: http://chessjs-anirishduck.dotcloud.com/new http://chessjs-anirishduck.dotcloud.com/new I initially based it off a wild idea my coworker and I had about a chess variant where any piece that captures another piece has the option of becoming that piece. I then expanded it with several other chess rule variants, including vanilla chess. One thing worth mentioning is that the rules for chess are deceptively complex. Especially when it comes to valid moves avoiding check and moving out of check. See: https://github.com/AnIrishDuck/chess.js/blob/master/chessjs/static/js/rules/base.js https://github.com/AnIrishDuck/chess.js/blob/master/chessjs/...
- moron4hire 13y agoMine from a decade ago is suitable for play-by-email http://wedusc.com/web-chess/?7567 http://wedusc.com/web-chess/?7567
- oakaz 13y agoPure HTML Chess Board with FEN support; http://azer.github.io/chessboard/initial.xml http://azer.github.io/chessboard/initial.xml
- chrisoakman 13y agoHi; this is a pleasant surprise :) I wrote this component. Happy to answer questions, feedback, etc.
- ridiculous_fish 13y agoA while back, I attempted to write a chess site that let you paste in chess games in PGN text format, and then step through them. What I found was pretty shocking: the PGN format looks simple, but is remarkably difficult for a computer to parse. The reason is that the PGN format only specifies the piece type and destination square of each move. Ne4: a knight moves to e4, and it's up to the parser to figure out which knight. So to parse PGN, you have to teach your parser how the pieces move. That by itself is not too bad, but it gets worse. What if both knights can move to e4? Then the format disambiguates. Nge4: the knight on the g file moves to square e4. But "can move" is a tricky notion in chess. This knight cannot move because it is pinned to the king. That pawn can capture en passant this turn, but not next turn. So to write a PGN parser, you must build a chess engine capable of analyzing a board sufficiently to determine legal moves. One might hope that reasonable PGN text would be nice and disambiguate whenever two pieces attack the same square, and not require legal move analysis. Alas, it is not so. The "two knights attack a square but one is pinned" case is specifically called out as NOT requiring disambiguation in the spec at http://www.saremba.de/chessgml/standards/pgn/pgn-complete.htm#AEN242 http://www.saremba.de/chessgml/standards/pgn/pgn-complete.ht... . A further consequence is that it is not possible to make a "generic PGN" parser that can handle chess variants, like suicide chess. The rules of chess are baked into the format itself, and the parser must have knowledge of the rules used to play the game that it is presenting.
- chrisoakman 13y agoThis is a great write-up and is exactly the reason that ChessBoard is "just a board". Proper PGN parsing and legal move validation is a complex and independent problem that nicely fits into it's own library and should be separate from any display logic. For example: https://github.com/jhlywa/chess.js https://github.com/jhlywa/chess.js
- thingsilearned 13y agoI created this board a while ago that is connected to that chess.js http://thingsilearned.com/projects/chess/ http://thingsilearned.com/projects/chess/
- 13y ago
- tvtime15 13y agoWhen's the Chinese checkers edition coming out?
- ROI_ninja 13y agoanyone looked at http://bookmarkchess.com/ http://bookmarkchess.com/
- deleted 13y ago[deleted]
- mapleoin 13y agoAwesome, I have something similar for the game of Go: https://github.com/mapleoin/goboard.js https://github.com/mapleoin/goboard.js Unfortunately I didn't spend that much time writing beautiful docs for it.
- dm2 13y agoThere is also this game: http://multiplayerchess.com/ http://multiplayerchess.com/