Giter Club home page Giter Club logo

dartchess's People

Contributors

anupya avatar dependabot[bot] avatar dignissimus avatar nav-28 avatar stscoundrel avatar veloce 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

Watchers

 avatar  avatar  avatar  avatar  avatar

dartchess's Issues

PGN parser - help needed!

We need a dart PGN parser for the next lichess mobile app.

A good first version would parse a linear sequence of moves, no variations, no comments.

It's recommended to mimic the chessops typescript library:

This is a good first issue to get started with the dart language, and therefore with the development of the next mobile app.

Please drop by our discord server to discuss it https://discord.gg/lichess

EDIT:
One request: we should strive to have an immutable API because the rest of dartchess is immutable. Internal implementation can be mutable of course, for performance considerations, but the resulting Game type should be immutable.

Bug in PGN parser

Hello!
I found a problem when loading pgn with '{\nsome comments' pattern. May be even inside '(' variation
I added example modified file wcc_2023_1.pgn
wcc_2023_1.txt

I modified it here...
image

And when I run the following code the application hangs

void main(List<String> args) {
  final String data = File('bin/pgn/wcc_2023_1.pgn').readAsStringSync();
  final List<PgnGame<PgnNodeData>> games = PgnGame.parseMultiGamePgn(data);
  print('Games: ${games.length}');
  print('Game 1: ${games[0].makePgn()}');
}

Support Web

Hi! Excellent package! Do you plan to add web?

Bug in Castling?

Hi,

Library Version: dartchess: ^0.6.1

I am using the following test-code to query the allowed moves of the king:

    String fen =
        "rnbqk2r/ppppbppp/4p1N1/4P3/8/B7/PPPPBPPP/RN1QK2R w KQkq - 0 1";
    final chess = Chess.fromSetup(Setup.parseFen(fen));

    SquareSet set = chess.legalMovesOf(Squares.e1);
    for (var element in set.squares) {
      developer.log(element.toString());
    }
    Iterable<Square> squares = set.squares;
    expect(squares.length, 2);
    expect(squares.first, Squares.f1);
    expect(squares.last, Squares.g1);

Expected: King has two fields, f1 and g1 (in case of castling).
Problem: legalMovesOf gives back the fields f1 and h1, which seems to be odd?

When executing a move, it is possible to execute the move chess.play(NormalMove(from: Squares.e1, to: Squares.g1));, which again seems to be odd, as g1 is not recognized as a legal move.

Best Regards,
Tobias

Crazyhouse en passant bug with DropMove

_copyWith() carries the epSquare forward to the next move when a DropMove is played, which makes this sequence possible:

  1. d4 e5
  2. Nf3 Qg5
  3. Nxg5 Be7
  4. dxe5 Bd8
  5. Nc3 f5 (creates epSquare at f6)
  6. Q@f7 (copyWith() is given null for epSquare, which then copies the epSquare of f6 forward to Black)
    6... gxf6 (captures the Queen on f7!)

[Request] Support for Setup.parsePgn

Currently the Setup class supports the fen with Setup.parseFen constructor,
almost lichess endpoints for puzzles returns a Pgn string, it would be nice if there is some Setup.parsePgn

Castling bug (all variants)

_getCastlingSide() creates all sorts of "legal" castling moves where the king is moved onto another piece of its own color.

e.g. depending on the setup, I saw things like Ka2, Kd4, and Kf3 (moving onto his own pawn or knight) resulting in a kingside castle, and Ke1 (moving onto its own square) resulting in a queenside castle. In one position I had 13 legal moves that resulted in a castle. They all involved moving onto another friendly piece or e1.

Add Chess♯

Hi Vincent!

Yes, something is messed up in my repo. I can no longer make commits and from my googling it looks like the only option I have is to delete it entirely and rebuild. Here are screenshots of the diffs and comments, because I assume that all that history will be lost once I do that.

Sorry for the hassle.

Kind regards,
David

ChessSharp PR 1 - diffs and comments.pdf
ChessSharp PR 2 - diffs.pdf

Impossible check align en passant capture

This position cannot be reached by standard chess from initial position:

id align-ep
epd 8/8/8/1k6/3Pp3/8/8/4KQ2 b - d3
perft 1 6
perft 2 121
perft 3 711

When dartchess supports optional validity requirements, it should be able to validate that perft.

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.