Giter Club home page Giter Club logo

chess's Introduction

Hi, I'm David ๐Ÿ‘‹โ€๐Ÿ‘จโ€๐Ÿ’ป

I'm a software developer.

Some technologies I enjoy working with include React, Next, Gatsby, Jamstack (JavaScript, APIs + Markup), Styled Components and GraphQL.

chess's People

Contributors

davidlacarta avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

scaljeri

chess's Issues

Support for different move notations

Thanks a lot for this very nice library. As far as I understand, the only way to add a move would be

chess.move('e2','e4');

However, there a couple of notations, for example, Stockfish and Lc0 produce moves like e2e4 and if you play at chess.com they notate it like e4 or Nf3 etc.

I've used chess.js before and that lib has a very extended support for moves, but that project seems dead to me. Any plans to support that?

Error with caslting king-side

I just ran into the following situation with castling. The fen is

 1r2k2r/ppp2ppp/8/3N1b2/3n4/8/PP2PPPP/R3KB1R w KQk - 0 13

image

(source)

White to move, which does: e1c1

import { Chess } from 'chess-base';
const fen = '1r2k2r/ppp2ppp/8/3N1b2/3n4/8/PP2PPPP/R3KB1R w KQk - 0 13';
const chess = new Chess(fen);
chess.move('e1c1');

Which gives an error ending with: castling target

We've discussed this before ( #3 ) and I must say that I find the castling notation very confusing. Any ideas what might be the problem in this situation?

Half castling SAN

Thanks for adding this already. I noticed two issues (I think)

First one is castling. Consider the following

import { Chess } from 'chess-base';
const chess = new Chess('rnbq1rk1/p3bpp1/1p2pn1p/2ppN3/3P3B/2N1P3/PPP1BPPP/R2QK2R w KQ c6 0 9');

image

When I try to castle

 chess.move('e1', 'g1'); // --> Throws error

It seems that you can only castle with

chess.castlingKing();  // or
chess.move('O-O');    // <- very nice!!

It would be nice to support 'e1', 'g1' notation (I get this notation from chess engines)

The other issue I noticed is with the following fen string 8/P7/7k/8/8/8/K7/8 w - - 0 61

image

If the pawn moves from a7 to a8 you cannot do

chess.move('a8', 'q');

but instead you have to do

chess.move('a7', 'a8', 'q');

Hope this makes any sense, cheers!

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.