maxpumperla / deep_learning_and_the_game_of_go

Code and other material for the book "Deep Learning and the Game of Go"
https://www.manning.com/books/deep-learning-and-the-game-of-go
953 stars 387 forks source link

Error in the httpfrontend files #107

Open phdsmhong opened 1 year ago

phdsmhong commented 1 year ago

Hello Max and Kevin, I closely followed your book and just made a go-bot at about KSG 4~5 dan strength. Thank you for all your helps along the road (and this fantastic book!)

I just wanted to ask your advice about an error I found in the frontend files. When I use the frontend goboard, I sometimes receive the following error message "illegal move: cannot play on existing stone!" even though I did not play on existing stone. After the message, I cannot proceed anymore because there is no switch in players.

Does anyone have same experience?

phdsmhong commented 1 year ago

I found what the problem is. Before making actual choices, there is a shadow stone showing up on the board. This shadow stone is recognized as a real stone, and if the gobot moves on that exact point, it throws "illegal move: cannot play on existing stone!".

For example, suppose it is gobot's turn to move. My mouse was happenly located on position (4, 4) and thus there is a shadow stone on the board. If gobot makes an actural move on postion (4,4), then it is considered an illegal move.

Can anyone suggest how to fix this issue? You can find the javascript file below. https://github.com/maxpumperla/deep_learning_and_the_game_of_go/blob/35f983cabb7294d84f2554dc4c23063f23f985b8/code/dlgo/httpfrontend/static/jgoboard-latest.js

and also the html file: https://github.com/maxpumperla/deep_learning_and_the_game_of_go/blob/35f983cabb7294d84f2554dc4c23063f23f985b8/code/dlgo/httpfrontend/static/play_predict_19.html