Changes

Jump to: navigation, search

Traversing Subsets of a Set

23 bytes removed, 21:13, 18 June 2018
no edit summary
}
</pre>
This is how the Carry-Rippler, introduced by [[Marcel van Kervinck]] <ref>[httphttps://groups.google.com/groupd/msg/rec.games.chess/msgKnJvBnhgDKU/f4f0751cc8b928c8 Re: move generators in computer chess, yCi5yBx18PQJ Tricky bit tricks] by [[Marcel van Kervinck]], [[Computer Chess Forums|rgccrec.games.chess]], October 20, 1994</ref> and later by [[Steffan Westcott]] <ref>[http://www.stmintz.com/ccc/index.php?id=490129 Re: algorithm question] by [[Steffan Westcott]], [[CCC]], February 27, 2006</ref> works: we first set all "unused" bits of the set by oring the One's Complement of d. The increment ripples a possible carry through all unused bits - and finally we clear all unused bits again by intersection with the set d:
<pre>
n = ((n | ~d) + 1) & d;

Navigation menu