Coder Social home page Coder Social logo

chess.dart's People

Contributors

adam-singer avatar andersforsell avatar daniel-mf avatar davecom avatar deven98 avatar gabriel-amaral avatar kasperl avatar loloof64 avatar safield avatar unibeck 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  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

chess.dart's Issues

Headers in PGN

Hello, thank you for your chess package.
There's a problem though.

When I do load_pgn, I don't get pgn headers except for Result.
Is it a bug or feature?

The copy() method, sometimes results in a Chess class with a different turn variable....chaos ensues.

I am observing a very strange behaviour where sometimes a copied board will have a different turn....sort of. The issue is not yet reproducible reliably, but I am obseriving it happen often.

Basically, I have a Chess object whose turn variable is white. I deep copy the object, and the resulting boards turn variable toString() returns 'b'. It seems like the internal int value (which underneath is like a double) has some sort of precision error.

Observations:
-the turn variable is a Color class.
-the initial turn variable Color instance, and the subsequent copied turn variable Color instance both have an internal value of 0 (aka WHITE).
-if you call toString() on the first instance it returns 'w', and on the second instance 'b'.
-if you use the value of the new turn variable for comparisons, it will not match to either white of black.
-because of this, the generate_moves() (with legal flag), always returns and empty list (when it should actually return many moves).

Some thoughts....

Could the Color class just be an enum to simplify things? I was looking into making this change (and it did fix the problem), but I am not quite sure if I broke something. For example there is a ColorMap class that seems intimately coupled with the Color class.

loadPgn method returns false in some Pgn strings

I've a pgn string which has only FEN and SetUp headers.

[FEN "1q3rk1/2p2ppp/8/5N2/8/2PQ4/PP6/1K1R4 w - - 0 1"]
[SetUp "1"]

  1. Ne7+ Kh8 2. Qxh7+ Kxh7 3. Rh1# 1-0

As shown on the image I can easily use this pgn in Chess.com's Analysis Part.

image

I can also download the regular pgn format (you can see on the attached image) for this game from 'Download' part.
image

The problem is for these kind of formats when loadPgn method returns always false even if I use the standart pgn format which I get from the Chess.com

I think the main reason is about the initial board position because on the Debug section I got a null 'Move' variable in line 1467.

image

load_pgn with FEN-Header

Hi,
when exporting a pgn game and the starting position differs from default, the [FEN]-Header is correctly exported. But when reading the same pgn game, the [FEN] header seems to be ignored - so game data cannot be loaded correctly.

Bug or Feature?

Best Regards and thanks for the great library,
Tobias

please help

even tho I assign a correct fen always give this error 6th field (move number) must be a positive integer.

Confusing name for variable "half_move"

In the Chess class, the variable name "half_move" is being used as a counter for the 50-move rule. At first sight it seems like half_move is another name for a ply(A half move) and can be easily misunderstood. "half_move" being named to something like drawCounter would be more appropriate in my opinion.

Incorrect Move Generation for Pawn

The moves function within the package generates inaccurate moves for a pawn situated on square e5 in specific scenarios. The issue arises when it produces the following available moves:

e5 to e6
e5 to d6 (incorrect move)

Additionally, the function incorrectly permits the pawn to move to d6, resulting in the removal of the pawn on d5 from the board.

Steps to Reproduce the Issue:

Set up a scenario where either your or your opponent's pawn is already positioned on the 6th row.
Move a pawn from a neighboring column two steps forward.

This sequence triggers the generation of incorrect moves, including the flawed move from e5 to d6.

Sample fen:
rnbqkbnr/ppp1p1pp/8/3pPp2/8/8/PPPP1PPP/RNBQKBNR w KQkq d6 0 3

image

DartPub package giving an error when added as dependency.

I have a package flutter_chess_board on DartPub which has chess as a dependency. It worked fine until Dart 2.1.0 was released. After release, pub analysis gives this as an analysis error:

ERR: The current Dart SDK version is 2.1.0-dev.1.0.flutter-69fce633b7.

Because flutter_chess_board depends on chess >=0.0.2 which requires SDK version <2.0.0, version solving failed.

Note: This is my pubspec.yaml dependency line ->
chess: ">=0.6.4 <0.7.0"

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.