Comments/Ratings for a Single Item
After I moved my King, it didn't update the value of K, and its current value pointed to an empty space. I fixed the code to update the values of k and K when the King moves.
Hi Fergus
My opponent sent an email to me saying he cannot move in the following log:
My opponent sent an email to me saying he cannot move in the following log:
He's in check and has few legal moves. Also, the ASCII diagram he is using will not display legal moves or allow moving with the mouse. I was able to get as far as previewing a move after changing the rendering method. Not being him, I couldn't go any further.
UPDATE: Upon further testing, I found no problem with being able to move. I created a test log that just changed userids, and I successfully moved. Since the log had no time controls, the time the site spent offline had no effect on anything.
There is a bug in this preset where diagonal moves are highlighted for black's pawns, although they aren't accepted if you try to play them.
There is a bug in this preset where diagonal moves are highlighted for black's pawns, although they aren't accepted if you try to play them.
I tried the following sequence of moves and didn't detect that problem:
1. P g3-g5
1... p f8-f7
2. P g5-f7
2... p e9-f7
I also tested en passant with this series of moves and again found no problem:
1. P g3-g5
1... n g9-i6
2. P g5-g6
2... p h8-h6
3. P g6-h7
3... p f8-f7
4. B f3-i6 // - Check! -
4... b f9-h8
5. N g2-i3
5... p f7-f6
6. P e4-e6
6... p f6-e5
So give me a position or series of moves leading to a position where you encounter the problem you described.
I see it if white moves any pawn two spaces on the first move.
The problem is not just with black’s pawns, and it is not limited to the first moves of the game. Whenever a pawn makes a double move, it is displaying illegal diagonal moves as legal, because the functions for evaluating potential pawn moves are not handling en passant capture correctly. At least it won’t let you make these illegal moves. I’ll fix it later when I’m on my desktop.
I have now fixed the problem. In each function I replaced the line and checkleap #0 #1 0 1 var ep #1
with two lines that more exactly checked that the destination space was directly behind the Pawn that had made a double move. Here is the old code:
def P
remove var ep
and or checkaleap #0 #1 1 1 checkaleap #0 #1 -1 2
and checkleap #0 #1 0 1 var ep #1
and var ep
or and checkatwostep #0 #1 0 1 0 1 and flag #0 < rank #0 6
or checkleap #0 #1 0 1
and empty #1
or and islower space #1 checkaleap #0 #1 1 1
or and islower space #1 checkaleap #0 #1 -1 2
and > rank #1 rank #0;
def p
remove var ep
and or checkaleap #0 #1 1 -2 checkaleap #0 #1 -1 -1
and checkleap #0 #1 0 -1 var ep #1
and var ep
or and checkatwostep #0 #1 0 -1 0 -1 and flag #0 > rank #0 6
or checkleap #0 #1 0 -1
and empty #1
or and isupper space #1 checkaleap #0 #1 1 -2
or and isupper space #1 checkaleap #0 #1 -1 -1
and < rank #1 rank #0;
I changed it to this, and it worked:
def P
remove var ep
and or checkaleap #0 #1 1 1 checkaleap #0 #1 -1 2
and == + 1 rankname var ep rankname #1
and == filename var ep filename #1
and var ep
or and checkatwostep #0 #1 0 1 0 1 and flag #0 < rank #0 6
or checkleap #0 #1 0 1
and empty #1
or and islower space #1 checkaleap #0 #1 1 1
or and islower space #1 checkaleap #0 #1 -1 2
and > rank #1 rank #0;
def p
remove var ep
and or checkaleap #0 #1 1 -2 checkaleap #0 #1 -1 -1
and == - 1 rankname var ep rankname #1
and == filename var ep filename #1
and var ep
or and checkatwostep #0 #1 0 -1 0 -1 and flag #0 > rank #0 6
or checkleap #0 #1 0 -1
and empty #1
or and isupper space #1 checkaleap #0 #1 1 -2
or and isupper space #1 checkaleap #0 #1 -1 -1
and < rank #1 rank #0;
Note that the line "and checkleap #0 #1 0 1 var ep #1
" is poorly written. Whenever ep was true, this would have evaluated as true. What I think I actually intended was "and checkleap var ep #1 0 1
". However, this could still allow en passant capture in front of or next to the Pawn that had made a double move. What might work is checkaleap
with more specific directions.
11 comments displayed
Permalink to the exact comments currently displayed.
Fergus:
I can not make any move in our game [sissa-cvgameroom-2016-141-638]; it appears a message saying "Syntax Error on line 353...".
By other part, all the logs of McCooey's Hexagonal Chess finished games are broken.