glinscott / Garbochess-JS

A strong javascript chess engine using WebWorkers
http://forwardcoding.com/projects/ajaxchess/chess.html
Other
313 stars 101 forks source link

Move Seqyence function not demonstrated in the default UI #15

Closed Chris-Burton closed 11 years ago

Chris-Burton commented 11 years ago

I realize Garbochess can do things not demonstrated in the default UI (like under-promotion).

I would like to know whether Garbochess can receive a FEN and return the best sequence of moves for both sides. If there are checkmate combinations, GB would return the one with the least number of moves.

For example, if I load the FEN

2b4Q/4p2K/4pr2/2P1k3/2P2R2/3P3p/2n4B/8 w - -

Can Garbochess tell me the optimal move sequence (which leads to checkmate) of

  1. Kg7 Rxf4 2. Kg6#

Or does Garbochess wait for white to move as the only option before calculating black's next best move?

This function would have many uses including suggesting a move as a hint to Direct Mate puzzles as well as checking the validity of FEN puzzles submitted online.

This brings up the question, can we contract with you to have features added?

glinscott commented 11 years ago

If you paste in the FEN, and press enter, it will load the FEN. Then, if you hit the analyze button, Garbochess will give you it's best line. Note that if it's a long checkmate, Garbochess may not be able to find it in a reasonable time. What sort of features were you looking for?

Chris-Burton commented 11 years ago

The feature I am looking for is exactly what I request in this Issue.

I want GB to return an analysis that solves Direct Mate puzzles as many moves deep as possible. I'm willing to contribute to the cause if need be.

Currently, with the analysis left on, it appears my CPU becomes over-taxed and my mouse refreshes so slowly that navigating between windows becomes impossible and I'm forced to reboot. The only way to get around this is to turn on the analysis and quickly turn it off again, but then the analysis results are not helpful. Even when left on, the analysis is not very useful since it keeps jumping around and doesn't stay on the best solution found. Crafty does analysis well by settling quickly and showing the top two lines.

Don't get me wrong. I think Garbochess is fantastic! I just haven't figured out how to use the analysis feature in it's current form.

glinscott commented 11 years ago

What browser are you using? The analysis feature uses webworkers (not supported in IE), and I've never had any issues with it freezing the browser in Firefox or Chrome.

If the analysis keeps jumping around, Garbochess is not able to find a good solution to the problem yet. Once it finds a mate, it will stay locked onto the mate unless it finds a shorter one.

Chris-Burton commented 11 years ago

Understood regarding how Garbochess stays on solutions. Since I can't leave the analysis on, I haven't seen it work as you describe.

I;m using Google Chrome. It says it is "up-to-date" on version 26.0.1410.64 m

On Tue, Apr 23, 2013 at 7:55 AM, Gary Linscott notifications@github.comwrote:

What browser are you using? The analysis feature uses webworkers (not supported in IE), and I've never had any issues with it freezing the browser in Firefox or Chrome.

If the analysis keeps jumping around, Garbochess is not able to find a good solution to the problem yet. Once it finds a mate, it will stay locked onto the mate unless it finds a shorter one.

— Reply to this email directly or view it on GitHubhttps://github.com/glinscott/Garbochess-JS/issues/15#issuecomment-16863151 .

glinscott commented 11 years ago

Very strange! What CPU/OS are you running it on? It sounds like a chrome bug that it would freeze the computer, that should never be possible.

Chris-Burton commented 11 years ago

I'm using Windows 7 Home Premium, Service Pack 1

[image: Inline image 1]

Gary, my system does not "lock up", my mouse refresh becomes very slow making it impossible to navigate.

I'll upgrade Service Packs or Chrome if that's a simple option.

On Tue, Apr 23, 2013 at 8:12 AM, Gary Linscott notifications@github.comwrote:

Very strange! What CPU/OS are you running it on? It sounds like a chrome bug that it would freeze the computer, that should never be possible.

— Reply to this email directly or view it on GitHubhttps://github.com/glinscott/Garbochess-JS/issues/15#issuecomment-16864369 .

glinscott commented 11 years ago

Ok, but, if the computer is unresponsive enough, it's equivalent to freezing. I could add a sleep in the webworker while it was thinking potentially.

Chris-Burton commented 11 years ago

I'll be a guinea pig for testing if you'd like to try.

On Tue, Apr 23, 2013 at 9:01 AM, Gary Linscott notifications@github.comwrote:

Ok, but, if the computer is unresponsive enough, it's equivalent to freezing. I could add a sleep in the webworker while it was thinking potentially.

— Reply to this email directly or view it on GitHubhttps://github.com/glinscott/Garbochess-JS/issues/15#issuecomment-16867716 .

Chris-Burton commented 11 years ago

Gary,

My programmer/partner said he tested the analysis on his system running on Chrome with no issues.

Like I said, I'll be a guinea pig and test anything you care to try.

Chris Burton Chris@PhotoLynx.com

On Tue, Apr 23, 2013 at 9:01 AM, Gary Linscott notifications@github.comwrote:

Ok, but, if the computer is unresponsive enough, it's equivalent to freezing. I could add a sleep in the webworker while it was thinking potentially.

— Reply to this email directly or view it on GitHubhttps://github.com/glinscott/Garbochess-JS/issues/15#issuecomment-16867716 .

glinscott commented 11 years ago

Thanks. Yeah, I'm not really sure what's going on. I'll ping you when I have some time (hopefully this weekend).

Chris-Burton commented 11 years ago

OK

On Tue, Apr 23, 2013 at 6:21 PM, Gary Linscott notifications@github.comwrote:

Thanks. Yeah, I'm not really sure what's going on. I'll ping you when I have some time (hopefully this weekend).

— Reply to this email directly or view it on GitHubhttps://github.com/glinscott/Garbochess-JS/issues/15#issuecomment-16903056 .