Git Product home page Git Product logo

kill-the-king's People

Contributors

kael89 avatar

Stargazers

 avatar

Watchers

 avatar

kill-the-king's Issues

UI layout ideas

A different approach:

  1. Starting color at the top left of the board, move depth at the middle, theme at the top right
  2. Piece selectors on the left
  3. Delete Chasemate header or use logo
  4. Collapse 'Available Moves' by default

Board validation

Validation rules:

  • Max number of each piece type/color: King: 1 Pawn: 8 Queen: 1 Knight: 2 Bishop: 2 Rook: 2
  • For each missing pawn, one of the piece types [Queen, Knight, Bishop, Rook] can be + 1 in number
  • No pawns in the bottom line of each color
  • Theoretically, a player may not be in a position where their enemy is already check mate and now it’s the player’s turn. This will mean that their enemy got themselves in a check mate position during their last move.
  • For each pawn in the same column, an enemy piece must have been captured
  • The number of knights with the same color cannot be greater than the number of pawns that (may) have been promoted to knights

Available Moves improvements

Two somewhat related improvements:

  1. Sort moves per type/row/column. Current behavior:
{
  "G7": {
    "color": "white",
    "type": "queen",
    "position": "G7"
  },
  "H7": {
    "color": "white",
    "type": "rook",
    "position": "H7"
  },
  "A8": {
    "color": "black",
    "type": "king",
    "position": "A8"
  }
}

image

  1. Restrict the panel's width. Current behavior: (even in fullscreen)
{
  "G7": {
    "color": "white",
    "type": "queen",
    "position": "G7"
  },
  "H7": {
    "color": "white",
    "type": "rook",
    "position": "H7"
  },
  "A8": {
    "color": "black",
    "type": "king",
    "position": "A8"
  },
  "F6": {
    "color": "white",
    "type": "queen",
    "position": "F6"
  },
  "E5": {
    "color": "white",
    "type": "queen",
    "position": "E5"
  }
}

image

  1. Consider listing the moves in one row per piece

Key support

Various keys or hotkeys could be used across the app.

One example: in the piece selector, navigating through the pieces with the arrows, and selecting them with enter

Move notation for pieces of the same type

In certain scenarios, two pieces of the same type can move in the same square. The current notation does not specify which of the two pieces will move:

image

{
  "E8": {
    "color": "white",
    "type": "knight",
    "position": "E8"
  },
  "D5": {
    "color": "white",
    "type": "knight",
    "position": "D5"
  },
  "A8": {
    "color": "black",
    "type": "king",
    "position": "A8"
  },
  "B1": {
    "color": "white",
    "type": "rook",
    "position": "B1"
  },
  "G1": {
    "color": "white",
    "type": "bishop",
    "position": "G1"
  }
}

Move animation

When hovering over an available move, the move could be animated

Board freezes after clicking on an available move

Board:

{
  "A8": {
    "color": "black",
    "type": "king",
    "position": "A8"
  },
  "G7": {
    "color": "white",
    "type": "rook",
    "position": "G7"
  },
  "H6": {
    "color": "white",
    "type": "rook",
    "position": "H6"
  }
}

Steps to reproduce:
Click 'Go!' and click on the available move. The board stays frozen on the rendered move. 'Clear' button etc is not working. The only way to make it unfreeze is hovering over another move (eg in Results).

This seems to occur when Available Moves shows Checkmate! (i.e. no other moves)

Properly render promotion move

When hovering over a promotion move, the pawn is just shown moving to its last rank without being promoted to a new piece.

Improved move UI

Ideas for improved move UI:

  • The pieces which should be moved to achieve a checkmate could have a different background color, as well as the squares where they should be dropped (on hover)
  • On piece hover, the available moves could be shown as squares of different background color

JSON import error

The import functionality only validates whether the input is valid JSON, and not if it is a valid board description.

Eg, if the following is inserted:

{
  "A2": {
    "type": "pawn",
    "color": "white1",
    "position": "A1"
  }
}

the application crashes

Pawn icon issue in MacOS

In MacOS, pawns are rendered with a custom icon which is inconsistent with other piece icons in MacOS, and with the pawn icon for other OS

Move history lines issue

In certain scenarios, an extra empty line is displayed in Move History.

This seems to happen when black plays first. Example:

  • Set the board to
{
  "H7": {
    "color": "black",
    "type": "rook",
    "position": "H7"
  },
  "A8": {
    "color": "white",
    "type": "king",
    "position": "A8"
  },
  "G8": {
    "color": "black",
    "type": "rook",
    "position": "G8"
  }
}
  • Click on any of the available moves. The Move History becomes:

image

Issue with crazy board

The following (invalid) board produces an error with the default settings:

{
  "A1": {
    "color": "white",
    "type": "queen",
    "position": "A1"
  },
  "H1": {
    "color": "white",
    "type": "queen",
    "position": "H1"
  },
  "B1": {
    "color": "white",
    "type": "queen",
    "position": "B1"
  },
  "G1": {
    "color": "white",
    "type": "queen",
    "position": "G1"
  },
  "C1": {
    "color": "white",
    "type": "queen",
    "position": "C1"
  },
  "F1": {
    "color": "white",
    "type": "queen",
    "position": "F1"
  },
  "D1": {
    "type": "queen",
    "color": "white",
    "position": "D1"
  },
  "E1": {
    "color": "white",
    "type": "queen",
    "position": "E1"
  },
  "A7": {
    "color": "black",
    "type": "king",
    "position": "A7"
  },
  "B7": {
    "type": "pawn",
    "color": "black",
    "position": "B7"
  },
  "C7": {
    "type": "pawn",
    "color": "black",
    "position": "C7"
  },
  "D7": {
    "type": "pawn",
    "color": "black",
    "position": "D7"
  },
  "E7": {
    "type": "pawn",
    "color": "black",
    "position": "E7"
  },
  "F7": {
    "type": "pawn",
    "color": "black",
    "position": "F7"
  },
  "G7": {
    "type": "pawn",
    "color": "black",
    "position": "G7"
  },
  "H7": {
    "type": "pawn",
    "color": "black",
    "position": "H7"
  },
  "A8": {
    "color": "black",
    "type": "king",
    "position": "A8"
  },
  "H8": {
    "type": "rook",
    "color": "black",
    "position": "H8"
  },
  "B8": {
    "type": "knight",
    "color": "black",
    "position": "B8"
  },
  "G8": {
    "color": "black",
    "type": "queen",
    "position": "G8"
  },
  "C8": {
    "type": "bishop",
    "color": "black",
    "position": "C8"
  },
  "F8": {
    "type": "bishop",
    "color": "black",
    "position": "F8"
  },
  "D8": {
    "type": "queen",
    "color": "black",
    "position": "D8"
  },
  "E8": {
    "type": "king",
    "color": "black",
    "position": "E8"
  },
  "A5": {
    "color": "white",
    "type": "queen",
    "position": "A5"
  },
  "B6": {
    "color": "white",
    "type": "queen",
    "position": "B6"
  },
  "C5": {
    "color": "white",
    "type": "queen",
    "position": "C5"
  },
  "D6": {
    "color": "white",
    "type": "queen",
    "position": "D6"
  },
  "E5": {
    "color": "white",
    "type": "queen",
    "position": "E5"
  },
  "F6": {
    "color": "white",
    "type": "queen",
    "position": "F6"
  },
  "G5": {
    "color": "white",
    "type": "queen",
    "position": "G5"
  },
  "H6": {
    "color": "white",
    "type": "queen",
    "position": "H6"
  }
}

Improve diff on move hover

Currently, when hovering over a move all pieces are grayed out. Only the moving piece should be grayed out.

image

UI responsiveness

Investigate UI responsiveness. Important point, the app should be displayed at full height in resolutions less than 1920 x 1080

Show capture symbol

From wikipedia:

Notation for captures

When a piece makes a capture, an x is inserted between the initial and the destination square. For example, Bxe5 (bishop captures the piece on e5). When a pawn makes a capture, the file from which the pawn departed is used in place of a piece initial. For example, exd5 (pawn on the e-file captures the piece on d5).

Promotion popup

When a piece is dragged in its promotion row, display a popup for promotion type selection

Allow user to revert to the initial board state

In order to get results, a user first sets the board and then clicks 'Go'.

Currently, if the user starts playing the available moves by clicking on them, they can also travel back in history by clicking on a previous move in 'Move History'. However, they cannot revert the board to its initial state, i.e. before 'Go' was clicked.

Make the first request faster

The first request is always slow regardless of its complexity. It most probably has to do with the back-end lambda function being loaded.

Remove results height padding

Board:

{
  "H7": {
    "color": "black",
    "type": "rook",
    "position": "H7"
  },
  "A8": {
    "color": "white",
    "type": "king",
    "position": "A8"
  },
  "G8": {
    "color": "black",
    "type": "rook",
    "position": "G8"
  }
}

Settings:
black plays first

Result:
image

Continuously fetched results

Instead of a'Go!' button which fetches results once, a ' Detect checkmates' button could be used. The button turns checkmate detection on or off every time it is pressed. Available checkmates are fetched every time the board changes.

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.