Comment by stevage
2 years ago
Yes, I found those rules unclear.
My version:
1. The goal is to capture all the black pieces, which never move.
2. Move one white piece each turn, using the basic rules of chess piece movement. You can't move through red obstacles. Pawns don't promote. There is no check.
3. When you capture a piece (black or white), your white piece turns into the type of piece you just captured.
Here is the updated code. Push D to destroy the selected white piece (if it meets the criteria for being destroyed).
It is also possible to add more pieces e.g. Chinese cannon, or other kind of changes if desired.
Yes, that is much better.
Then, the code that I wrote is OK (I think) except I did not implement capturing white pieces (although if white pieces can capture white pieces and change into the same piece, then effectively the white piece can become vacant if it can reach another white piece).