Giter Site home page Giter Site logo

flywheel's People

Contributors

cosinekitty avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

flywheel's Issues

When user presses Play button, computer should take over the current side.

Pressing the Play button should cause the computer to take over the player whose turn to move it is. Pressing Play should always make the current side be a computer player and the remaining side be a human player. When the computer is thinking, the Play button should change to a Pause button. If Pause is pressed, both players should revert to human players.

Using undo/redo buttons should set back to human-vs-human; otherwise computer will start thinking during undo/redo!

Make it easier to cancel a move while piece is being dragged

After selecting the source square of a move, the demo must make it easier to cancel the move. One major problem is that currently, clicking back on the same source square does not cancel the move. Any illegal move, including source-source, should work to cancel the move! Also consider some other way to explicitly abort a move (press ESC? click on some cancel icon?)

Allow board to be initialized to an arbitrary position using FEN.

Initializing with FEN means the reported ply number is not the same as moveStack.length, so will need to fix all those existing assumptions first.
Ambiguity in NumTurnsPlayed() between how many moves can be popped (moveStack.length) and half-move clock for assessing draws.

When moving pieces, the bitmap should move around with the mouse

After clicking on a piece or while dragging it, the piece bitmap should move around with the mouse. When dropped on a legal square, the piece should snap to that location. When moved to an illegal destination, the piece should sprite-slide back to its origin.

Make Board.CurrentPlayerCanMove() more efficient

Board.CurrentPlayerCanMove() currently generates a list of all legal moves just to find out whether there are any legal moves. Later, the AI will benefit greatly from a faster implementation that returns true after finding any legal move.

Finish logic for timed search

Search should terminate within 10 milliseconds of time expiration, unless level 1 search has not yet completed, in which case it should be allowed to complete to find a decent move.

Should be able to select from time limit or search depth limit uniformly in either MateSearch or Search.

Choosing between time limit and max depth limit should be orthogonal to what kind of search is being performed (should be separate function calls).

Rotating the board while the computer is thinking causes exception

Repro steps:

  1. Tell computer to think.
  2. While it is thinking, rotate the board.
  3. A couple of seconds after the computer moves, we get an exception:
  • Uncaught TypeError: Cannot read property 'style' of undefined

It is in AnimateMove():

        var image = <HTMLElement> coords.source.squareDiv.children[0];
        image.style.position = 'absolute';

Allow cloning of moves and boards

To prevent unintended side-effects, it would be wise to avoid exposing any internal state in a mutable way to callers (at least ones that use TypeScript -- can't stop all the monkey-patchers out there). Moves pushed onto board.moveStack should be copies of the ones handed back to callers. Likewise, there needs to be a way to clone a chess board so that changes made to it have no effect on the original board object.

Prototype UI

Display board graphically.
Allow user to click, touch, or drag pieces to move them.
Prompt for promotion piece.
Reject illegal moves.
Provide command for letting the computer think.
Rotate board.

Demo needs to handle pawn promotion

When the user promotes a pawn in the demo, it should present a menu of 4 pieces (same color as the player): Queen, Rook, Bishop, Knight. User should click on one of these to choose the promotion piece, or a Cancel icon to abort the move. The mouse should start out positioned above the Queen option because it is the most likely choice.

Demo should allow moving pieces by dragging them

Currently the demo allows moving pieces only by single-clicking on the piece to be moved, then clicking on the target square. It should also allow moving pieces by dragging the piece (holding down the mouse and releasing it on the target square).

Eliminate forced-loss moves from top-level move list

If all top-level moves lead to a forced loss, pick whichever one postpones the loss the longest (has the best score) and terminate the search immediately.
Otherwise (if at least one move is not yet a forced loss), remove all forced-loss moves from the top-level move list to avoid re-thinking them at deeper levels.
Any time there is exactly one move remaining in the top-level list, immediately choose it. (This handles the case where there is exactly one legal move.)

Animate computer's moves

When the computer makes a move, animate it. Afterward, leave the source and target squares subtly highlighted somehow (perhaps draw a border around them).

Detect all possible ways a chess game can end

Create a function board.GameResult() that returns data indicating whether the game is over. If so, it should also indicate whether White won, Black won, or the game is a draw. If the game is a draw, should indicate which kind of draw it is:

  • stalemate
  • threefold repetition
  • 50-move rule
  • insufficient material

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.