Comments/Ratings for a Single Item
Hm. Funny. I am going to sound very foolish here, but it did work when I just checked it again, via Firefox.
Wasn't working before, I swear! ::embarrassed::
I just fixed a bug in the code. A Queen is not supposed to be able to pass through check, but the way the code was enforcing this rule, it was ignoring checks from a piece captured by the Queen. This is because it was evaluating the legality of the Queen's move after the Queen had moved, and at that point, the piece the Queen had captured was no longer on the board. Here is what the code originally looked like:
// This is for evaluating actual moves by the Queen sub Q from to: if not fn Q var from var to: die Your Queen may not move from #from to #to; endif; store; for pt path #from #to: move #to #pt; if sub checked var pt and != var pt var from and != var pt var to: die You may not move your Queen through check.; endif; restore; next; return true; endsub;
It first checks whether it is a legal Queen move, and if it is not, it is illegal. That much is good. It then stores the current position and starts looping through the path between its origin and its destination. That much is also good. The problem is that it is working with the position after the Queen has moved. Note that inside the loop, it moves the Queen from #to to #pt. It should not be doing this. Instead, the position should have been restored to what it was before the Queen moved, and each iteration through the loop should move the Queen from its original space to the space along its path that the loop has reached. To fix this, I added "store before" to the Pre-Move code for each side, and I rewrote this subroutine to look like this:
// This is for evaluating actual moves by the Queen sub Q from to: my pt; if not fn Q var from var to: die Your Queen may not move from #from to #to; endif; store; for pt path #from #to: restore before; move #from #pt; if sub checked var pt: die You may not move your Queen through check.; endif; next; restore; return true; endsub;
Note that I also deleted the "and != var pt var from and != var pt var to" part from one of the lines. This was making sure that the position indicated was not the Queen's original space or its destination, but these positions were not actually included in the path anyway, as the path function just returns the shortest path between two spaces. When the two spaces are adjacent, it returns no positions. Apart from that, the main change was to distinguish between "restore before" and just "restore". The former would restore the position before the Queen moved, and the latter would restore the position to what it was after the Queen moved.
For some reason the preset itself is not currently showing the lion pieces properly.
I noticed that the url https://www.chessvariants.com/graphics.dir/alfaerie/strong/BHalfDuck.gif
is missing the Black and White Half duck, so the chess piece image for the lion is missing.
It looks like someone tampered with the set file it was using, replacing the Lion pieces with HalfDuck pieces. I have now corrected this.
11 comments displayed
Permalink to the exact comments currently displayed.