Coder Social home page Coder Social logo

chess's People

Contributors

akondas avatar chrysanthos avatar garak avatar peter279k avatar sergiy-petrov 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

chess's Issues

ignore composer.lock

I think that composer.lock should be ignored, since this is a library (not a product).
Scenario: I was about to update vendors in my local copy, then I realized that such action would update composer.lock to my environment (for example, I use php 7.4 but this lib is compatible with php ^7.2).

The only drawback I see is that CI could be a bit slower, since it can't rely on composer.lock while installing vendor libs.

Illegal move possible

I am not sure what I am doing wrong, but it seems as if a certain illegal move is not validated as falseful.

Move order as example:

1.e4 (c5)
2.Bc4 (e6)
3.Nf3 (Nf6)
4.Kg1 (Nxe4)

Kg1 is an illegal move, except if O-O (castling) which would put the King on g1.
But simply playing Kg1 is allowed when played, and the rook stays on h1.

Does this have to do with the implementation of the castling rule?

Thanks!

Problem with some types in Move

Following properties in Move are integers: from, to, flags.
Anyway, the prettyMove method in Chess is chaning such properties to strings.
Problem is also present in original library, so we need to investigate the logic.

For what I understand, from and to are indicating the squares where the move is starting and engind, and there's two possible representations: as integers (from 0 to 119) and in string notation of rank and file (e.g. e2). We need to understand where/how to apply such different representations (for example, I guess that in history it makes more sense the latter, but mabye the former can be used when undoing?)

For flags, I've got no clue.

Simplify board hashing

Currently, board is hashed via json_encode, that encodes the array of squares.
This produce a string that is hard to read and ridiculously long.
Then, such string is also used as a key, producing ugly arrays.

I think that we could use a FEN string, that is far shorter and simpler

Typed options

Currently, some methods accept an array of options. This should be changed to explicit parameters (so we can add typing).
Moreover, generateMoves method is accepting options but never called with any option inside Chess class (only in ChessPublicator for perft method). So we probably should remove such options

What is header property for?

We got an $header property, I was wondering if we could remove it.
I see that is just an array holding two keys: "setUp" and "FEN", but it's not clear to me how such informations can be useful.

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.