Code Monkey home page Code Monkey logo

chessops's People

Contributors

dandaneel avatar dependabot-preview[bot] avatar dependabot[bot] avatar dignissimus avatar eronnen avatar fnogatz avatar grantjenk avatar hyperbotauthor avatar hyperchessbot avatar kraktus avatar mliebelt avatar niklasf avatar ornicar avatar

Stargazers

 avatar

Watchers

 avatar  avatar

chessops's Issues

Allow different board size

The current implementation has a board size of 8x8, which allow some shortcuts that are nice. But I would like to implement mini-games with it, and some of them have different board sizes than 8x8.

So the following should be allowed:

  • Have an additional constructor, that defines the board size different.
  • Default will be 8x8, so a lot of code can be left as it is.
  • Find some new elegant implementation for the SquareSet that lives at the moment from the fixed size:
    • SquareSet uses high/low for the first 32 squares and the second ones. The representation is a number with 32 bits.
    • There are a lot of magic numbers in the sources: corners = new SquareSet(0x81, 0x8100_0000) ==> first and last square of the first row, first and last square of the last row.
  • Translate all the magic numbers in at least a constant (if possible), or translate them to the format that helps understand the target.

At the end, the implementation will use row/column pairs instead of just a number (most of the time). Some of the numbers may be made variable, so that they denote all the time the same. So on a 5x5 board, the corners are then: 0x1100011. The internal representation has to be changed, to allow boards bigger than 8x8 (so lo and hi are not sufficient).

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.