aclap-dev / joclyboard

Multiplatform 3D/2D desktop application for playing board games
Other
44 stars 20 forks source link

Blacks don't castle properly in Demi-Chess_JoclyBoard_0.9.12 #19

Open ecobabush opened 7 years ago

ecobabush commented 7 years ago

When Blacks do a castling they don't interchange the positions of the king and a rook. They only move chess pieces towards each other and stay them side by side.

ecobabush commented 7 years ago

I have opened 2 issues #19 and #20 here in joclyboard. Now I think it would be better to open them in jocly. The question is what to do with all this stuff now? Reopen it at jocly or not?

I am not a programmer. I try to study Java. As I understood you use JavaScript in Jocly. I took a look on the code at https://github.com/mi-g/jocly/tree/master/src/games/chessbase/demi-model.js

111-114 lines castle: { "0/3": {k:[1,2],r:[2,1],n:"O-O"}, "28/31": {k:[30,29],r:[29,30],n:"O-O"}, }, White makes castling well. "0/3": {k:[1,2],r:[2,1],n:"O-O"}, 0 - is position of white king, 3 - of white rook.

Black makes castling wrong. "28/31": {k:[30,29],r:[29,30],n:"O-O"}, 28 - is position of black king, 31 - of black rook.

Therefore even without my understanding of all this stuff "28/31": {k:[30,29],r:[29,30],n:"O-O"} I suggest to make it like this "28/31": {k:[29,30],r:[30,29],n:"O-O"}. This means black king (k) moves from position 28 to 29, then to 30 and black root (r) moves from position 31 to 30, then to 29.

ecobabush commented 7 years ago

I have made commits and a pull request. I hope it helps to remove bugs with castlings in demi-chess and Malett chess. It is my first time to use github and do commits. Then I had some troubles with commits. I hope you will solve my mistake. I am not English.