Giter VIP home page Giter VIP logo

chess's People

Contributors

radi-cho avatar radi123 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

chess's Issues

Sometimes AI doesn't make move.

The problem:
image

Check out this log to reproduce the problem:
https://pastebin.com/VHgF51VW

UPDATE:
How to reproduce:

  • Make breakpoint on line 32.
  • Click twice on random white piece.
  • Run the following code in the console:
var fromArray=[{x:1,y:7},{x:7,y:1},{x:5,y:6},{x:7,y:3},{x:2,y:5},{x:7,y:4},{x:4,y:4},{x:7,y:5},{x:5,y:7},{x:7,y:0},{x:7,y:7},{x:6,y:1},{x:5,y:6},{x:6,y:3},{x:5,y:5},{x:5,y:1},{x:6,y:4},{x:4,y:1},{x:4,y:4},{x:3,y:0},{x:3,y:6},{x:6,y:3},{x:3,y:7},{x:4,y:3},{x:4,y:6},{x:3,y:4},{x:4,y:7},{x:3,y:1},{x:4,y:6},{x:2,y:0},{x:4,y:5},{x:5,y:3},{x:3,y:4},{x:2,y:6},{x:3,y:3},{x:7,y:1},{x:4,y:3},{x:1,y:7},{x:0,y:7},{x:2,y:1},{x:1,y:6},{x:2,y:3},{x:1,y:5},{x:1,y:1},{x:2,y:4},{x:0,y:1},{x:1,y:3},{x:1,y:0},{x:0,y:6},{x:0,y:0},{x:2,y:7},{x:0,y:2}]
var toArray=[{x:2,y:5},{x:7,y:3},{x:5,y:5},{x:7,y:4},{x:4,y:4},{x:7,y:5},{x:5,y:6},{x:6,y:6},{x:6,y:6},{x:7,y:6},{x:7,y:6},{x:6,y:3},{x:4,y:4},{x:6,y:4},{x:6,y:4},{x:5,y:3},{x:5,y:3},{x:4,y:3},{x:6,y:3},{x:6,y:3},{x:3,y:4},{x:2,y:7},{x:2,y:7},{x:3,y:4},{x:4,y:5},{x:4,y:5},{x:4,y:6},{x:3,y:3},{x:4,y:5},{x:5,y:3},{x:3,y:4},{x:2,y:6},{x:3,y:3},{x:7,y:1},{x:4,y:3},{x:1,y:7},{x:5,y:4},{x:0,y:6},{x:0,y:6},{x:2,y:3},{x:1,y:5},{x:2,y:4},{x:2,y:4},{x:1,y:3},{x:1,y:3},{x:0,y:3},{x:0,y:2},{x:0,y:2},{x:0,y:2},{x:0,y:2},{x:2,y:4},{x:0,y:0}]
fromArray.map((ev,i)=>{this.moveSelected(this.board[ev.y][ev.x],toArray[i],()=>{},()=>{},!1,!1,!1)})
  • Move Qc6

Support web-workers

The algorithm in the new AI is powerful, but if you run it with depth bigger than 3, the UI will freeze for seconds and the mobile version will even crash.
At the moment we're using WebViews from PhoneGap and Electron to make RSG Chess multi-platform, so the problem can be fixed on all platforms using Web Workers. Docs and tutorials can be find on MDN and some really helpful blog posts.

Add FEN notation support.

Add FEN notation support.
This feature will be helpful:

  • in RSG Chess APIs (The API will be more customizable and comfortable);
  • in AI algorithm #3;
  • when checking for the threefold repetition (#5);
  • when checking for the fifty-move rule #6;

Needed fields:

  • Piece placement;
  • Active colour;
  • Castling availability;
  • En passant;
  • Halfmove clock;
  • Fullmove number;

Additional to-dos:

  • Separate the functions for more customizable API, more beautiful code and better performance.
  • Remove the useless FEN fields and move them to the Chess APIs - #7 (comment)

The engine made a move while the king was under attack(check)

A white pawn was promoted to a Queen, when the black King was on h8. The game continued with a random move instead of realizing the King is in check by the promotion.
Then i removed the black King with my Queen and the game continued. :D

game_without_king

Good luck!

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.