Changes

Jump to: navigation, search

Files

630 bytes added, 12:01, 20 August 2020
no edit summary
fileDistance = abs (file2 - file1);
</pre>
=Two Squares on a File=Two [[Squares]] are on the same File, if their file distance is zero. The masking of the file bits can be done after the subtraction.<pre>bool squaresOnSameFile(int sq1, int sq2) { return ((sq2 - sq1) & 7) == 0;}</pre>The [https://en.wikipedia.org/wiki/Symmetric_difference Symmetric difference] aka xor is sufficent for the test as well <ref>[http://talkchess.com/forum3/viewtopic.php?f=7&t=74821 An undetected bug for 10 years] by [[Oliver Brausch]], [[CCC]], August 18, 2020</ref><pre>bool squaresOnSameFile(int sq1, int sq2) { return ((sq1 ^ sq2) & 7) == 0;}</pre>
=Pawns and Files=
* [[Half-open File]]
* [[Intersection Squares]]
=References=
<references/>
'''[[Chess|Up one Level]]'''

Navigation menu