<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"  xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:access="http://www.bloglines.com/about/specs/fac-1.0">
  <access:restriction relationship="allow" />
  <channel>
    <title>Wikispaces : chessprogramming - items matching description</title>
    <link>https://chessprogramming.wikispaces.com/space/view</link>
    <description>Filtered items at Wikispaces : chessprogramming</description>
    
    <webMaster>help@wikispaces.com (Wikispaces)</webMaster>
    <generator>https://www.wikispaces.com/</generator>
    <ttl>60</ttl>
    <atom:link href="https://chessprogramming.wikispaces.com/space/xmlo?v=rss_2_0" rel="self" type="application/rss+xml" />
    <image>
      <title>Wikispaces : chessprogramming - items matching description</title>
      <url>https://www.wikispaces.com/i/l.png</url>
      <link>https://chessprogramming.wikispaces.com/space/view</link>
      <width>140</width>
      <height>48</height>
      <description>Wikispaces</description>
    </image>

    <item>
      <title>Butterfly Boards</title>
      <link>https://chessprogramming.wikispaces.com/Butterfly+Boards</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Butterfly+Boards</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Butterfly+Boards</comments>
      <pubDate>Tue, 27 Jan 2015 19:02:19 GMT</pubDate>
      <description>&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Programming&quot;&gt;Programming&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Data&quot;&gt;Data&lt;/a&gt; * Butterfly Boards&lt;/strong&gt;&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:264:&amp;lt;a href=&amp;quot;http://www.mcescher.com/Gallery/symmetry-bmp/E70.jpg&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/Symmetry.jpg/157875141/245x239/Symmetry.jpg&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; style=&amp;quot;height: 239px; width: 245px;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;http://www.mcescher.com/Gallery/symmetry-bmp/E70.jpg&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/Symmetry.jpg/157875141/245x239/Symmetry.jpg&quot; alt=&quot;Symmetry.jpg&quot; title=&quot;Symmetry.jpg&quot; style=&quot;height: 239px; width: 245px;&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:264 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td rowspan=&quot;2&quot;&gt;&lt;strong&gt;Butterfly Boards&lt;/strong&gt;&lt;br /&gt;
are two-dimensional &lt;a class=&quot;wiki_link&quot; href=&quot;/Array&quot;&gt;arrays&lt;/a&gt; (typically of various history counters for each color), indexed by the &lt;a class=&quot;wiki_link&quot; href=&quot;/Origin%20Square&quot;&gt;from-&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Target%20Square&quot;&gt;to-square&lt;/a&gt; coordinates of (valid and likely &lt;a class=&quot;wiki_link&quot; href=&quot;/Quiet%20Moves&quot;&gt;quiet&lt;/a&gt;) &lt;a class=&quot;wiki_link&quot; href=&quot;/Moves&quot;&gt;moves&lt;/a&gt;, which appear inside the &lt;a class=&quot;wiki_link&quot; href=&quot;/Search&quot;&gt;search&lt;/a&gt;. Those counters can then be used for &lt;a class=&quot;wiki_link&quot; href=&quot;/Move%20Ordering&quot;&gt;move ordering&lt;/a&gt; as mentioned in the &lt;a class=&quot;wiki_link&quot; href=&quot;/History%20Heuristic&quot;&gt;history heuristic&lt;/a&gt;, or to decide about &lt;a class=&quot;wiki_link&quot; href=&quot;/Late%20Move%20Reductions&quot;&gt;late move reductions&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/History%20Leaf%20Pruning&quot;&gt;history leaf pruning&lt;/a&gt;. Another application is a kind of &lt;a class=&quot;wiki_link&quot; href=&quot;/Killer%20Heuristic&quot;&gt;killer-&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Refutation%20Table&quot;&gt;refutation table&lt;/a&gt;, to store a refutation of a specific move &lt;!-- ws:start:WikiTextRefRule:12:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Dap%20Hartmann&amp;quot;&amp;gt;Dap Hartmann&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Peter%20Kouwenhoven&amp;quot;&amp;gt;Peter Kouwenhoven&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;1991&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;Sundry Computer Chess Topics&amp;lt;/em&amp;gt;. &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Advances%20in%20Computer%20Chess%206&amp;quot;&amp;gt;Advances in Computer Chess 6&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:12 --&gt;, also base of the &lt;a class=&quot;wiki_link&quot; href=&quot;/Countermove%20Heuristic&quot;&gt;countermove heuristic&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:19:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Jos%20Uiterwijk&amp;quot;&amp;gt;Jos Uiterwijk&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;1992&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;The Countermove Heuristic&amp;lt;/em&amp;gt;. &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/ICGA%20Journal#15_1&amp;quot;&amp;gt;ICCA Journal, Vol. 15, No. 1&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:19 --&gt; &lt;!-- ws:start:WikiTextRefRule:23:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=47953&amp;amp;amp;start=2&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: History pruning / move ordering question&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Don%20Dailey&amp;quot;&amp;gt;Don Dailey&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, May 10, 2013&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-3&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:23 --&gt;.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Arts#Escher&quot;&gt;M. C. Escher&lt;/a&gt;, Symmetry &lt;!-- ws:start:WikiTextRefRule:26:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.mcescher.com/Gallery/gallery-symmetry.htm&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Picture gallery &amp;amp;quot;Symmetry&amp;amp;quot;&amp;lt;/a&amp;gt; from &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.mcescher.com/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;The Official M.C. Escher Website&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-4&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-4&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:26 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextTocRule:85:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:85 --&gt;&lt;!-- ws:start:WikiTextTocRule:86: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Layout&quot;&gt;Layout&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:86 --&gt;&lt;!-- ws:start:WikiTextTocRule:87: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Valid Entries&quot;&gt;Valid Entries&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:87 --&gt;&lt;!-- ws:start:WikiTextTocRule:88: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#The Eponym&quot;&gt;The Eponym&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:88 --&gt;&lt;!-- ws:start:WikiTextTocRule:89: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#The Butterfly&quot;&gt;The Butterfly&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:89 --&gt;&lt;!-- ws:start:WikiTextTocRule:90: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#The Butterfly-Single Shape&quot;&gt;Single Shape&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:90 --&gt;&lt;!-- ws:start:WikiTextTocRule:91: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#The Butterfly-Connected Shapes&quot;&gt;Connected Shapes&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:91 --&gt;&lt;!-- ws:start:WikiTextTocRule:92: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#C-Code&quot;&gt;C-Code&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:92 --&gt;&lt;!-- ws:start:WikiTextTocRule:93: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Analogy in Astronomy&quot;&gt;Analogy in Astronomy&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:93 --&gt;&lt;!-- ws:start:WikiTextTocRule:94: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:94 --&gt;&lt;!-- ws:start:WikiTextTocRule:95: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Publications&quot;&gt;Publications&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:95 --&gt;&lt;!-- ws:start:WikiTextTocRule:96: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External links&quot;&gt;External links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:96 --&gt;&lt;!-- ws:start:WikiTextTocRule:97: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#External links-Wikipedia&quot;&gt;Wikipedia&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:97 --&gt;&lt;!-- ws:start:WikiTextTocRule:98: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#External links-Musicvideo&quot;&gt;Musicvideo&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:98 --&gt;&lt;!-- ws:start:WikiTextTocRule:99: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:99 --&gt;&lt;!-- ws:start:WikiTextTocRule:100: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:100 --&gt;&lt;!-- ws:start:WikiTextTocRule:101: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:101 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:55:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Layout&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:55 --&gt;Layout&lt;/h1&gt;
 The size of the &lt;a class=&quot;wiki_link&quot; href=&quot;/Array&quot;&gt;array&lt;/a&gt; is 4K (64 x 64 = 4096) elements for each color, but the density is poor, since most &lt;a class=&quot;wiki_link&quot; href=&quot;/Origin%20Square&quot;&gt;from-&lt;/a&gt;  and &lt;a class=&quot;wiki_link&quot; href=&quot;/Target%20Square&quot;&gt;to-square&lt;/a&gt; combinations are illegal moves by the rules of chess. Thus, most entries inside the Butterfly boards are not used. Also, as an additional drawback, from-to coordinates, specially those with &lt;a class=&quot;wiki_link&quot; href=&quot;/Distance&quot;&gt;distance&lt;/a&gt; one, are ambiguous and may be legal for several &lt;a class=&quot;wiki_link&quot; href=&quot;/Pieces&quot;&gt;pieces&lt;/a&gt;. For instance e2-e3 might be a rook-, queen-, king- or white pawn-move. However, knight-, rook- and bishop moves are disjoint, queen moves are the superset from rook- and bishop-moves, king-moves the one-distance subset of queen moves, and &lt;a class=&quot;wiki_link&quot; href=&quot;/Pawn%20Push&quot;&gt;pawn pushes&lt;/a&gt; are subset of rook-moves, while pawn captures and &lt;a class=&quot;wiki_link&quot; href=&quot;/En%20passant&quot;&gt;en passant&lt;/a&gt; (if stored at all) are subset of bishop-moves.&lt;br /&gt;
&lt;br /&gt;
Therefor some programmers omit the origin from-square, but use piece-type instead for denser 12 x 64 tables with only 3/4K entries - or exclude not only captures, but also pawn pushes and/or king moves. Other programmers have abandoned hashing moves for &lt;a class=&quot;wiki_link&quot; href=&quot;/History%20Heuristic&quot;&gt;History Heuristic&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Late%20Move%20Reductions&quot;&gt;LMR&lt;/a&gt;, and say that given enough search depth, History counters produce just some random noise &lt;!-- ws:start:WikiTextRefRule:30:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;amp;p=163477&amp;amp;amp;t=18345&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: LMR: history or not?&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Robert%20Hyatt&amp;quot;&amp;gt;Robert Hyatt&amp;lt;/a&amp;gt; from &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, December 13, 2007&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-5&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-5&quot;&gt;[5]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:30 --&gt; .&lt;br /&gt;
&lt;br /&gt;
This is how butterfly boards may be declared in &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;counterType arrWhiteButterfly[64][64]; // from, to -&amp;amp;gt; 4K&amp;lt;br/&amp;gt;counterType arrBlackButterfly[64][64]; // from, to -&amp;amp;gt; 4K&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;counterType arrWhiteButterfly&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// from, to -&amp;gt; 4K&lt;/span&gt;
counterType arrBlackButterfly&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// from, to -&amp;gt; 4K&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;or&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;counterType arrButterfly[2][64][64]; // color, from, to -&amp;amp;gt; 8K&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;counterType arrButterfly&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// color, from, to -&amp;gt; 8K&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:57:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Valid Entries&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:57 --&gt;Valid Entries&lt;/h1&gt;
 As mentioned in &lt;a class=&quot;wiki_link&quot; href=&quot;/Influence%20Quantity%20of%20Pieces&quot;&gt;Influence Quantity of Pieces&lt;/a&gt;, there are only 1792 (7/16 of 4K) possible valid moves coordinates, 9/16 of the space in the Butterfly boards is &amp;quot;wasted&amp;quot;.&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;Piece&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;covers other pieces&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;#&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;div 112 (7*16)&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;Rook&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;queen, king and pawn pushes&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;896&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;8&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;Bishop&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;queen, king and pawn captures&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;560&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;5&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;Knight&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;-&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;336&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;3&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot;&gt;possible from-to move coordinates&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1792&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;16&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:59:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;The Eponym&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:59 --&gt;The Eponym&lt;/h1&gt;
 The name Butterfly Boards was proposed by &lt;a class=&quot;wiki_link&quot; href=&quot;/Dap%20Hartmann&quot;&gt;Dap Hartmann&lt;/a&gt; in 1988, when he introduced the &lt;a class=&quot;wiki_link&quot; href=&quot;/Butterfly%20Heuristic&quot;&gt;Butterfly Heuristic&lt;/a&gt; in the &lt;a class=&quot;wiki_link&quot; href=&quot;/ICGA%20Journal&quot;&gt;ICCA Journal&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:37:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Dap%20Hartmann&amp;quot;&amp;gt;Dap Hartmann&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;1988&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;Butterfly Boards&amp;lt;/em&amp;gt;. &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/ICGA%20Journal#11_23&amp;quot;&amp;gt;ICCA Journal, Vol. 11, Nos. 2/3&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-6&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-6&quot;&gt;[6]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:37 --&gt;, and the application of a Butterfly &lt;a class=&quot;wiki_link&quot; href=&quot;/Refutation%20Table&quot;&gt;refutation table&lt;/a&gt; at the &lt;a class=&quot;wiki_link&quot; href=&quot;/Advances%20in%20Computer%20Chess%206&quot;&gt;Advances in Computer Chess 6&lt;/a&gt; conference in 1990 &lt;!-- ws:start:WikiTextRefRule:45:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Dap%20Hartmann&amp;quot;&amp;gt;Dap Hartmann&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Peter%20Kouwenhoven&amp;quot;&amp;gt;Peter Kouwenhoven&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;1991&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;Sundry Computer Chess Topics&amp;lt;/em&amp;gt;. &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Advances%20in%20Computer%20Chess%206&amp;quot;&amp;gt;Advances in Computer Chess 6&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-7&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-7&quot;&gt;[7]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:45 --&gt;. Plotting the illegal move coordinates as black cells &lt;strong&gt;#&lt;/strong&gt; inside a 64*64 sheet, seven &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Butterfly&quot; rel=&quot;nofollow&quot;&gt;butterfly&lt;/a&gt; shaped pattern appear along the impossible move diagonal (where squares are equal). &lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:61:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;The Butterfly&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:61 --&gt;The Butterfly&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextHeadingRule:63:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc4&quot;&gt;&lt;a name=&quot;The Butterfly-Single Shape&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:63 --&gt;Single Shape&lt;/h2&gt;
 The &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Thorax&quot; rel=&quot;nofollow&quot;&gt;thorax&lt;/a&gt; of the Butterfly is centered by the wraps from one rank (or dependent on the &lt;a class=&quot;wiki_link&quot; href=&quot;/Square%20Mapping%20Considerations&quot;&gt;Square Mapping Considerations&lt;/a&gt;, one file) to the next one. With &#039;a1&#039; as square null mapping, and &#039;d1&#039; as square 3, &#039;e2&#039; is square 12, the shape indexed by square coordinates looks as follows, covering two wrapped rank &amp;quot;halfs&amp;quot; including their center files, e.g. d1 - e2:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;d e f g h a b c d e        d e f g h a b c d e&amp;lt;br/&amp;gt;1 1 1 1 1 2 2 2 2 2        1 1 1 1 1 2 2 2 2 2&amp;lt;br/&amp;gt;#         #           d1   # - - - - # ~ \ | /&amp;lt;br/&amp;gt;  #       # #         e1   - # - - - # # ~ \ |&amp;lt;br/&amp;gt;    #     # # #       f1   - - # - - # # # ~ \&amp;lt;br/&amp;gt;      #   # # # #     g1   - - - # - # # # # ~&amp;lt;br/&amp;gt;        # # # # # #   h1   - - - - # # # # # #&amp;lt;br/&amp;gt;# # # # # #           a2   # # # # # # - - - -&amp;lt;br/&amp;gt;  # # # #   #         b2   ~ # # # # - # - - -&amp;lt;br/&amp;gt;    # # #     #       c2   \ ~ # # # - - # - -&amp;lt;br/&amp;gt;      # #       #     d2   | \ ~ # # - - - # -&amp;lt;br/&amp;gt;        #         #   e2   / | \ ~ # - - - - #&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;d e f g h a b c d e        d e f g h a b c d e
1 1 1 1 1 2 2 2 2 2        1 1 1 1 1 2 2 2 2 2
#         #           d1   # - - - - # ~ \ | /
  #       # #         e1   - # - - - # # ~ \ |
    #     # # #       f1   - - # - - # # # ~ \
      #   # # # #     g1   - - - # - # # # # ~
        # # # # # #   h1   - - - - # # # # # #
# # # # # #           a2   # # # # # # - - - -
  # # # #   #         b2   ~ # # # # - # - - -
    # # #     #       c2   \ ~ # # # - - # - -
      # #       #     d2   | \ ~ # # - - - # -
        #         #   e2   / | \ ~ # - - - - #&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;That is why Dap Hartmann called it Butterfly Boards.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:65:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc5&quot;&gt;&lt;a name=&quot;The Butterfly-Connected Shapes&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:65 --&gt;Connected Shapes&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;one butterfly spans a 10 square range&lt;/li&gt;&lt;li&gt;n butterflies span an 8*n + 2 square range&lt;/li&gt;&lt;li&gt;seven butterflies span 58 square range, from 3 (d1) to 60 (e8)&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;d e f g h a b c d e f g h a b c d e       d e f g h a b c d e f g h a b c d e&amp;lt;br/&amp;gt;1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3       1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3&amp;lt;br/&amp;gt;#         #                          d1   # - - - - # ~ \ | / ~ # # # \ ~ | ~&amp;lt;br/&amp;gt;  #       # #                        e1   - # - - - # # ~ \ | / ~ # # # \ ~ |&amp;lt;br/&amp;gt;    #     # # #                      f1   - - # - - # # # ~ \ | / ~ # # # \ ~&amp;lt;br/&amp;gt;      #   # # # #                    g1   - - - # - # # # # ~ \ | / # # # # \&amp;lt;br/&amp;gt;        # # # # # #                  h1   - - - - # # # # # # ~ \ | # # # # #&amp;lt;br/&amp;gt;# # # # # #                          a2   # # # # # # - - - - - - - | / ~ # #&amp;lt;br/&amp;gt;  # # # #   #                        b2   ~ # # # # - # - - - - - - \ | / ~ #&amp;lt;br/&amp;gt;    # # #     #                      c2   \ ~ # # # - - # - - - - - ~ \ | / ~&amp;lt;br/&amp;gt;      # #       #         #          d2   | \ ~ # # - - - # - - - - # ~ \ | /&amp;lt;br/&amp;gt;        #         #       # #        e2   / | \ ~ # - - - - # - - - # # ~ \ |&amp;lt;br/&amp;gt;                    #     # # #      f2   ~ / | \ ~ - - - - - # - - # # # ~ \&amp;lt;br/&amp;gt;                      #   # # # #    g2   # ~ / | \ - - - - - - # - # # # # ~&amp;lt;br/&amp;gt;                        # # # # # #  h2   # # ~ / | - - - - - - - # # # # # #&amp;lt;br/&amp;gt;                # # # # # #          a3   # # # # # | \ ~ # # # # # # - - - -&amp;lt;br/&amp;gt;                  # # # #   #        b3   \ # # # # / | \ ~ # # # # - # - - -&amp;lt;br/&amp;gt;                    # # #     #      c3   ~ \ # # # ~ / | \ ~ # # # - - # - -&amp;lt;br/&amp;gt;                      # #       #    d3   | ~ \ # # # ~ / | \ ~ # # - - - # -&amp;lt;br/&amp;gt;                        #         #  e3   ~ | ~ \ # # # ~ / | \ ~ # - - - - #&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;d e f g h a b c d e f g h a b c d e       d e f g h a b c d e f g h a b c d e
1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3       1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3
#         #                          d1   # - - - - # ~ \ | / ~ # # # \ ~ | ~
  #       # #                        e1   - # - - - # # ~ \ | / ~ # # # \ ~ |
    #     # # #                      f1   - - # - - # # # ~ \ | / ~ # # # \ ~
      #   # # # #                    g1   - - - # - # # # # ~ \ | / # # # # \
        # # # # # #                  h1   - - - - # # # # # # ~ \ | # # # # #
# # # # # #                          a2   # # # # # # - - - - - - - | / ~ # #
  # # # #   #                        b2   ~ # # # # - # - - - - - - \ | / ~ #
    # # #     #                      c2   \ ~ # # # - - # - - - - - ~ \ | / ~
      # #       #         #          d2   | \ ~ # # - - - # - - - - # ~ \ | /
        #         #       # #        e2   / | \ ~ # - - - - # - - - # # ~ \ |
                    #     # # #      f2   ~ / | \ ~ - - - - - # - - # # # ~ \
                      #   # # # #    g2   # ~ / | \ - - - - - - # - # # # # ~
                        # # # # # #  h2   # # ~ / | - - - - - - - # # # # # #
                # # # # # #          a3   # # # # # | \ ~ # # # # # # - - - -
                  # # # #   #        b3   \ # # # # / | \ ~ # # # # - # - - -
                    # # #     #      c3   ~ \ # # # ~ / | \ ~ # # # - - # - -
                      # #       #    d3   | ~ \ # # # ~ / | \ ~ # # - - - # -
                        #         #  e3   ~ | ~ \ # # # ~ / | \ ~ # - - - - #&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:67:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc6&quot;&gt;&lt;a name=&quot;C-Code&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:67 --&gt;C-Code&lt;/h1&gt;
 Some arbitrary &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;-code, to produce the plot:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;#include &amp;amp;quot;stdafx.h&amp;amp;quot;&amp;lt;br/&amp;gt;#include &amp;amp;lt;math.h&amp;amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;void butterflyBoard(int from, int to) {&amp;lt;br/&amp;gt;   int sq1, sq2, f1, f2, r1, r2, df, dr;&amp;lt;br/&amp;gt;   int nr = 0, nb = 0, nn = 0;&amp;lt;br/&amp;gt;   for (sq2 = from; sq2 &amp;amp;lt;= to; sq2++)&amp;lt;br/&amp;gt;      printf(&amp;amp;quot;%c&amp;amp;quot;, (sq2 % 10) ? &#039; &#039; : &#039;0&#039; + (sq2/10) );&amp;lt;br/&amp;gt;   printf(&amp;amp;quot;\n&amp;amp;quot;);&amp;lt;br/&amp;gt;   for (sq2 = from; sq2 &amp;amp;lt;= to; sq2++)&amp;lt;br/&amp;gt;      printf(&amp;amp;quot;%1d&amp;amp;quot;, sq2 % 10 );&amp;lt;br/&amp;gt;   printf(&amp;amp;quot;\n&amp;amp;quot;);&amp;lt;br/&amp;gt;   for (sq1 = from; sq1 &amp;amp;lt;= to; sq1++) {&amp;lt;br/&amp;gt;      for (sq2 = from; sq2 &amp;amp;lt;= to; sq2++) {&amp;lt;br/&amp;gt;         if ( sq1 != sq2 ) {&amp;lt;br/&amp;gt;            r1 = sq1 &amp;amp;gt;&amp;amp;gt; 3;&amp;lt;br/&amp;gt;            r2 = sq2 &amp;amp;gt;&amp;amp;gt; 3;&amp;lt;br/&amp;gt;            if (r1 == r2) { // same rank&amp;lt;br/&amp;gt;               nr++;&amp;lt;br/&amp;gt;               printf(&amp;amp;quot;-&amp;amp;quot;);&amp;lt;br/&amp;gt;               continue;&amp;lt;br/&amp;gt;            }&amp;lt;br/&amp;gt;            f1 = sq1 &amp;amp;amp; 7;&amp;lt;br/&amp;gt;            f2 = sq2 &amp;amp;amp; 7;&amp;lt;br/&amp;gt;            if ( f1 == f2 ) { // same file&amp;lt;br/&amp;gt;               nr++;&amp;lt;br/&amp;gt;               printf(&amp;amp;quot;|&amp;amp;quot;);&amp;lt;br/&amp;gt;               continue;&amp;lt;br/&amp;gt;            }&amp;lt;br/&amp;gt;            if  (f1 - r1 == f2 - r2) { // same diagonal&amp;lt;br/&amp;gt;               nb++;&amp;lt;br/&amp;gt;               printf(&amp;amp;quot;/&amp;amp;quot;);&amp;lt;br/&amp;gt;               continue;&amp;lt;br/&amp;gt;            }&amp;lt;br/&amp;gt;            if  (f1 + r1 == f2 + r2) { // same anti-diagonal&amp;lt;br/&amp;gt;               nb++;&amp;lt;br/&amp;gt;               printf(&amp;amp;quot;\\&amp;amp;quot;);&amp;lt;br/&amp;gt;               continue;&amp;lt;br/&amp;gt;            }&amp;lt;br/&amp;gt;            df = abs (f2 - f1);&amp;lt;br/&amp;gt;            dr = abs (r2 - r1);&amp;lt;br/&amp;gt;            if ( df + dr == 3 )    { // knight distance&amp;lt;br/&amp;gt;               nn++;&amp;lt;br/&amp;gt;               printf(&amp;amp;quot;~&amp;amp;quot;);&amp;lt;br/&amp;gt;               continue;&amp;lt;br/&amp;gt;            }&amp;lt;br/&amp;gt;         }&amp;lt;br/&amp;gt;         printf(&amp;amp;quot;#&amp;amp;quot;); // invalid&amp;lt;br/&amp;gt;      }&amp;lt;br/&amp;gt;      printf(&amp;amp;quot; %2d\n&amp;amp;quot;, sq1);&amp;lt;br/&amp;gt;   }&amp;lt;br/&amp;gt;   printf(&amp;amp;quot;rook   moves %4d\n&amp;amp;quot;, nr);&amp;lt;br/&amp;gt;   printf(&amp;amp;quot;bishop moves %4d\n&amp;amp;quot;, nb);&amp;lt;br/&amp;gt;   printf(&amp;amp;quot;knight moves %4d\n&amp;amp;quot;, nn);&amp;lt;br/&amp;gt;   printf(&amp;amp;quot;total  moves %4d\n&amp;amp;quot;, nr + nb + nn);&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;int main(int argc, char* argv[])&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;   butterflyBoard(3, 20); // 0, 63&amp;lt;br/&amp;gt;   return 0;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;co2&quot;&gt;#include &amp;quot;stdafx.h&amp;quot;&lt;/span&gt;
&lt;span class=&quot;co2&quot;&gt;#include &amp;lt;math.h&amp;gt;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; butterflyBoard&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; from, &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; to&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq1, sq2, f1, f2, r1, r2, df, dr&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; nr &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, nb &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, nn &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq2 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; from&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq2 &lt;span class=&quot;sy1&quot;&gt;&amp;lt;=&lt;/span&gt; to&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq2&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;%c&amp;quot;&lt;/span&gt;, &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq2 &lt;span class=&quot;sy2&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039; &#039;&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#039;0&#039;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq2&lt;span class=&quot;sy2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es1&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq2 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; from&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq2 &lt;span class=&quot;sy1&quot;&gt;&amp;lt;=&lt;/span&gt; to&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq2&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;%1d&amp;quot;&lt;/span&gt;, sq2 &lt;span class=&quot;sy2&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es1&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq1 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; from&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq1 &lt;span class=&quot;sy1&quot;&gt;&amp;lt;=&lt;/span&gt; to&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq1&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq2 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; from&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq2 &lt;span class=&quot;sy1&quot;&gt;&amp;lt;=&lt;/span&gt; to&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq2&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
         &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; sq1 &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq2 &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
            r1 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq1 &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            r2 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq2 &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;r1 &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; r2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// same rank&lt;/span&gt;
               nr&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;-&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;kw1&quot;&gt;continue&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
            f1 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq1 &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            f2 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq2 &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; f1 &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; f2 &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// same file&lt;/span&gt;
               nr&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;|&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;kw1&quot;&gt;continue&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt;  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;f1 &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; r1 &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; f2 &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; r2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// same diagonal&lt;/span&gt;
               nb&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;kw1&quot;&gt;continue&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt;  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;f1 &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; r1 &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; f2 &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; r2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// same anti-diagonal&lt;/span&gt;
               nb&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es1&quot;&gt;\\&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;kw1&quot;&gt;continue&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
            df &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;abs&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;f2 &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; f1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            dr &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;abs&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;r2 &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; r1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; df &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; dr &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// knight distance&lt;/span&gt;
               nn&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;~&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;kw1&quot;&gt;continue&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
         &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
         &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;#&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// invalid&lt;/span&gt;
      &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
      &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot; %2d&lt;span class=&quot;es1&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;, sq1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;rook   moves %4d&lt;span class=&quot;es1&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;, nr&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;bishop moves %4d&lt;span class=&quot;es1&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;, nb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;knight moves %4d&lt;span class=&quot;es1&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;, nn&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;total  moves %4d&lt;span class=&quot;es1&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;, nr &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; nb &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; nn&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; main&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; argc, &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; argv&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   butterflyBoard&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 0, 63&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:69:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc7&quot;&gt;&lt;a name=&quot;Analogy in Astronomy&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:69 --&gt;Analogy in Astronomy&lt;/h1&gt;
 Dap Hartmann found a nice analogy in astronomy. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Edward_Walter_Maunder&quot; rel=&quot;nofollow&quot;&gt;Edward Maunders&lt;/a&gt; was the first astronomer (1904) to plot the distribution in &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.answers.com/topic/heliographic-latitude&quot; rel=&quot;nofollow&quot;&gt;heliographic latitude&lt;/a&gt; of the centers of &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.ips.gov.au/Educational/2/2/3&quot; rel=&quot;nofollow&quot;&gt;sunspot groups&lt;/a&gt; as a functions of time:&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:266:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/Edward_Walter_Maunder#Solar_observations&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/Sunspot-bfly.gif/475984866/718x296/Sunspot-bfly.gif&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; style=&amp;quot;height: 296px; width: 718px;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Edward_Walter_Maunder#Solar_observations&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/Sunspot-bfly.gif/475984866/718x296/Sunspot-bfly.gif&quot; alt=&quot;Sunspot-bfly.gif&quot; title=&quot;Sunspot-bfly.gif&quot; style=&quot;height: 296px; width: 718px;&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:266 --&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;A modern version of the Mauders&#039; sunspot &amp;quot;butterfly diagram&amp;quot; &lt;!-- ws:start:WikiTextRefRule:47:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Edward_Walter_Maunder#Solar_observations&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Edward Walter Maunder, Solar observations&amp;lt;/a&amp;gt; A modern version of the Mauders&#039; sunspot &amp;amp;quot;butterfly diagram&amp;amp;quot;. (This version from the solar group at NASA Marshall Space Flight Center.)&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-8&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-8&quot;&gt;[8]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:47 --&gt; .&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:71:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc8&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:71 --&gt;See also&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Bobby#StrategicQuiescenceSearch&quot;&gt;Bobby&#039;s Strategic Quiescence Search&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Butterfly%20Heuristic&quot;&gt;Butterfly Heuristic&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Countermove%20Heuristic&quot;&gt;Countermove Heuristic&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/History%20Heuristic&quot;&gt;History Heuristic&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/History%20Leaf%20Pruning&quot;&gt;History Leaf Pruning&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Late%20Move%20Reductions&quot;&gt;Late Move Reductions&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Monarch&quot;&gt;Monarch&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Refutation%20Table&quot;&gt;Refutation Table&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Relative%20History%20Heuristic&quot;&gt;Relative History Heuristic&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:73:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc9&quot;&gt;&lt;a name=&quot;Publications&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:73 --&gt;Publications&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Jonathan%20Schaeffer&quot;&gt;Jonathan Schaeffer&lt;/a&gt; (&lt;strong&gt;1983&lt;/strong&gt;). &lt;em&gt;The History Heuristic&lt;/em&gt;. &lt;a class=&quot;wiki_link&quot; href=&quot;/ICGA%20Journal#6_3&quot;&gt;ICCA Journal, Vol. 6, No. 3&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Dap%20Hartmann&quot;&gt;Dap Hartmann&lt;/a&gt; (&lt;strong&gt;1988&lt;/strong&gt;). &lt;em&gt;Butterfly Boards&lt;/em&gt;. &lt;a class=&quot;wiki_link&quot; href=&quot;/ICGA%20Journal#11_23&quot;&gt;ICCA Journal, Vol. 11, Nos. 2/3&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Dap%20Hartmann&quot;&gt;Dap Hartmann&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Peter%20Kouwenhoven&quot;&gt;Peter Kouwenhoven&lt;/a&gt; (&lt;strong&gt;1991&lt;/strong&gt;). &lt;em&gt;Sundry Computer Chess Topics&lt;/em&gt;. &lt;a class=&quot;wiki_link&quot; href=&quot;/Advances%20in%20Computer%20Chess%206&quot;&gt;Advances in Computer Chess 6&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Jos%20Uiterwijk&quot;&gt;Jos Uiterwijk&lt;/a&gt; (&lt;strong&gt;1992&lt;/strong&gt;). &lt;em&gt;The Countermove Heuristic&lt;/em&gt;. &lt;a class=&quot;wiki_link&quot; href=&quot;/ICGA%20Journal#15_1&quot;&gt;ICCA Journal, Vol. 15, No. 1&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:75:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc10&quot;&gt;&lt;a name=&quot;External links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:75 --&gt;External links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.asurowiki.de/pmwiki/pmwiki.php/Main/AVRButterflyBoard&quot; rel=&quot;nofollow&quot;&gt;AVR Butterfly Board&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.asurowiki.de/pmwiki/pmwiki.php&quot; rel=&quot;nofollow&quot;&gt;Asuro Wiki&lt;/a&gt; (German)&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:77:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc11&quot;&gt;&lt;a name=&quot;External links-Wikipedia&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:77 --&gt;Wikipedia&lt;/h2&gt;
 Butterflies from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Main_Page&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:49:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Butterfly_%28disambiguation%29&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Butterfly (disambiguation) from Wikipedia&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-9&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-9&quot;&gt;[9]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:49 --&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Butterfly&quot; rel=&quot;nofollow&quot;&gt;Butterfly insect&lt;/a&gt; of the order &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Lepidoptera&quot; rel=&quot;nofollow&quot;&gt;Lepidoptera&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Butterfly_%28game%29&quot; rel=&quot;nofollow&quot;&gt;Butterfly Game&lt;/a&gt; a &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Abstract_strategy_game&quot; rel=&quot;nofollow&quot;&gt;two-player abstract strategy game&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Mozambique&quot; rel=&quot;nofollow&quot;&gt;Mozambique&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/BBN_Butterfly&quot; rel=&quot;nofollow&quot;&gt;BBN Butterfly&lt;/a&gt; a massively parallel computer from the 1980s&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Butterfly_diagram&quot; rel=&quot;nofollow&quot;&gt;Butterfly diagram&lt;/a&gt; in the context of &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Fast_Fourier_transform&quot; rel=&quot;nofollow&quot;&gt;fast Fourier transform&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:52:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.relisoft.com/Science/Physics/fft.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Fast Fourier Transform (FFT)&amp;lt;/a&amp;gt; from &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.relisoft.com/index.htm&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Reliable Software&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-10&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-10&quot;&gt;[10]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:52 --&gt; algorithms&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Zassenhaus_lemma&quot; rel=&quot;nofollow&quot;&gt;Butterfly or Zassenhaus lemma&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://de.wikipedia.org/wiki/Schmetterlingsgraph&quot; rel=&quot;nofollow&quot;&gt;Schmetterlingsgraph&lt;/a&gt; (German)&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Butterfly_knot&quot; rel=&quot;nofollow&quot;&gt;Butterfly knot&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Butterfly_theorem&quot; rel=&quot;nofollow&quot;&gt;Butterfly theorem&lt;/a&gt; in elementary geometry&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Butterfly_curve_%28algebraic%29&quot; rel=&quot;nofollow&quot;&gt;Butterfly curve (algebraic)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Butterfly_curve_%28transcendental%29&quot; rel=&quot;nofollow&quot;&gt;Butterfly curve (transcendental)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Butterfly_catastrophe#Butterfly_catastrophe&quot; rel=&quot;nofollow&quot;&gt;Butterfly catastrophe&lt;/a&gt; Catastrophe theory&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Butterfly_%28options%29&quot; rel=&quot;nofollow&quot;&gt;Butterfly options&lt;/a&gt; a combination option trade strategy&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Iron_Butterfly_Spread&quot; rel=&quot;nofollow&quot;&gt;Iron Butterfly spread&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Iron_Butterfly&quot; rel=&quot;nofollow&quot;&gt;Iron Butterfly (band)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Butterfly_ballot#Design&quot; rel=&quot;nofollow&quot;&gt;Butterfly ballot&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Butterfly_effect&quot; rel=&quot;nofollow&quot;&gt;Butterfly effect&lt;/a&gt; in the context of &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Chaos_theory&quot; rel=&quot;nofollow&quot;&gt;Chaos theory&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/The_Butterfly_Effect&quot; rel=&quot;nofollow&quot;&gt;The Butterfly Effect (Film)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/The_Butterfly_Effect_%28band%29&quot; rel=&quot;nofollow&quot;&gt;The Butterfly Effect (band)&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:79:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc12&quot;&gt;&lt;a name=&quot;External links-Musicvideo&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:79 --&gt;Musicvideo&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#HerbieHancock&quot;&gt;Herbie Hancock&lt;/a&gt; &amp;amp; &lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#TheHeadhunters&quot;&gt;The Headhunters&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Thrust_%28album%29&quot; rel=&quot;nofollow&quot;&gt;Butterfly&lt;/a&gt;, 1974, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/YouTube&quot; rel=&quot;nofollow&quot;&gt;YouTube&lt;/a&gt; Video&lt;br /&gt;
&lt;!-- ws:start:WikiTextMediaRule:53:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/custom/24662616?h=0&amp;amp;w=0&amp;quot; class=&amp;quot;WikiMedia WikiMediaCustom&amp;quot; id=&amp;quot;wikitext@@media@@type=&amp;amp;quot;custom&amp;amp;quot; key=&amp;amp;quot;24662616&amp;amp;quot;&amp;quot; title=&amp;quot;Custom Media&amp;quot;/&amp;gt; --&gt;&lt;iframe width=&quot;480&quot; height=&quot;360&quot; src=&quot;//www.youtube.com/embed/5knsdyW9OqY?rel=0&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;&lt;!-- ws:end:WikiTextMediaRule:53 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:81:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc13&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:81 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:433:&amp;amp;lt;references&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Dap%20Hartmann&quot;&gt;Dap Hartmann&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Peter%20Kouwenhoven&quot;&gt;Peter Kouwenhoven&lt;/a&gt; (&lt;strong&gt;1991&lt;/strong&gt;). &lt;em&gt;Sundry Computer Chess Topics&lt;/em&gt;. &lt;a class=&quot;wiki_link&quot; href=&quot;/Advances%20in%20Computer%20Chess%206&quot;&gt;Advances in Computer Chess 6&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Jos%20Uiterwijk&quot;&gt;Jos Uiterwijk&lt;/a&gt; (&lt;strong&gt;1992&lt;/strong&gt;). &lt;em&gt;The Countermove Heuristic&lt;/em&gt;. &lt;a class=&quot;wiki_link&quot; href=&quot;/ICGA%20Journal#15_1&quot;&gt;ICCA Journal, Vol. 15, No. 1&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-3&quot;&gt;&lt;a href=&quot;#cite_ref-3&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=47953&amp;amp;start=2&quot; rel=&quot;nofollow&quot;&gt;Re: History pruning / move ordering question&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Don%20Dailey&quot;&gt;Don Dailey&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, May 10, 2013&lt;/li&gt;
&lt;li id=&quot;cite_note-4&quot;&gt;&lt;a href=&quot;#cite_ref-4&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.mcescher.com/Gallery/gallery-symmetry.htm&quot; rel=&quot;nofollow&quot;&gt;Picture gallery &amp;quot;Symmetry&amp;quot;&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.mcescher.com/&quot; rel=&quot;nofollow&quot;&gt;The Official M.C. Escher Website&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-5&quot;&gt;&lt;a href=&quot;#cite_ref-5&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;p=163477&amp;amp;t=18345&quot; rel=&quot;nofollow&quot;&gt;Re: LMR: history or not?&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Robert%20Hyatt&quot;&gt;Robert Hyatt&lt;/a&gt; from &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;CCC&lt;/a&gt;, December 13, 2007&lt;/li&gt;
&lt;li id=&quot;cite_note-6&quot;&gt;&lt;a href=&quot;#cite_ref-6&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Dap%20Hartmann&quot;&gt;Dap Hartmann&lt;/a&gt; (&lt;strong&gt;1988&lt;/strong&gt;). &lt;em&gt;Butterfly Boards&lt;/em&gt;. &lt;a class=&quot;wiki_link&quot; href=&quot;/ICGA%20Journal#11_23&quot;&gt;ICCA Journal, Vol. 11, Nos. 2/3&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-7&quot;&gt;&lt;a href=&quot;#cite_ref-7&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Dap%20Hartmann&quot;&gt;Dap Hartmann&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Peter%20Kouwenhoven&quot;&gt;Peter Kouwenhoven&lt;/a&gt; (&lt;strong&gt;1991&lt;/strong&gt;). &lt;em&gt;Sundry Computer Chess Topics&lt;/em&gt;. &lt;a class=&quot;wiki_link&quot; href=&quot;/Advances%20in%20Computer%20Chess%206&quot;&gt;Advances in Computer Chess 6&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-8&quot;&gt;&lt;a href=&quot;#cite_ref-8&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Edward_Walter_Maunder#Solar_observations&quot; rel=&quot;nofollow&quot;&gt;Edward Walter Maunder, Solar observations&lt;/a&gt; A modern version of the Mauders&#039; sunspot &amp;quot;butterfly diagram&amp;quot;. (This version from the solar group at NASA Marshall Space Flight Center.)&lt;/li&gt;
&lt;li id=&quot;cite_note-9&quot;&gt;&lt;a href=&quot;#cite_ref-9&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Butterfly_%28disambiguation%29&quot; rel=&quot;nofollow&quot;&gt;Butterfly (disambiguation) from Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-10&quot;&gt;&lt;a href=&quot;#cite_ref-10&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.relisoft.com/Science/Physics/fft.html&quot; rel=&quot;nofollow&quot;&gt;Fast Fourier Transform (FFT)&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.relisoft.com/index.htm&quot; rel=&quot;nofollow&quot;&gt;Reliable Software&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:433 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:83:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc14&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:83 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:05:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Butterfly Boards&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Butterfly Boards&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Butterfly_Boards includeBody-Butterfly%20Boards includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Array&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Array&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 1, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bobby&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bobby&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Butterfly+Boards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Butterfly Boards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 27, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Butterfly+Heuristic&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Butterfly Heuristic&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 6, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Countermove+Heuristic&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Countermove Heuristic&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 1, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dap+Hartmann&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dap Hartmann&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dappet&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dappet&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 12, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Data&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Data&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 26, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dictionary&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dictionary&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Direction&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Direction&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 6, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Encoding+Moves&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Encoding Moves&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/History+Heuristic&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;History Heuristic&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 19, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/History+Leaf+Pruning&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;History Leaf Pruning&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 15, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/ICGA+Journal&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;ICGA Journal&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 21, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Influence+Quantity+of+Pieces&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Influence Quantity of Pieces&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 21, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Last+Best+Reply&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Last Best Reply&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 6, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mathematician&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mathematician&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 9, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Moves&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Moves&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 19, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Neural+MoveMap+Heuristic&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Neural MoveMap Heuristic&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 24, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Relative+History+Heuristic&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Relative History Heuristic&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 8, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Squares&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Squares&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 15, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Table-driven+Move+Generation&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Table-driven Move Generation&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 19, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Vector+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Vector Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 15, 2017&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:05 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Data&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Combinatorial Logic</title>
      <link>https://chessprogramming.wikispaces.com/Combinatorial+Logic</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Combinatorial+Logic</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Combinatorial+Logic</comments>
      <pubDate>Thu, 06 Apr 2017 19:10:43 GMT</pubDate>
      <description>&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Hardware&quot;&gt;Hardware&lt;/a&gt; * Combinatorial Logic&lt;/strong&gt;&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:554:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/Half_adder&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/Half_Adder.svg.png/553814982/Half_Adder.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Half_adder&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/Half_Adder.svg.png/553814982/Half_Adder.svg.png&quot; alt=&quot;Half_Adder.svg.png&quot; title=&quot;Half_Adder.svg.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:554 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td rowspan=&quot;2&quot;&gt;A &lt;strong&gt;Combinatorial Logic&lt;/strong&gt; (also Combinational Logic) is a &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Digital_electronics&quot; rel=&quot;nofollow&quot;&gt;digital circuit&lt;/a&gt; where one or more outputs are &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Boolean_function&quot; rel=&quot;nofollow&quot;&gt;boolean functions&lt;/a&gt; of multiple inputs. The basic boolean operations &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logical_conjunction&quot; rel=&quot;nofollow&quot;&gt;conjunction&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logical_disjunction&quot; rel=&quot;nofollow&quot;&gt;disjunction&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logical_negation&quot; rel=&quot;nofollow&quot;&gt;logical negation&lt;/a&gt; are sufficient to derive all other boolean as well as arithmetical operations. Opposed to a &lt;a class=&quot;wiki_link&quot; href=&quot;/Sequential%20Logic&quot;&gt;sequential logic&lt;/a&gt;, outputs are not dependent on their history, that is a combinatorial logic does not require &lt;a class=&quot;wiki_link&quot; href=&quot;/Memory&quot;&gt;memory&lt;/a&gt;.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Half_adder&quot; rel=&quot;nofollow&quot;&gt;half adder circuit diagram&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextTocRule:79:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:79 --&gt;&lt;!-- ws:start:WikiTextTocRule:80: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Implementation&quot;&gt;Implementation&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:80 --&gt;&lt;!-- ws:start:WikiTextTocRule:81: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Basic Operations&quot;&gt;Basic Operations&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:81 --&gt;&lt;!-- ws:start:WikiTextTocRule:82: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Basic Operations-AND&quot;&gt;AND&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:82 --&gt;&lt;!-- ws:start:WikiTextTocRule:83: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Basic Operations-AND-Truth Table&quot;&gt;Truth Table&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:83 --&gt;&lt;!-- ws:start:WikiTextTocRule:84: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Basic Operations-AND-Symbols and Circuits&quot;&gt;Symbols and Circuits&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:84 --&gt;&lt;!-- ws:start:WikiTextTocRule:85: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Basic Operations-OR&quot;&gt;OR&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:85 --&gt;&lt;!-- ws:start:WikiTextTocRule:86: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Basic Operations-OR-Truth Table&quot;&gt;Truth Table&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:86 --&gt;&lt;!-- ws:start:WikiTextTocRule:87: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Basic Operations-OR-Symbols and Circuits&quot;&gt;Symbols and Circuits&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:87 --&gt;&lt;!-- ws:start:WikiTextTocRule:88: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Basic Operations-NOT&quot;&gt;NOT&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:88 --&gt;&lt;!-- ws:start:WikiTextTocRule:89: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Basic Operations-NOT-Truth Table&quot;&gt;Truth Table&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:89 --&gt;&lt;!-- ws:start:WikiTextTocRule:90: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Basic Operations-NOT-Symbols and Circuits&quot;&gt;Symbols and Circuits&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:90 --&gt;&lt;!-- ws:start:WikiTextTocRule:91: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Derived Operations&quot;&gt;Derived Operations&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:91 --&gt;&lt;!-- ws:start:WikiTextTocRule:92: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Derived Operations-NAND&quot;&gt;NAND&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:92 --&gt;&lt;!-- ws:start:WikiTextTocRule:93: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Derived Operations-NAND-Truth Table&quot;&gt;Truth Table&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:93 --&gt;&lt;!-- ws:start:WikiTextTocRule:94: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Derived Operations-NAND-Symbols and Circuits&quot;&gt;Symbols and Circuits&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:94 --&gt;&lt;!-- ws:start:WikiTextTocRule:95: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Derived Operations-NOR&quot;&gt;NOR&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:95 --&gt;&lt;!-- ws:start:WikiTextTocRule:96: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Derived Operations-NOR-Truth Table&quot;&gt;Truth Table&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:96 --&gt;&lt;!-- ws:start:WikiTextTocRule:97: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Derived Operations-NOR-Symbols and Circuits&quot;&gt;Symbols and Circuits&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:97 --&gt;&lt;!-- ws:start:WikiTextTocRule:98: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Derived Operations-XOR&quot;&gt;XOR&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:98 --&gt;&lt;!-- ws:start:WikiTextTocRule:99: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Derived Operations-XOR-Truth Table&quot;&gt;Truth Table&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:99 --&gt;&lt;!-- ws:start:WikiTextTocRule:100: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Derived Operations-XOR-Symbols and Circuits&quot;&gt;Symbols and Circuits&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:100 --&gt;&lt;!-- ws:start:WikiTextTocRule:101: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#DNF and CNF&quot;&gt;DNF and CNF&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:101 --&gt;&lt;!-- ws:start:WikiTextTocRule:102: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#ALU&quot;&gt;ALU&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:102 --&gt;&lt;!-- ws:start:WikiTextTocRule:103: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#ALU-Adder&quot;&gt;Adder&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:103 --&gt;&lt;!-- ws:start:WikiTextTocRule:104: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#ALU-Combinatorial Attacks&quot;&gt;Combinatorial Attacks&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:104 --&gt;&lt;!-- ws:start:WikiTextTocRule:105: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#ALU-Combinatorial Attacks-C Syntax&quot;&gt;C Syntax&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:105 --&gt;&lt;!-- ws:start:WikiTextTocRule:106: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#ALU-Combinatorial Attacks-Circuit&quot;&gt;Circuit&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:106 --&gt;&lt;!-- ws:start:WikiTextTocRule:107: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:107 --&gt;&lt;!-- ws:start:WikiTextTocRule:108: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:108 --&gt;&lt;!-- ws:start:WikiTextTocRule:109: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:109 --&gt;&lt;!-- ws:start:WikiTextTocRule:110: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:110 --&gt;&lt;!-- ws:start:WikiTextTocRule:111: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:111 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:17:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Implementation&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:17 --&gt;Implementation&lt;/h1&gt;
 In hardware, combinatorial logic can either realized with hardwired &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logic_gates&quot; rel=&quot;nofollow&quot;&gt;gates&lt;/a&gt; of certain &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logic_families&quot; rel=&quot;nofollow&quot;&gt;logic families&lt;/a&gt; or &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Programmable_logic_device&quot; rel=&quot;nofollow&quot;&gt;programmable logic devices&lt;/a&gt;. If the number of inputs is reasonable small, a once programmed &lt;a class=&quot;wiki_link&quot; href=&quot;/Memory#ROM&quot;&gt;ROM&lt;/a&gt; or &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Lookup_table#Hardware_LUTs&quot; rel=&quot;nofollow&quot;&gt;LUT&lt;/a&gt; can act as combinatorial logic. The inputs are the address, while one output is associated with a data-pin. In software this is like performing ALU-operations versus a memory lookup with pre-calculated outputs for all relevant inputs, related to the &lt;a class=&quot;wiki_link&quot; href=&quot;/Space-Time%20Tradeoff&quot;&gt;space-time tradeoff&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:19:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Basic Operations&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:19 --&gt;Basic Operations&lt;/h1&gt;
&lt;!-- ws:start:WikiTextAnchorRule:112:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@AND&amp;quot; title=&amp;quot;Anchor: AND&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;AND&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:112 --&gt; &lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:21:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Basic Operations-AND&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:21 --&gt;AND&lt;/h2&gt;
 An &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/AND_gate&quot; rel=&quot;nofollow&quot;&gt;AND gate&lt;/a&gt; implements a &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logical_conjunction&quot; rel=&quot;nofollow&quot;&gt;logical conjunction&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextMathRule:2:
[[math]]&amp;lt;br/&amp;gt;
 a\wedge b&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt; a\wedge b&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:2 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:23:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Basic Operations-AND-Truth Table&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:23 --&gt;Truth Table&lt;/h3&gt;
 

&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;- a -&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;- b -&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;a and b&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextHeadingRule:25:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Basic Operations-AND-Symbols and Circuits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:25 --&gt;Symbols and Circuits&lt;/h3&gt;
 

&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:556:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/AND_gate&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/120px-AND_ANSI_Labelled.svg.png/553814976/120px-AND_ANSI_Labelled.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/AND_gate&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/120px-AND_ANSI_Labelled.svg.png/553814976/120px-AND_ANSI_Labelled.svg.png&quot; alt=&quot;120px-AND_ANSI_Labelled.svg.png&quot; title=&quot;120px-AND_ANSI_Labelled.svg.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:556 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:558:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/Diode_logic&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/220px-Diode-AND2.png/553814974/220px-Diode-AND2.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Diode_logic&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/220px-Diode-AND2.png/553814974/220px-Diode-AND2.png&quot; alt=&quot;220px-Diode-AND2.png&quot; title=&quot;220px-Diode-AND2.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:558 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:560:&amp;lt;a href=&amp;quot;http://de.wikipedia.org/wiki/Und-Gatter&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/200px-Relay_and.svg.png/553814966/200px-Relay_and.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;http://de.wikipedia.org/wiki/Und-Gatter&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/200px-Relay_and.svg.png/553814966/200px-Relay_and.svg.png&quot; alt=&quot;200px-Relay_and.svg.png&quot; title=&quot;200px-Relay_and.svg.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:560 --&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextAnchorRule:113:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@OR&amp;quot; title=&amp;quot;Anchor: OR&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;OR&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:113 --&gt; &lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:27:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Basic Operations-OR&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:27 --&gt;OR&lt;/h2&gt;
 An &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/OR_gate&quot; rel=&quot;nofollow&quot;&gt;OR gate&lt;/a&gt; implements a &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logical_disjunction&quot; rel=&quot;nofollow&quot;&gt;logical disjunction&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextMathRule:3:
[[math]]&amp;lt;br/&amp;gt;
 a\vee b&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt; a\vee b&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:3 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:29:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc6&quot;&gt;&lt;a name=&quot;Basic Operations-OR-Truth Table&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:29 --&gt;Truth Table&lt;/h3&gt;
 

&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;- a -&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;- b -&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;a or b&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextHeadingRule:31:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc7&quot;&gt;&lt;a name=&quot;Basic Operations-OR-Symbols and Circuits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:31 --&gt;Symbols and Circuits&lt;/h3&gt;
 

&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:562:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/OR_gate&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/120px-OR_ANSI_Labelled.svg.png/553814962/120px-OR_ANSI_Labelled.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/OR_gate&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/120px-OR_ANSI_Labelled.svg.png/553814962/120px-OR_ANSI_Labelled.svg.png&quot; alt=&quot;120px-OR_ANSI_Labelled.svg.png&quot; title=&quot;120px-OR_ANSI_Labelled.svg.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:562 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:564:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/Diode_logic&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/220px-Diode-OR2.png/553814960/220px-Diode-OR2.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Diode_logic&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/220px-Diode-OR2.png/553814960/220px-Diode-OR2.png&quot; alt=&quot;220px-Diode-OR2.png&quot; title=&quot;220px-Diode-OR2.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:564 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:566:&amp;lt;a href=&amp;quot;http://de.wikipedia.org/wiki/Oder-Gatter&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/200px-Relay_or.svg.png/553814954/200px-Relay_or.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;http://de.wikipedia.org/wiki/Oder-Gatter&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/200px-Relay_or.svg.png/553814954/200px-Relay_or.svg.png&quot; alt=&quot;200px-Relay_or.svg.png&quot; title=&quot;200px-Relay_or.svg.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:566 --&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextAnchorRule:114:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@NOT&amp;quot; title=&amp;quot;Anchor: NOT&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;NOT&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:114 --&gt; &lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:33:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc8&quot;&gt;&lt;a name=&quot;Basic Operations-NOT&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:33 --&gt;NOT&lt;/h2&gt;
 A &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/NOT_gate&quot; rel=&quot;nofollow&quot;&gt;NOT gate&lt;/a&gt; or &lt;strong&gt;Inverter&lt;/strong&gt; implements a &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logical_negation&quot; rel=&quot;nofollow&quot;&gt;logical negation&lt;/a&gt;. &lt;br /&gt;
&lt;!-- ws:start:WikiTextMathRule:4:
[[math]]&amp;lt;br/&amp;gt;
 \neg a&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt; \neg a&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:4 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:35:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc9&quot;&gt;&lt;a name=&quot;Basic Operations-NOT-Truth Table&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:35 --&gt;Truth Table&lt;/h3&gt;
 

&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;- a -&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;not a&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextHeadingRule:37:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc10&quot;&gt;&lt;a name=&quot;Basic Operations-NOT-Symbols and Circuits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:37 --&gt;Symbols and Circuits&lt;/h3&gt;
 

&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:568:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/NOT_gate&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/128px-Not-gate-en.svg.png/553814944/128px-Not-gate-en.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/NOT_gate&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/128px-Not-gate-en.svg.png/553814944/128px-Not-gate-en.svg.png&quot; alt=&quot;128px-Not-gate-en.svg.png&quot; title=&quot;128px-Not-gate-en.svg.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:568 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:570:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/NOT_gate&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/70px-NMOS_NOT.png/553814936/70px-NMOS_NOT.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/NOT_gate&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/70px-NMOS_NOT.png/553814936/70px-NMOS_NOT.png&quot; alt=&quot;70px-NMOS_NOT.png&quot; title=&quot;70px-NMOS_NOT.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:570 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:572:&amp;lt;a href=&amp;quot;http://de.wikipedia.org/wiki/Nicht-Gatter&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/Relay_not.svg.png/553814930/Relay_not.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;http://de.wikipedia.org/wiki/Nicht-Gatter&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/Relay_not.svg.png/553814930/Relay_not.svg.png&quot; alt=&quot;Relay_not.svg.png&quot; title=&quot;Relay_not.svg.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:572 --&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:39:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc11&quot;&gt;&lt;a name=&quot;Derived Operations&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:39 --&gt;Derived Operations&lt;/h1&gt;
 Concrete electronic gates often combine AND and OR with trailing NOT for so called &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/NAND_gate&quot; rel=&quot;nofollow&quot;&gt;NAND&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/NOR_gate&quot; rel=&quot;nofollow&quot;&gt;NOR gates&lt;/a&gt;. As application of &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#DeMorganslaws&quot;&gt;De Morgan&#039;s laws&lt;/a&gt; a NAND can also be interpreted as OR of inverted inputs, and NOR as AND of inverted inputs.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:115:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@NAND&amp;quot; title=&amp;quot;Anchor: NAND&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;NAND&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:115 --&gt; &lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:41:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc12&quot;&gt;&lt;a name=&quot;Derived Operations-NAND&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:41 --&gt;NAND&lt;/h2&gt;
 A &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/NAND_gate&quot; rel=&quot;nofollow&quot;&gt;NAND gate&lt;/a&gt; is the inversion of AND, NOT AND.&lt;br /&gt;
&lt;!-- ws:start:WikiTextMathRule:5:
[[math]]&amp;lt;br/&amp;gt;
 \neg (a\wedge b)&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt; \neg (a\wedge b)&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:5 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:43:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc13&quot;&gt;&lt;a name=&quot;Derived Operations-NAND-Truth Table&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:43 --&gt;Truth Table&lt;/h3&gt;
 

&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;- a -&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;- b -&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;not(a and b)&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextHeadingRule:45:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc14&quot;&gt;&lt;a name=&quot;Derived Operations-NAND-Symbols and Circuits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:45 --&gt;Symbols and Circuits&lt;/h3&gt;
 

&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:574:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/NAND_gate&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/120px-NAND_ANSI_Labelled.svg.png/553814928/120px-NAND_ANSI_Labelled.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/NAND_gate&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/120px-NAND_ANSI_Labelled.svg.png/553814928/120px-NAND_ANSI_Labelled.svg.png&quot; alt=&quot;120px-NAND_ANSI_Labelled.svg.png&quot; title=&quot;120px-NAND_ANSI_Labelled.svg.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:574 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:576:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/NAND_gate&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/200px-TTL_npn_nand.svg.png/553814924/200px-TTL_npn_nand.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/NAND_gate&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/200px-TTL_npn_nand.svg.png/553814924/200px-TTL_npn_nand.svg.png&quot; alt=&quot;200px-TTL_npn_nand.svg.png&quot; title=&quot;200px-TTL_npn_nand.svg.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:576 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:578:&amp;lt;a href=&amp;quot;http://de.wikipedia.org/wiki/NAND-Gatter&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/200px-Relay_nand.svg.png/553814914/200px-Relay_nand.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;http://de.wikipedia.org/wiki/NAND-Gatter&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/200px-Relay_nand.svg.png/553814914/200px-Relay_nand.svg.png&quot; alt=&quot;200px-Relay_nand.svg.png&quot; title=&quot;200px-Relay_nand.svg.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:578 --&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextAnchorRule:116:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@NOR&amp;quot; title=&amp;quot;Anchor: NOR&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;NOR&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:116 --&gt; &lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:47:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc15&quot;&gt;&lt;a name=&quot;Derived Operations-NOR&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:47 --&gt;NOR&lt;/h2&gt;
 A &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/NOR_gate&quot; rel=&quot;nofollow&quot;&gt;NOR gate&lt;/a&gt; is the inversion of OR, NOT OR.&lt;br /&gt;
&lt;!-- ws:start:WikiTextMathRule:6:
[[math]]&amp;lt;br/&amp;gt;
 \neg (a\vee b)&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt; \neg (a\vee b)&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:6 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:49:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc16&quot;&gt;&lt;a name=&quot;Derived Operations-NOR-Truth Table&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:49 --&gt;Truth Table&lt;/h3&gt;
 

&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;- a -&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;- b -&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;not(a or b)&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextHeadingRule:51:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc17&quot;&gt;&lt;a name=&quot;Derived Operations-NOR-Symbols and Circuits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:51 --&gt;Symbols and Circuits&lt;/h3&gt;
 

&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:580:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/NOR_gate&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/120px-NOR_ANSI_Labelled.svg.png/553814908/120px-NOR_ANSI_Labelled.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/NOR_gate&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/120px-NOR_ANSI_Labelled.svg.png/553814908/120px-NOR_ANSI_Labelled.svg.png&quot; alt=&quot;120px-NOR_ANSI_Labelled.svg.png&quot; title=&quot;120px-NOR_ANSI_Labelled.svg.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:580 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:582:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/NOR_gate&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/NMOS_NOR.png/553814898/NMOS_NOR.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/NOR_gate&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/NMOS_NOR.png/553814898/NMOS_NOR.png&quot; alt=&quot;NMOS_NOR.png&quot; title=&quot;NMOS_NOR.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:582 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:584:&amp;lt;a href=&amp;quot;http://de.wikipedia.org/wiki/NOR-Gatter&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/200px-Relay_nor.svg.png/553814892/200px-Relay_nor.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;http://de.wikipedia.org/wiki/NOR-Gatter&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/200px-Relay_nor.svg.png/553814892/200px-Relay_nor.svg.png&quot; alt=&quot;200px-Relay_nor.svg.png&quot; title=&quot;200px-Relay_nor.svg.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:584 --&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextAnchorRule:117:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@XOR&amp;quot; title=&amp;quot;Anchor: XOR&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;XOR&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:117 --&gt; &lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:53:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc18&quot;&gt;&lt;a name=&quot;Derived Operations-XOR&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:53 --&gt;XOR&lt;/h2&gt;
 A &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/XOR_gate&quot; rel=&quot;nofollow&quot;&gt;XOR gate&lt;/a&gt; implements a &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Exclusive_disjunction&quot; rel=&quot;nofollow&quot;&gt;exclusive disjunction&lt;/a&gt;, which might be derived from AND/OR/NOT, for instance from four NAND gates.&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:55:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc19&quot;&gt;&lt;a name=&quot;Derived Operations-XOR-Truth Table&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:55 --&gt;Truth Table&lt;/h3&gt;
 

&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;- a -&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;- b -&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;a xor b&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextHeadingRule:57:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc20&quot;&gt;&lt;a name=&quot;Derived Operations-XOR-Symbols and Circuits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:57 --&gt;Symbols and Circuits&lt;/h3&gt;
 

&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:586:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/XOR_gate&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/128px-XOR_ANSI.svg.png/553814886/128px-XOR_ANSI.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/XOR_gate&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/128px-XOR_ANSI.svg.png/553814886/128px-XOR_ANSI.svg.png&quot; alt=&quot;128px-XOR_ANSI.svg.png&quot; title=&quot;128px-XOR_ANSI.svg.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:586 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:588:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/XOR_gate&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/300px-XOR_from_NAND.svg.png/553814882/300px-XOR_from_NAND.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/XOR_gate&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/300px-XOR_from_NAND.svg.png/553814882/300px-XOR_from_NAND.svg.png&quot; alt=&quot;300px-XOR_from_NAND.svg.png&quot; title=&quot;300px-XOR_from_NAND.svg.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:588 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:590:&amp;lt;a href=&amp;quot;http://de.wikipedia.org/wiki/XOR-Gatter&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/200px-Relay_xor.svg.png/553814874/200px-Relay_xor.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;http://de.wikipedia.org/wiki/XOR-Gatter&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/200px-Relay_xor.svg.png/553814874/200px-Relay_xor.svg.png&quot; alt=&quot;200px-Relay_xor.svg.png&quot; title=&quot;200px-Relay_xor.svg.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:590 --&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:59:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc21&quot;&gt;&lt;a name=&quot;DNF and CNF&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:59 --&gt;DNF and CNF&lt;/h1&gt;
 Combinational logic can visualized by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Truth_table&quot; rel=&quot;nofollow&quot;&gt;truth tables&lt;/a&gt; and the construction is generally done using &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Disjunctive_normal_form&quot; rel=&quot;nofollow&quot;&gt;disjunctive&lt;/a&gt; (sum of products) or &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Conjunctive_normal_form&quot; rel=&quot;nofollow&quot;&gt;conjunctive normal form&lt;/a&gt; (products of sums), and using &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Boolean_algebra_%28logic%29&quot; rel=&quot;nofollow&quot;&gt;boolean algebra&lt;/a&gt; or &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Karnaugh_map&quot; rel=&quot;nofollow&quot;&gt;Karnaugh maps&lt;/a&gt; to simplify the expression.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:118:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@ALU&amp;quot; title=&amp;quot;Anchor: ALU&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;ALU&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:118 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:61:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc22&quot;&gt;&lt;a name=&quot;ALU&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:61 --&gt;ALU&lt;/h1&gt;
 Combinatorial logic is a huge part of the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Arithmetic_logic_unit&quot; rel=&quot;nofollow&quot;&gt;arithmetic logic unit&lt;/a&gt; (ALU) of &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Central_processing_unit&quot; rel=&quot;nofollow&quot;&gt;processors&lt;/a&gt;, which provides accordant boolean logical instructions working on all &lt;a class=&quot;wiki_link&quot; href=&quot;/Bit&quot;&gt;bits&lt;/a&gt; of a register in parallel as mentioned in &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations&quot;&gt;General Setwise Operations&lt;/a&gt; of &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Bitboards&lt;/a&gt;. Therefor each Combinatorial Logic can of course emulated in &lt;a class=&quot;wiki_link&quot; href=&quot;/Software&quot;&gt;software&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:119:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Adder&amp;quot; title=&amp;quot;Anchor: Adder&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Adder&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:119 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:63:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc23&quot;&gt;&lt;a name=&quot;ALU-Adder&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:63 --&gt;Adder&lt;/h2&gt;
A &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Adder_%28electronics%29#Half_adder&quot; rel=&quot;nofollow&quot;&gt;half adder&lt;/a&gt; performs an addition on two one-bit binary numbers. Output of an AND gate is the carry, while a XOR gate leaves the one-bit sum. A &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Adder_%28electronics%29#Full_adder&quot; rel=&quot;nofollow&quot;&gt;full adder&lt;/a&gt; with tad more gates adds three one-bit binary numbers, the third usually to feed in the carry from the previous digit, usually in &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Carry_lookahead_adder&quot; rel=&quot;nofollow&quot;&gt;carry look ahead&lt;/a&gt; architectures, such as &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Kogge-Stone_adder&quot; rel=&quot;nofollow&quot;&gt;Kogge-Stone adder&lt;/a&gt;, also mentioned as &lt;a class=&quot;wiki_link&quot; href=&quot;/Parallel%20Prefix%20Algorithms#KoggeStoneAdder&quot;&gt;parallel prefix algorithm&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:592:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/Half_adder#Full_adder&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/Full-adder_logic_diagram.svg.png/553814870/Full-adder_logic_diagram.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Half_adder#Full_adder&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/Full-adder_logic_diagram.svg.png/553814870/Full-adder_logic_diagram.svg.png&quot; alt=&quot;Full-adder_logic_diagram.svg.png&quot; title=&quot;Full-adder_logic_diagram.svg.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:592 --&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Half_adder#Full_adder&quot; rel=&quot;nofollow&quot;&gt;Full Adder&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:594:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/Adder_%28electronics%29#Carry_look-ahead_adders&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/500px-4-bit_carry_lookahead_adder.svg.png/553814866/500px-4-bit_carry_lookahead_adder.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Adder_%28electronics%29#Carry_look-ahead_adders&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/500px-4-bit_carry_lookahead_adder.svg.png/553814866/500px-4-bit_carry_lookahead_adder.svg.png&quot; alt=&quot;500px-4-bit_carry_lookahead_adder.svg.png&quot; title=&quot;500px-4-bit_carry_lookahead_adder.svg.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:594 --&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Adder_%28electronics%29#Carry_look-ahead_adders&quot; rel=&quot;nofollow&quot;&gt;4-bit adder&lt;/a&gt; with &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Carry_lookahead_adder&quot; rel=&quot;nofollow&quot;&gt;Carry Look Ahead&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:120:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@CombinatorialAttackandDefendMap&amp;quot; title=&amp;quot;Anchor: CombinatorialAttackandDefendMap&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;CombinatorialAttackandDefendMap&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:120 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:65:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc24&quot;&gt;&lt;a name=&quot;ALU-Combinatorial Attacks&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:65 --&gt;Combinatorial Attacks&lt;/h2&gt;
 Assuming there are 13 times 64 digital inputs from a hardware wired &lt;a class=&quot;wiki_link&quot; href=&quot;/Chessboard&quot;&gt;chessboard&lt;/a&gt;. The 13 inputs per &lt;a class=&quot;wiki_link&quot; href=&quot;/Squares&quot;&gt;square&lt;/a&gt; has one exclusive &amp;quot;one&amp;quot; signal for either one of the twelve &lt;a class=&quot;wiki_link&quot; href=&quot;/Pieces&quot;&gt;pieces&lt;/a&gt; or an empty signal. For each square a number of attacks/defend outputs may be defined to implement a huge Combinatorial Logic as a &amp;quot;zero cycle&amp;quot; &lt;a class=&quot;wiki_link&quot; href=&quot;/Attack%20and%20Defend%20Maps&quot;&gt;attack table&lt;/a&gt;, i. e. output &lt;em&gt;a8 is attacked from south by white rook&lt;/em&gt; as DNF (sum of products).&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:67:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc25&quot;&gt;&lt;a name=&quot;ALU-Combinatorial Attacks-C Syntax&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:67 --&gt;C Syntax&lt;/h3&gt;
With &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;-like operators, that is &#039;&amp;amp;&#039; for AND and &#039;|&#039; for OR, the DNF would look like this:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;southAttackByWhiteRook(a8) ::=&amp;lt;br/&amp;gt;    wrook(a7)&amp;lt;br/&amp;gt;| ( empty(a7) &amp;amp;amp; wrook(a6) )&amp;lt;br/&amp;gt;| ( empty(a7) &amp;amp;amp; empty(a6) &amp;amp;amp; wrook(a5) )&amp;lt;br/&amp;gt;| ( empty(a7) &amp;amp;amp; empty(a6) &amp;amp;amp; empty(a5) &amp;amp;amp; wrook(a4) )&amp;lt;br/&amp;gt;| ( empty(a7) &amp;amp;amp; empty(a6) &amp;amp;amp; empty(a5) &amp;amp;amp; empty(a4) &amp;amp;amp; wrook(a3) )&amp;lt;br/&amp;gt;| ( empty(a7) &amp;amp;amp; empty(a6) &amp;amp;amp; empty(a5) &amp;amp;amp; empty(a4) &amp;amp;amp; empty(a3) &amp;amp;amp; wrook(a2) )&amp;lt;br/&amp;gt;| ( empty(a7) &amp;amp;amp; empty(a6) &amp;amp;amp; empty(a5) &amp;amp;amp; empty(a4) &amp;amp;amp; empty(a3) &amp;amp;amp; empty(a2) &amp;amp;amp; wrook(a1) )&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;southAttackByWhiteRook(a8) ::=
    wrook(a7)
| ( empty(a7) &amp;amp; wrook(a6) )
| ( empty(a7) &amp;amp; empty(a6) &amp;amp; wrook(a5) )
| ( empty(a7) &amp;amp; empty(a6) &amp;amp; empty(a5) &amp;amp; wrook(a4) )
| ( empty(a7) &amp;amp; empty(a6) &amp;amp; empty(a5) &amp;amp; empty(a4) &amp;amp; wrook(a3) )
| ( empty(a7) &amp;amp; empty(a6) &amp;amp; empty(a5) &amp;amp; empty(a4) &amp;amp; empty(a3) &amp;amp; wrook(a2) )
| ( empty(a7) &amp;amp; empty(a6) &amp;amp; empty(a5) &amp;amp; empty(a4) &amp;amp; empty(a3) &amp;amp; empty(a2) &amp;amp; wrook(a1) )&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:69:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc26&quot;&gt;&lt;a name=&quot;ALU-Combinatorial Attacks-Circuit&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:69 --&gt;Circuit&lt;/h3&gt;
The same sample as circuit f. i. in &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Diode_logic&quot; rel=&quot;nofollow&quot;&gt;Diode logic&lt;/a&gt; with 34 &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Diode&quot; rel=&quot;nofollow&quot;&gt;diodes&lt;/a&gt; and 7 &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Resistor&quot; rel=&quot;nofollow&quot;&gt;resistors&lt;/a&gt;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt; Board bus&amp;lt;br/&amp;gt; empty                    white rook                    &amp;lt;br/&amp;gt; a1 a2 a3 a4 a5 a6 a7 a8  a1 a2 a3 a4 a5 a6 a7 a8      ANDs (MIN)         OR (MAX)&amp;lt;br/&amp;gt; |  |  |  |  |  |  |  |   |  |  |  |  |  |  |  |           &amp;lt;br/&amp;gt;    |  |  |  |  |  |      |  |  |  |  |  |  |               &amp;lt;br/&amp;gt;    o&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o&amp;amp;#45;&amp;amp;#45;-| R1 |&amp;amp;#45;&amp;amp;#45;-o +Vcc&amp;lt;br/&amp;gt;       o&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;lt;br/&amp;gt;       |  o&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|  D1-D7&amp;lt;br/&amp;gt;       |  |  o&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;lt;br/&amp;gt;       |  |  |  o&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;lt;br/&amp;gt;       |  |  |  |  o&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;lt;br/&amp;gt;       |  |  |  |  |      o&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;gt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o  D28&amp;lt;br/&amp;gt;       |  |  |  |  |         |  |  |  |  |  |                                      |&amp;lt;br/&amp;gt;       o&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o&amp;amp;#45;&amp;amp;#45;-| R2 |&amp;amp;#45;&amp;amp;#45;-o +Vcc |&amp;lt;br/&amp;gt;          o&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|                   |&amp;lt;br/&amp;gt;          |  o&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|  D8-D13           |&amp;lt;br/&amp;gt;          |  |  o&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|                   |&amp;lt;br/&amp;gt;          |  |  |  o&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|                   |&amp;lt;br/&amp;gt;          |  |  |  |         o&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;gt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o  D29&amp;lt;br/&amp;gt;          |  |  |  |            |  |  |  |  |                                      |&amp;lt;br/&amp;gt;          o&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o&amp;amp;#45;&amp;amp;#45;-| R3 |&amp;amp;#45;&amp;amp;#45;-o +Vcc |&amp;lt;br/&amp;gt;             o&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|                   |&amp;lt;br/&amp;gt;             |  o&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|  D14-18           |&amp;lt;br/&amp;gt;             |  |  o&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|                   |&amp;lt;br/&amp;gt;             |  |  |            o&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;gt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o  D30&amp;lt;br/&amp;gt;             |  |  |               |  |  |  |                                      |&amp;lt;br/&amp;gt;             o&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o&amp;amp;#45;&amp;amp;#45;-| R4 |&amp;amp;#45;&amp;amp;#45;-o +Vcc |&amp;lt;br/&amp;gt;                o&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|  D19-D22          |&amp;lt;br/&amp;gt;                |  o&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|                   |&amp;lt;br/&amp;gt;                |  |               o&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;gt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o  D31&amp;lt;br/&amp;gt;                |  |                  |  |  |                                      |&amp;lt;br/&amp;gt;                o&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o&amp;amp;#45;&amp;amp;#45;-| R5 |&amp;amp;#45;&amp;amp;#45;-o +Vcc |&amp;lt;br/&amp;gt;                   o&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|  D23-D25          |&amp;lt;br/&amp;gt;                   |                  o&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;gt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o  D32&amp;lt;br/&amp;gt;                   |                     |  |                                      |&amp;lt;br/&amp;gt;                   o&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o&amp;amp;#45;&amp;amp;#45;-| R6 |&amp;amp;#45;&amp;amp;#45;-o +Vcc |&amp;lt;br/&amp;gt;                                         |  |                  |  D26-D27          |&amp;lt;br/&amp;gt;                                         o&amp;amp;#45;-|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;lt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;gt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o  D33&amp;lt;br/&amp;gt;                                            |                                      |  D34&amp;lt;br/&amp;gt;                                            o&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|&amp;amp;gt;|&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o&amp;amp;#45;-&amp;amp;gt;&amp;amp;#45;-o a8 attacked  &amp;lt;br/&amp;gt;                                                                                   |       by white rook&amp;lt;br/&amp;gt;                                                                                   _       from south&amp;lt;br/&amp;gt;                                                                                  | |  R7&amp;lt;br/&amp;gt;                                                                                  |_|&amp;lt;br/&amp;gt;                                                                                   |&amp;lt;br/&amp;gt;                                                                                 &amp;amp;#45;-o&amp;amp;#45;-&amp;lt;br/&amp;gt;                                                                                  &amp;amp;#45;&amp;amp;#45;-   gnd&amp;lt;br/&amp;gt;                                                                                   -&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt; Board bus
 empty                    white rook                    
 a1 a2 a3 a4 a5 a6 a7 a8  a1 a2 a3 a4 a5 a6 a7 a8      ANDs (MIN)         OR (MAX)
 |  |  |  |  |  |  |  |   |  |  |  |  |  |  |  |           
    |  |  |  |  |  |      |  |  |  |  |  |  |               
    o--|--|--|--|--|------|--|--|--|--|--|--|----------|&amp;lt;|-----o---| R1 |---o +Vcc
       o--|--|--|--|------|--|--|--|--|--|--|----------|&amp;lt;|-----|
       |  o--|--|--|------|--|--|--|--|--|--|----------|&amp;lt;|-----|  D1-D7
       |  |  o--|--|------|--|--|--|--|--|--|----------|&amp;lt;|-----|
       |  |  |  o--|------|--|--|--|--|--|--|----------|&amp;lt;|-----|
       |  |  |  |  o------|--|--|--|--|--|--|----------|&amp;lt;|-----|
       |  |  |  |  |      o--|--|--|--|--|--|----------|&amp;lt;|-----o----------|&amp;gt;|------o  D28
       |  |  |  |  |         |  |  |  |  |  |                                      |
       o--|--|--|--|---------|--|--|--|--|--|----------|&amp;lt;|-----o---| R2 |---o +Vcc |
          o--|--|--|---------|--|--|--|--|--|----------|&amp;lt;|-----|                   |
          |  o--|--|---------|--|--|--|--|--|----------|&amp;lt;|-----|  D8-D13           |
          |  |  o--|---------|--|--|--|--|--|----------|&amp;lt;|-----|                   |
          |  |  |  o---------|--|--|--|--|--|----------|&amp;lt;|-----|                   |
          |  |  |  |         o--|--|--|--|--|----------|&amp;lt;|-----o----------|&amp;gt;|------o  D29
          |  |  |  |            |  |  |  |  |                                      |
          o--|--|--|------------|--|--|--|--|----------|&amp;lt;|-----o---| R3 |---o +Vcc |
             o--|--|------------|--|--|--|--|----------|&amp;lt;|-----|                   |
             |  o--|------------|--|--|--|--|----------|&amp;lt;|-----|  D14-18           |
             |  |  o------------|--|--|--|--|----------|&amp;lt;|-----|                   |
             |  |  |            o--|--|--|--|----------|&amp;lt;|-----o----------|&amp;gt;|------o  D30
             |  |  |               |  |  |  |                                      |
             o--|--|---------------|--|--|--|----------|&amp;lt;|-----o---| R4 |---o +Vcc |
                o--|---------------|--|--|--|----------|&amp;lt;|-----|  D19-D22          |
                |  o---------------|--|--|--|----------|&amp;lt;|-----|                   |
                |  |               o--|--|--|----------|&amp;lt;|-----o----------|&amp;gt;|------o  D31
                |  |                  |  |  |                                      |
                o--|------------------|--|--|----------|&amp;lt;|-----o---| R5 |---o +Vcc |
                   o------------------|--|--|----------|&amp;lt;|-----|  D23-D25          |
                   |                  o--|--|----------|&amp;lt;|-----o----------|&amp;gt;|------o  D32
                   |                     |  |                                      |
                   o---------------------|--|----------|&amp;lt;|-----o---| R6 |---o +Vcc |
                                         |  |                  |  D26-D27          |
                                         o--|----------|&amp;lt;|-----o----------|&amp;gt;|------o  D33
                                            |                                      |  D34
                                            o------------------o----------|&amp;gt;|------o--&amp;gt;--o a8 attacked  
                                                                                   |       by white rook
                                                                                   _       from south
                                                                                  | |  R7
                                                                                  |_|
                                                                                   |
                                                                                 --o--
                                                                                  ---   gnd
                                                                                   -&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:71:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc27&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:71 --&gt;See also&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Belle#Hardware&quot;&gt;Belle | Hardware Move Generation&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/CHEOPS&quot;&gt;CHEOPS&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations&quot;&gt;General Setwise Operations&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Sequential%20Logic&quot;&gt;Sequential Logic&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:73:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc28&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:73 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Combinational_logic&quot; rel=&quot;nofollow&quot;&gt;Combinational logic from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.ee.surrey.ac.uk/Projects/Labview/combindex.html&quot; rel=&quot;nofollow&quot;&gt;Combinational Logic &amp;amp; Systems Tutorial Guide&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Proposition_(disambiguation)&quot; rel=&quot;nofollow&quot;&gt;Proposition (disambiguation) from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Propositional_calculus&quot; rel=&quot;nofollow&quot;&gt;Propositional calculus from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logic_gates&quot; rel=&quot;nofollow&quot;&gt;Logic gate from Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/AND_gate&quot; rel=&quot;nofollow&quot;&gt;AND gate&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/OR_gate&quot; rel=&quot;nofollow&quot;&gt;OR Gate&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/NOT_gate&quot; rel=&quot;nofollow&quot;&gt;NOT Gate&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/NAND_gate&quot; rel=&quot;nofollow&quot;&gt;NAND gate&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/NOR_gate&quot; rel=&quot;nofollow&quot;&gt;NOR gate&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/XOR_gate&quot; rel=&quot;nofollow&quot;&gt;XOR gate&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/XNOR_gate&quot; rel=&quot;nofollow&quot;&gt;XNOR gate&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Fredkin_gate&quot; rel=&quot;nofollow&quot;&gt;Fredkin gate&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Toffoli_Gate&quot; rel=&quot;nofollow&quot;&gt;Toffoli gate&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:14:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Edward%20Fredkin&amp;quot;&amp;gt;Edward Fredkin&amp;lt;/a&amp;gt; and &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Tommaso_Toffoli&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Tommaso Toffoli&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;1982&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;Conservative logic&amp;lt;/em&amp;gt;. International Journal of Theoretical Physics, 21 :219–253, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://web.archive.org/web/20061017232512/http://www.digitalphilosophy.org/download_documents/ConservativeLogic.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;pdf&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:14 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logic_families&quot; rel=&quot;nofollow&quot;&gt;Logic family from Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Relay&quot; rel=&quot;nofollow&quot;&gt;Relay&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Diode_logic&quot; rel=&quot;nofollow&quot;&gt;Diode logic&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Resistor%E2%80%93transistor_logic&quot; rel=&quot;nofollow&quot;&gt;Resistor–transistor logic&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Diode%E2%80%93transistor_logic&quot; rel=&quot;nofollow&quot;&gt;Diode–transistor logic&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Transistor%E2%80%93transistor_logic&quot; rel=&quot;nofollow&quot;&gt;Transistor–transistor logic&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Emitter-coupled_logic&quot; rel=&quot;nofollow&quot;&gt;Emitter-coupled logic&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/CMOS&quot; rel=&quot;nofollow&quot;&gt;Complementary metal–oxide–semiconductor&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Integrated_injection_logic&quot; rel=&quot;nofollow&quot;&gt;Integrated injection logic&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Address_decoder&quot; rel=&quot;nofollow&quot;&gt;Address decoder from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Lookup_table&quot; rel=&quot;nofollow&quot;&gt;Lookup table from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Curved_Air&quot; rel=&quot;nofollow&quot;&gt;Curved Air&lt;/a&gt; - &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Air_Conditioning_(album)&quot; rel=&quot;nofollow&quot;&gt;Propositions&lt;/a&gt; (1971),  &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/YouTube&quot; rel=&quot;nofollow&quot;&gt;YouTube&lt;/a&gt; Video&lt;br /&gt;
&lt;!-- ws:start:WikiTextMediaRule:15:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/youtube/wIRxe_gcwVc?h=315&amp;amp;w=560&amp;quot; class=&amp;quot;WikiMedia WikiMediaYoutube&amp;quot; id=&amp;quot;wikitext@@media@@type=&amp;amp;quot;youtube&amp;amp;quot; key=&amp;amp;quot;wIRxe_gcwVc&amp;amp;quot;&amp;quot; title=&amp;quot;YouTube Video&amp;quot;height=&amp;quot;315&amp;quot; width=&amp;quot;560&amp;quot;/&amp;gt; --&gt;&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/wIRxe_gcwVc&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;!-- ws:end:WikiTextMediaRule:15 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:75:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc29&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:75 --&gt;References&lt;/h1&gt;
&lt;!-- ws:start:WikiTextReferencesRule:871:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Edward%20Fredkin&quot;&gt;Edward Fredkin&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Tommaso_Toffoli&quot; rel=&quot;nofollow&quot;&gt;Tommaso Toffoli&lt;/a&gt; (&lt;strong&gt;1982&lt;/strong&gt;). &lt;em&gt;Conservative logic&lt;/em&gt;. International Journal of Theoretical Physics, 21 :219–253, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://web.archive.org/web/20061017232512/http://www.digitalphilosophy.org/download_documents/ConservativeLogic.pdf&quot; rel=&quot;nofollow&quot;&gt;pdf&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:871 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:77:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc30&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:77 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:02:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Combinatorial Logic&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;80&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Combinatorial Logic&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;80&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Combinatorial_Logic includeBody-Combinatorial%20Logic includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/6502&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;6502&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/68020&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;68020&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX-512&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX-512&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Belle&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Belle&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 18, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Berkeley+Chess+Microprocessor&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Berkeley Chess Microprocessor&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 22, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Brutus&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Brutus&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 24, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/CHEOPS&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;CHEOPS&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 18, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/ChipTest&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;ChipTest&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 19, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Combinatorial+Logic&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Combinatorial Logic&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 6, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Cray-1&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Cray-1&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Data&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Data&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 26, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/DEC+Alpha&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;DEC Alpha&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 15, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Deep+Thought&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Deep Thought&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Electro-Mechanical&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Electro-Mechanical&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 2, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Fairchild+F8&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Fairchild F8&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 31, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/FPGA&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;FPGA&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 9, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hardware&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hardware&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 20, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/HP+2100&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;HP 2100&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 3, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/i860&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;i860&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 21, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Itanium&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Itanium&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kogge-Stone+Algorithm&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kogge-Stone Algorithm&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 17, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/M-2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;M-2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 10, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/M-20&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;M-20&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 9, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Memory&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Memory&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/nCUBE&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;nCUBE&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 5, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Neural+Networks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Neural Networks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 12, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Nova&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Nova&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 20, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Novag+Micro+Chess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Novag Micro Chess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 16, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Parallel+Prefix+Algorithms&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Parallel Prefix Algorithms&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 22, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/PowerPC&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;PowerPC&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 6, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sequential+Logic&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sequential Logic&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Tempo+%28engine%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Tempo (engine)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/TR-4&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;TR-4&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 27, 2014&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:02 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Hardware&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Congruent Modulo Bitboards</title>
      <link>https://chessprogramming.wikispaces.com/Congruent+Modulo+Bitboards</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Congruent+Modulo+Bitboards</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Congruent+Modulo+Bitboards</comments>
      <pubDate>Wed, 26 Jun 2013 18:26:44 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:63:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:63 --&gt;&lt;!-- ws:start:WikiTextTocRule:64: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Modulo vs. Multiplication&quot;&gt;Modulo vs. Multiplication&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:64 --&gt;&lt;!-- ws:start:WikiTextTocRule:65: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Modulo vs. Multiplication-Modulo&quot;&gt;Modulo&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:65 --&gt;&lt;!-- ws:start:WikiTextTocRule:66: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Modulo vs. Multiplication-Modulo-Congruence relation&quot;&gt;Congruence relation&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:66 --&gt;&lt;!-- ws:start:WikiTextTocRule:67: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Modulo vs. Multiplication-Modulo-Casting out 255&quot;&gt;Casting out 255&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:67 --&gt;&lt;!-- ws:start:WikiTextTocRule:68: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Modulo vs. Multiplication-Modulo-Reciprocal Multiplication&quot;&gt;Reciprocal Multiplication&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:68 --&gt;&lt;!-- ws:start:WikiTextTocRule:69: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Modulo vs. Multiplication-Multiplication&quot;&gt;Multiplication&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:69 --&gt;&lt;!-- ws:start:WikiTextTocRule:70: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Fenner&#039;s and Levene&#039;s conclusion&quot;&gt;Fenner&#039;s and Levene&#039;s conclusion&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:70 --&gt;&lt;!-- ws:start:WikiTextTocRule:71: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Publications&quot;&gt;Publications&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:71 --&gt;&lt;!-- ws:start:WikiTextTocRule:72: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Forum Posts&quot;&gt;Forum Posts&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:72 --&gt;&lt;!-- ws:start:WikiTextTocRule:73: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:73 --&gt;&lt;!-- ws:start:WikiTextTocRule:74: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:74 --&gt;&lt;!-- ws:start:WikiTextTocRule:75: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:75 --&gt;&lt;!-- ws:start:WikiTextTocRule:76: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:76 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Board%20Representation&quot;&gt;Board Representation&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Bitboards&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Sliding Piece Attacks&lt;/a&gt; * Congruent Modulo Bitboards&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Congruent Modulo Bitboards&lt;/strong&gt; was introduced by &lt;a class=&quot;wiki_link&quot; href=&quot;/Trevor%20Fenner&quot;&gt;Trevor Fenner&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Mark%20Levene&quot;&gt;Mark Levene&lt;/a&gt; in the &lt;a class=&quot;wiki_link&quot; href=&quot;/ICGA%20Journal#31_1&quot;&gt;ICGA Journal, Vol. 31, No. 1&lt;/a&gt; in 2008 &lt;!-- ws:start:WikiTextRefRule:18:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Trevor%20Fenner&amp;quot;&amp;gt;Trevor Fenner&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Mark%20Levene&amp;quot;&amp;gt;Mark Levene&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;2008&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;Move Generation with Perfect Hashing Functions.&amp;lt;/em&amp;gt; &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/ICGA%20Journal#31_1&amp;quot;&amp;gt;ICGA Journal, Vol. 31, No. 1&amp;lt;/a&amp;gt;, pp. 3-12. &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.dcs.bbk.ac.uk/~mark/download/bitboard_sliding_icga_final.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;pdf&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:18 --&gt;. While their &lt;a class=&quot;wiki_link&quot; href=&quot;/Hash%20Table&quot;&gt;Perfect Hashing&lt;/a&gt; approach provides great mathematical insights in &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Modulo&quot; rel=&quot;nofollow&quot;&gt;Congruent Modulo&lt;/a&gt; arithmetic, their final conclusion in comparison with &lt;a class=&quot;wiki_link&quot; href=&quot;/Hashing%20Dictionaries&quot;&gt;Hashing Dictionaries&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Rotated%20Bitboards&quot;&gt;Rotated Bitboards&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards&quot;&gt;Magic Bitboards&lt;/a&gt; was criticized by the obvious comparison with &lt;a class=&quot;wiki_link&quot; href=&quot;/Kindergarten%20Bitboards&quot;&gt;Kindergarten Bitboards&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:22:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=20913&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Nice Math - Strange Conclusions&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Gerd%20Isenberg&amp;quot;&amp;gt;Gerd Isenberg&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, April 29, 2008&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:22 --&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:39:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Modulo vs. Multiplication&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:39 --&gt;Modulo vs. Multiplication&lt;/h1&gt;
 &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan&quot;&gt;BitScan&lt;/a&gt; broaches the issue of &lt;a class=&quot;wiki_link&quot; href=&quot;/Hash%20Table&quot;&gt;Perfect Hashing&lt;/a&gt; with &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Modulo&quot;&gt;Modulo&lt;/a&gt; versus &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Multiplication&quot;&gt;Multiplication&lt;/a&gt; as well:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#BitscanByModulo&quot;&gt;Bitscan by Modulo&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#DeBruijnMultiplation&quot;&gt;De Bruijn Multiplication&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
So does the &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count#SWARPopcount&quot;&gt;SWAR-Popcount&lt;/a&gt;, when it is about to finally add byte-wise populations:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count#Castingout&quot;&gt;Casting out&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count#Multiplication&quot;&gt;Multiplication&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:41:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Modulo vs. Multiplication-Modulo&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:41 --&gt;Modulo&lt;/h2&gt;
&lt;!-- ws:start:WikiTextHeadingRule:43:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Modulo vs. Multiplication-Modulo-Congruence relation&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:43 --&gt;Congruence relation&lt;/h3&gt;
 Fenner and Levene use masked lines (not necessarily excluding the sliding piece), that is bitboards with N=8 active bits with k={7,8,9} bits apart, starting with bit zero&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:5:
[[math]]&amp;lt;br/&amp;gt;
A_{kN} = \{0, k, 2k, ...,(N-1)k\}&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt;A_{kN} = \{0, k, 2k, ...,(N-1)k\}&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:5 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
Based on &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Congruence_relation&quot; rel=&quot;nofollow&quot;&gt;Congruence relation&lt;/a&gt; &lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:6:
[[math]]&amp;lt;br/&amp;gt;
b \equiv c \pmod{m}&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt;b \equiv c \pmod{m}&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:6 --&gt;&lt;/li&gt;&lt;/ul&gt;or equivalently&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:7:
[[math]]&amp;lt;br/&amp;gt;
b \mod{m} = c \mod{m}&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt;b \mod{m} = c \mod{m}&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:7 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
they deduced two general perfect hashing functions. The case N &amp;lt;= k with&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:8:
[[math]]&amp;lt;br/&amp;gt;
h_{1}(a) = a \mod (2^k + 2)&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt;h_{1}(a) = a \mod (2^k + 2)&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:8 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
and the case N &amp;lt;= k + 1&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:9:
[[math]]&amp;lt;br/&amp;gt;
h_{2}(a) = a \mod (2^{k+1} + 1)&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt;h_{2}(a) = a \mod (2^{k+1} + 1)&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:9 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
This results in modulo 514 for &lt;a class=&quot;wiki_link&quot; href=&quot;/Diagonals&quot;&gt;diagonals&lt;/a&gt;, modulo 257 for &lt;a class=&quot;wiki_link&quot; href=&quot;/Anti-Diagonals&quot;&gt;anti-diagonals&lt;/a&gt;, and modulo 258 for &lt;a class=&quot;wiki_link&quot; href=&quot;/Files&quot;&gt;files&lt;/a&gt;, to calculate the occupied index. Tables could made denser by storing indices, but that would require a second indirection. While Fenner and Levene used a &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/MATLAB&quot; rel=&quot;nofollow&quot;&gt;Matlab&lt;/a&gt; 32-bit implementation to conclude their approach might be competitive, this is how it may be implemented in &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt; by looking up pre-calculated attack-bitboards:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;U64 arrCmodDiaAttacks [514][64];  // 257 K&amp;lt;br/&amp;gt;U64 arrCmodAntiAttacks[257][64];&amp;lt;br/&amp;gt;U64 arrCmodFileAttacks[258][64];&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 diagonalAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   const U64 aDia = C64(0x8040201008040201);&amp;lt;br/&amp;gt;   occ = ( (occ &amp;amp;gt;&amp;amp;gt; diashift[sq]) &amp;amp;amp; aDia) % 514;&amp;lt;br/&amp;gt;   return arrCmodDiaAttacks[occ][sq];&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 antiDiagAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   const U64 aAntiDiaShr7 = C64(0x0002040810204081);&amp;lt;br/&amp;gt;   occ = ( (occ &amp;amp;gt;&amp;amp;gt; antishift[sq]) &amp;amp;amp; aAntiDiaShr7 ) % 257;&amp;lt;br/&amp;gt;   return arrCmodAntiAttacks[occ][sq];&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 fileAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   const U64 aFile = C64(0x0101010101010101);&amp;lt;br/&amp;gt;   occ = ( (occ &amp;amp;gt;&amp;amp;gt; (sq&amp;amp;amp;7)) &amp;amp;amp; aFile) % 258;&amp;lt;br/&amp;gt;   return arrCmodFileAttacks[occ][sq];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;U64 arrCmodDiaAttacks [514][64];  // 257 K
U64 arrCmodAntiAttacks[257][64];
U64 arrCmodFileAttacks[258][64];
&amp;nbsp;
U64 diagonalAttacks(U64 occ, enumSquare sq) {
   const U64 aDia = C64(0x8040201008040201);
   occ = ( (occ &amp;gt;&amp;gt; diashift[sq]) &amp;amp; aDia) % 514;
   return arrCmodDiaAttacks[occ][sq];
}
&amp;nbsp;
U64 antiDiagAttacks(U64 occ, enumSquare sq) {
   const U64 aAntiDiaShr7 = C64(0x0002040810204081);
   occ = ( (occ &amp;gt;&amp;gt; antishift[sq]) &amp;amp; aAntiDiaShr7 ) % 257;
   return arrCmodAntiAttacks[occ][sq];
}
&amp;nbsp;
U64 fileAttacks(U64 occ, enumSquare sq) {
   const U64 aFile = C64(0x0101010101010101);
   occ = ( (occ &amp;gt;&amp;gt; (sq&amp;amp;7)) &amp;amp; aFile) % 258;
   return arrCmodFileAttacks[occ][sq];
}&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:77:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Castingout255&amp;quot; title=&amp;quot;Anchor: Castingout255&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Castingout255&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:77 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:45:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Modulo vs. Multiplication-Modulo-Casting out 255&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:45 --&gt;Casting out 255&lt;/h3&gt;
For ranks, diagonals or anti-diagonals, where the occupancy mask excludes the sliding piece, and the rank-or byte-wise sum of disjoint bits is therefor less than 255, &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count#Castingout&quot;&gt;Casting out&lt;/a&gt; 256-1 works as well, without any shifts required, and with more space saving options for the lookup table, i. e. similar to Kindergarten Bitboards with shared multiples of first rank attacks and an trailing post-mask with the same line &lt;!-- ws:start:WikiTextRefRule:25:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;amp;t=51996&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Low memory usage attack bitboard generation&amp;lt;/a&amp;gt; by crystalclear, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;Winboard Forum&amp;lt;/a&amp;gt;, October 06, 2011&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-3&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:25 --&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;masked occupany  %  256-1            =  A-H    &amp;lt;br/&amp;gt;. . . . . . . H     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . G .     . . . . . . . .     . . . . . . . . &amp;lt;br/&amp;gt;. . . . . F . .     . . . . . . . .     . . . . . . . . &amp;lt;br/&amp;gt;. . . . E . . .     . . . . . . . .     . . . . . . . . &amp;lt;br/&amp;gt;. . . . . . . .  %  . . . . . . . .  =  . . . . . . . . &amp;lt;br/&amp;gt;. . C . . . . .     . . . . . . . .     . . . . . . . . &amp;lt;br/&amp;gt;. B . . . . . .     . . . . . . . .     . . . . . . . . &amp;lt;br/&amp;gt;A . . . . . . .     1 1 1 1 1 1 1 1     A B C . E F G H &amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;masked occupany  %  256-1            =  A-H    
. . . . . . . H     . . . . . . . .     . . . . . . . .
. . . . . . G .     . . . . . . . .     . . . . . . . . 
. . . . . F . .     . . . . . . . .     . . . . . . . . 
. . . . E . . .     . . . . . . . .     . . . . . . . . 
. . . . . . . .  %  . . . . . . . .  =  . . . . . . . . 
. . C . . . . .     . . . . . . . .     . . . . . . . . 
. B . . . . . .     . . . . . . . .     . . . . . . . . 
A . . . . . . .     1 1 1 1 1 1 1 1     A B C . E F G H &lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:47:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Modulo vs. Multiplication-Modulo-Reciprocal Multiplication&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:47 --&gt;Reciprocal Multiplication&lt;/h3&gt;
The 64-bit modulo by a constant can be done most efficiently by &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Modulo&quot;&gt;reciprocal fixed point multiplication&lt;/a&gt;, this is how &lt;a class=&quot;wiki_link&quot; href=&quot;/Microsoft&quot;&gt;Microsoft&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Visual_C%2B%2B&quot; rel=&quot;nofollow&quot;&gt;Visual C++&lt;/a&gt; 2005 compiler implements the mod constant for &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; processors. One 64*64=128 bit multiplication, one shift, one further 32-bit multiplication , one subtraction. Of course using 64-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Division&quot;&gt;division&lt;/a&gt; to get the remainder burns even more cycles.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;Code:&amp;lt;br/&amp;gt;% 514&amp;lt;br/&amp;gt; mov    r11d, r10 ; masked diagonal&amp;lt;br/&amp;gt; mov    rax, ff00ff00ff00ff01H&amp;lt;br/&amp;gt; mul    r10&amp;lt;br/&amp;gt; shr    rdx, 9&amp;lt;br/&amp;gt; imul   edx, 514 ; 00000202H&amp;lt;br/&amp;gt; sub    r11d, edx&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;% 257&amp;lt;br/&amp;gt; mov    r11d, r10 ; masked diagonal&amp;lt;br/&amp;gt; mov    rax, ff00ff00ff00ff01H&amp;lt;br/&amp;gt; mul    r10&amp;lt;br/&amp;gt; shr    rdx, 8&amp;lt;br/&amp;gt; imul   edx, 257 ; 00000101H&amp;lt;br/&amp;gt; sub    r11d, edx&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;Code:
% 514
 mov    r11d, r10 ; masked diagonal
 mov    rax, ff00ff00ff00ff01H
 mul    r10
 shr    rdx, 9
 imul   edx, 514 ; 00000202H
 sub    r11d, edx
&amp;nbsp;
% 257
 mov    r11d, r10 ; masked diagonal
 mov    rax, ff00ff00ff00ff01H
 mul    r10
 shr    rdx, 8
 imul   edx, 257 ; 00000101H
 sub    r11d, edx&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:49:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Modulo vs. Multiplication-Multiplication&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:49 --&gt;Multiplication&lt;/h2&gt;
 A Kindergarten like approach might look like this (not considering &lt;a class=&quot;wiki_link&quot; href=&quot;/First%20Rank%20Attacks#TheOuterSquares&quot;&gt;inner six bits&lt;/a&gt;):&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;U64 arrDiagonalAttacks[256][64];  // 128 K&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 diagonalAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   occ = (diagonalMask[sq] &amp;amp;amp; occ) * C64(0x0101010101010101) &amp;amp;gt;&amp;amp;gt; 56;&amp;lt;br/&amp;gt;   return arrDiagonalAttacks[occ][sq];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;U64 arrDiagonalAttacks[256][64];  // 128 K
&amp;nbsp;
U64 diagonalAttacks(U64 occ, enumSquare sq) {
   occ = (diagonalMask[sq] &amp;amp; occ) * C64(0x0101010101010101) &amp;gt;&amp;gt; 56;
   return arrDiagonalAttacks[occ][sq];
}&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;and uses one 64*64=64-bit multiplication, with this &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; assembly for calculating an eight-bit occupied index:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt; mov    rax, 0101010101010101H&amp;lt;br/&amp;gt; imul   rdx, rax&amp;lt;br/&amp;gt; shr    rdx, 56&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt; mov    rax, 0101010101010101H
 imul   rdx, rax
 shr    rdx, 56&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;Even &lt;a class=&quot;wiki_link&quot; href=&quot;/Kindergarten%20Bitboards#FileAttacks&quot;&gt;Kindergarten File-Attacks&lt;/a&gt; are cheaper and faster, not to mention &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards&quot;&gt;Magic Bitboards&lt;/a&gt;, which covers two lines of a rook or bishop in one run.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:51:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc6&quot;&gt;&lt;a name=&quot;Fenner&#039;s and Levene&#039;s conclusion&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:51 --&gt;Fenner&#039;s and Levene&#039;s conclusion&lt;/h1&gt;
 Quote from their paper pp 11&lt;br /&gt;
&lt;strong&gt;&lt;tt&gt;3.5. Comparison with other Methods&lt;/tt&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;tt&gt;As reported in Hyatt (2007), the rotated and magic bitboard methods are of comparable performance, and Tannous (2007) claims just a small improvement of the direct lookup method over rotated bitboards. It is easy to see that, in terms of the number of computer operations, the efficiency of our method will be similar to that of direct lookup. Thus we are justified in claiming that the computational efficiency of our method is comparable to the others.&lt;/tt&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
Their conclusion was based on following statement of &lt;a class=&quot;wiki_link&quot; href=&quot;/Robert%20Hyatt&quot;&gt;Robert Hyatt&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:29:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;amp;p=140141&amp;amp;amp;t=16002&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: BitBoard Tests Magic v Non-Rotated 32 Bits v 64 Bits&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Robert%20Hyatt&amp;quot;&amp;gt;Robert Hyatt&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt; August 25, 2007&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-4&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-4&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:29 --&gt; &lt;strong&gt;...&lt;/strong&gt;&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;tt&gt;I had reported this earlier. Magic was no faster than rotated. I switched because of two things...&lt;/tt&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;tt&gt;1. Magic is simpler, and simpler is better as I get older.&lt;/tt&gt;&lt;/li&gt;&lt;li&gt;&lt;tt&gt;2. Magic gives you the opportunity to update the occupied_squares and then generate moves easily.&lt;/tt&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;tt&gt;To do this with rotated bitboards first requires that all rotated bitboards be updated in addition to the normal occupied_squares bitboard. This is faster, if you use the feature (I don&#039;t yet, but well might at times).&lt;/tt&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;strong&gt;...&lt;/strong&gt; and this claim of &lt;a class=&quot;wiki_link&quot; href=&quot;/Sam%20Tannous&quot;&gt;Sam Tannous&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:37:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Sam%20Tannous&amp;quot;&amp;gt;Sam Tannous&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;2007&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;Avoiding Rotated Bitboards with Direct Lookup&amp;lt;/em&amp;gt;. &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/ICGA%20Journal#30_2&amp;quot;&amp;gt;ICGA Journal, Vol. 30, No. 2&amp;lt;/a&amp;gt;, pp. 85-91, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://arxiv.org/PS_cache/arxiv/pdf/0704/0704.3773v2.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;pdf&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-5&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-5&quot;&gt;[5]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:37 --&gt;:&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;tt&gt;The results shown indicate that directly looking up the attacking moves for sliding pieces in hash tables improves the move generation speeds from 10% to 15% depending on computer architecture. Further efficiencies can be expected in a full implementation where the overhead of maintaining rotated bitboards is eliminated. The implementation and test code is made available in an Open-Source, interactive, chess programming module called “Shatranj” (Tannous, 2006).&lt;/tt&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:53:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc7&quot;&gt;&lt;a name=&quot;Publications&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:53 --&gt;Publications&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://sun.aei.polsl.pl/~zjc/&quot; rel=&quot;nofollow&quot;&gt;Zbigniew J. Czech&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://itee.uq.edu.au/~havas/&quot; rel=&quot;nofollow&quot;&gt;George Havas&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.informatik.uni-trier.de/~ley/db/indices/a-tree/m/Majewski:Bohdan_S=.html&quot; rel=&quot;nofollow&quot;&gt;Bohdan S. Majewski&lt;/a&gt; (&lt;strong&gt;1997&lt;/strong&gt;). &lt;em&gt;Perfect Hashing&lt;/em&gt;. Theoretical Computer Science, Vol. 182, Nos. 1-2, pp. 1-143&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Trevor%20Fenner&quot;&gt;Trevor Fenner&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Mark%20Levene&quot;&gt;Mark Levene&lt;/a&gt; (&lt;strong&gt;2008&lt;/strong&gt;). &lt;em&gt;Move Generation with Perfect Hashing Functions.&lt;/em&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/ICGA%20Journal#31_1&quot;&gt;ICGA Journal, Vol. 31, No. 1&lt;/a&gt;, pp. 3-12. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.dcs.bbk.ac.uk/~mark/download/bitboard_sliding_icga_final.pdf&quot; rel=&quot;nofollow&quot;&gt;pdf&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:55:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc8&quot;&gt;&lt;a name=&quot;Forum Posts&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:55 --&gt;Forum Posts&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=20913&quot; rel=&quot;nofollow&quot;&gt;Nice Math - Strange Conclusions&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, April 29, 2008&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;t=51996&quot; rel=&quot;nofollow&quot;&gt;Low memory usage attack bitboard generation&lt;/a&gt; by crystalclear, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, October 06, 2011&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:57:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc9&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:57 --&gt;External Links&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Congruence_relation&quot; rel=&quot;nofollow&quot;&gt;Congruence relation from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Linear_congruence_theorem&quot; rel=&quot;nofollow&quot;&gt;Linear congruence theorem from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Modular_arithmetic&quot; rel=&quot;nofollow&quot;&gt;Modular arithmetic from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Modulo_operation&quot; rel=&quot;nofollow&quot;&gt;Modulo operation from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:59:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc10&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:59 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:284:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Trevor%20Fenner&quot;&gt;Trevor Fenner&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Mark%20Levene&quot;&gt;Mark Levene&lt;/a&gt; (&lt;strong&gt;2008&lt;/strong&gt;). &lt;em&gt;Move Generation with Perfect Hashing Functions.&lt;/em&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/ICGA%20Journal#31_1&quot;&gt;ICGA Journal, Vol. 31, No. 1&lt;/a&gt;, pp. 3-12. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.dcs.bbk.ac.uk/~mark/download/bitboard_sliding_icga_final.pdf&quot; rel=&quot;nofollow&quot;&gt;pdf&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=20913&quot; rel=&quot;nofollow&quot;&gt;Nice Math - Strange Conclusions&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, April 29, 2008&lt;/li&gt;
&lt;li id=&quot;cite_note-3&quot;&gt;&lt;a href=&quot;#cite_ref-3&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;t=51996&quot; rel=&quot;nofollow&quot;&gt;Low memory usage attack bitboard generation&lt;/a&gt; by crystalclear, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, October 06, 2011&lt;/li&gt;
&lt;li id=&quot;cite_note-4&quot;&gt;&lt;a href=&quot;#cite_ref-4&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;p=140141&amp;amp;t=16002&quot; rel=&quot;nofollow&quot;&gt;Re: BitBoard Tests Magic v Non-Rotated 32 Bits v 64 Bits&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Robert%20Hyatt&quot;&gt;Robert Hyatt&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt; August 25, 2007&lt;/li&gt;
&lt;li id=&quot;cite_note-5&quot;&gt;&lt;a href=&quot;#cite_ref-5&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Sam%20Tannous&quot;&gt;Sam Tannous&lt;/a&gt; (&lt;strong&gt;2007&lt;/strong&gt;). &lt;em&gt;Avoiding Rotated Bitboards with Direct Lookup&lt;/em&gt;. &lt;a class=&quot;wiki_link&quot; href=&quot;/ICGA%20Journal#30_2&quot;&gt;ICGA Journal, Vol. 30, No. 2&lt;/a&gt;, pp. 85-91, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://arxiv.org/PS_cache/arxiv/pdf/0704/0704.3773v2.pdf&quot; rel=&quot;nofollow&quot;&gt;pdf&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:284 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:61:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc11&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:61 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:05:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Congruent Modulo Bitboards&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;10&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Congruent Modulo Bitboards&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;10&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Congruent_Modulo_Bitboards includeBody-Congruent%20Modulo%20Bitboards includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Congruent+Modulo+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Congruent Modulo Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 26, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Efficient+Generation+of+Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Efficient Generation of Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hash+Table&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hash Table&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 1, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/ICGA+Journal&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;ICGA Journal&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 21, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mark+Levene&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mark Levene&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 2, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Trevor+Fenner&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Trevor Fenner&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 2, 2015&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:05 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Evaluation of Pieces</title>
      <link>https://chessprogramming.wikispaces.com/Evaluation+of+Pieces</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Evaluation+of+Pieces</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Evaluation+of+Pieces</comments>
      <pubDate>Mon, 08 Jan 2018 21:52:17 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:25:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:25 --&gt;&lt;!-- ws:start:WikiTextTocRule:26: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Pawn&quot;&gt;Pawn&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:26 --&gt;&lt;!-- ws:start:WikiTextTocRule:27: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Knight&quot;&gt;Knight&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:27 --&gt;&lt;!-- ws:start:WikiTextTocRule:28: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Bishop&quot;&gt;Bishop&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:28 --&gt;&lt;!-- ws:start:WikiTextTocRule:29: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Rook&quot;&gt;Rook&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:29 --&gt;&lt;!-- ws:start:WikiTextTocRule:30: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Queen&quot;&gt;Queen&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:30 --&gt;&lt;!-- ws:start:WikiTextTocRule:31: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#King&quot;&gt;King&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:31 --&gt;&lt;!-- ws:start:WikiTextTocRule:32: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:32 --&gt;&lt;!-- ws:start:WikiTextTocRule:33: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Forum Posts&quot;&gt;Forum Posts&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:33 --&gt;&lt;!-- ws:start:WikiTextTocRule:34: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:34 --&gt;&lt;!-- ws:start:WikiTextTocRule:35: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:35 --&gt;&lt;!-- ws:start:WikiTextTocRule:36: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:36 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Evaluation&quot;&gt;Evaluation&lt;/a&gt; * of Pieces&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
This page serves as a quick reference for those who look for ideas about evaluating different kinds of pieces.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:37:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Pawn&amp;quot; title=&amp;quot;Anchor: Pawn&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Pawn&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:37 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:5:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Pawn&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:5 --&gt;Pawn&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Pawn%20Structure&quot;&gt;Pawn Structure&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Pawn%20Center&quot;&gt;Pawn Center&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Blockade%20of%20Stop&quot;&gt;Blockade of Stop&lt;/a&gt;&lt;br /&gt;
penalty for &amp;quot;d&amp;quot; and &amp;quot;e&amp;quot; pawns blocked on their initial squares&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextAnchorRule:38:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Knight&amp;quot; title=&amp;quot;Anchor: Knight&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Knight&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:38 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:7:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Knight&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:7 --&gt;Knight&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;Decreasing value as pawns disappear&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Outposts&quot;&gt;Outposts&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Knight trapped on A8/H8/A7/H7 or A1/H1/A2/H2 - see &lt;a class=&quot;wiki_link&quot; href=&quot;/Trapped%20Pieces&quot;&gt;Trapped Pieces&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Penalty for blocking a &amp;quot;c&amp;quot; pawn in closed openings (&lt;a class=&quot;wiki_link&quot; href=&quot;/Crafty&quot;&gt;Crafty&lt;/a&gt; defines it as follows: white knight on c3, white pawns on c2 and d4, no white pawn on e4)&lt;/li&gt;&lt;li&gt;When calculating knight &lt;a class=&quot;wiki_link&quot; href=&quot;/Mobility&quot;&gt;mobility&lt;/a&gt;, it is advisable to omit &lt;a class=&quot;wiki_link&quot; href=&quot;/Square%20Control&quot;&gt;squares controlled&lt;/a&gt; by enemy pawns&lt;/li&gt;&lt;li&gt;Marginal bonus for a knight defended by a pawn&lt;/li&gt;&lt;li&gt;Penalty for an undefended minor piece (&lt;a class=&quot;wiki_link&quot; href=&quot;/Stockfish&quot;&gt;Stockfish&lt;/a&gt;)&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextAnchorRule:39:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Bishop&amp;quot; title=&amp;quot;Anchor: Bishop&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Bishop&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:39 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:9:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Bishop&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:9 --&gt;Bishop&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Bad%20Bishop&quot;&gt;Bad Bishop&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Bishop%20Pair&quot;&gt;Bishop Pair&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Bishop%20versus%20Knight&quot;&gt;Bishop versus Knight&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Color%20Weakness&quot;&gt;Color Weakness&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Fianchetto&quot;&gt;Fianchetto&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Returning%20Bishop&quot;&gt;Returning Bishop&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Bishop trapped by enemy pawns on A2/H2/A7/H7 or on A3/H3/A6/H6, see &lt;a class=&quot;wiki_link&quot; href=&quot;/Trapped%20Pieces&quot;&gt;Trapped Pieces&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Penalty for an undefended minor piece (&lt;a class=&quot;wiki_link&quot; href=&quot;/Stockfish&quot;&gt;Stockfish&lt;/a&gt;)&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextAnchorRule:40:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Rook&amp;quot; title=&amp;quot;Anchor: Rook&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Rook&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:40 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:11:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Rook&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:11 --&gt;Rook&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;Increasing value as pawns disappear&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Rook%20on%20open%20file&quot;&gt;Rook on open file&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Rook%20on%20seventh&quot;&gt;Rook on seventh&lt;/a&gt; (possibly also eigth) rank&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Tarrasch%20Rule&quot;&gt;Tarrasch Rule&lt;/a&gt; (Rook behind Passed Pawn)&lt;/li&gt;&lt;li&gt;Penalty for a Rook blocked by an uncastled King&lt;/li&gt;&lt;li&gt;Small bonus for a rook with enemy queen on the same file (doesn&#039;t matter if it&#039;s open or not)&lt;/li&gt;&lt;li&gt;Rooks defending each other (Rebel uses a piece/square table for that, making suppoeted rook on 7th rank even more valuable)&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextAnchorRule:41:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Queen&amp;quot; title=&amp;quot;Anchor: Queen&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Queen&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:41 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:13:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Queen&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:13 --&gt;Queen&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;Penalty for early development &lt;!-- ws:start:WikiTextRefRule:3:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.stmintz.com/ccc/index.php?id=18371&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Queen wandering, was: Crafty 14,9&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Roland%20Pfister&amp;quot;&amp;gt;Roland Pfister&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, May 11, 1998&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:3 --&gt;&lt;/li&gt;&lt;li&gt;Some programs do not evaluate queen &lt;a class=&quot;wiki_link&quot; href=&quot;/Mobility&quot;&gt;mobility&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Some versions of &lt;a class=&quot;wiki_link&quot; href=&quot;/Fruit&quot;&gt;Fruit&lt;/a&gt; replace queen mobility by &lt;a class=&quot;wiki_link&quot; href=&quot;/King%20Safety#KingTropism&quot;&gt;king tropism&lt;/a&gt;&lt;/li&gt;&lt;li&gt;If &lt;a class=&quot;wiki_link&quot; href=&quot;/King%20Safety&quot;&gt;king safety&lt;/a&gt; evaluation relies on king tropism, queen tends to get somewhat higher bonus&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextAnchorRule:42:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@King&amp;quot; title=&amp;quot;Anchor: King&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;King&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:42 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:15:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc5&quot;&gt;&lt;a name=&quot;King&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:15 --&gt;King&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/King%20Safety&quot;&gt;King safety&lt;/a&gt; in the &lt;a class=&quot;wiki_link&quot; href=&quot;/Middlegame&quot;&gt;middlegame&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/King%20Centralization&quot;&gt;King centralization&lt;/a&gt; in the &lt;a class=&quot;wiki_link&quot; href=&quot;/Endgame&quot;&gt;endgame&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Mate%20at%20a%20Glance&quot;&gt;Mate at a Glance&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Penalty for standing on a wing with no pawns present in the endgame&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Pin&quot;&gt;Pins&lt;/a&gt;/&lt;a class=&quot;wiki_link&quot; href=&quot;/X-ray&quot;&gt;X-ray&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Castling%20Rights&quot;&gt;Castling Rights&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:17:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc6&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:17 --&gt;See also&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Influence%20Quantity%20of%20Pieces&quot;&gt;Influence Quantity of Pieces&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Material&quot;&gt;Material&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Mobility&quot;&gt;Mobility&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Piece-Square%20Tables&quot;&gt;Piece-Square Tables&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Square%20Control&quot;&gt;Square Control&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:19:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc7&quot;&gt;&lt;a name=&quot;Forum Posts&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:19 --&gt;Forum Posts&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=55453&quot; rel=&quot;nofollow&quot;&gt;Knight Evaluation&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Jonathan%20Rosenthal&quot;&gt;Jonathan Rosenthal&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, February 24, 2015&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=56690&quot; rel=&quot;nofollow&quot;&gt;eval pieces&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Daniel%20Anulliero&quot;&gt;Daniel Anulliero&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, June 15, 2015&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:21:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc8&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:21 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:208:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=18371&quot; rel=&quot;nofollow&quot;&gt;Queen wandering, was: Crafty 14,9&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Roland%20Pfister&quot;&gt;Roland Pfister&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, May 11, 1998&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:208 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:23:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc9&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:23 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:00:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Evaluation of pieces&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Evaluation of pieces&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Evaluation_of_Pieces includeBody-Evaluation%20of%20Pieces includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bad+bishop&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bad bishop&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 22, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Betsabe&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Betsabe&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 23, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BigLion&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BigLion&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 28, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bishop+Pair&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bishop Pair&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bishop+versus+knight&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bishop versus knight&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 17, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Blockade+of+Stop&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Blockade of Stop&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Chenard&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Chenard&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 5, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Clarabit&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Clarabit&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 3, 2011&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Coiled&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Coiled&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 12, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Color+Weakness&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Color Weakness&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Demolito&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Demolito&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 1, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Evaluation&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Evaluation&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 1, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Evaluation+of+Pieces&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Evaluation of Pieces&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 8, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Exacto&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Exacto&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 3, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Faile&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Faile&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Genie&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Genie&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gk&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gk&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 9, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Ifrit&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Ifrit&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Influence+Quantity+of+Pieces&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Influence Quantity of Pieces&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 21, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Jabba&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Jabba&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 10, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/KnockOut&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;KnockOut&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 20, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/MadChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;MadChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 4, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Monsoon&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Monsoon&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 8, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pawn+Center&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pawn Center&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 12, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Piece-Square+Tables&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Piece-Square Tables&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 31, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pieces&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pieces&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 19, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Returning+Bishop&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Returning Bishop&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 16, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rival&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rival&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 30, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Robocide&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Robocide&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rook+on+Open+File&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rook on Open File&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rook+On+Seventh&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rook On Seventh&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 24, 2009&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sayuri&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sayuri&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 1, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Scidlet&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Scidlet&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 31, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Simplex&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Simplex&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Slow+Chess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Slow Chess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 17, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Tarrasch+Rule&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Tarrasch Rule&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 2, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Tucano&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Tucano&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Tunguska&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Tunguska&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Y%21&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Y!&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:00 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Evaluation&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Exploding Bitboards</title>
      <link>https://chessprogramming.wikispaces.com/Exploding+Bitboards</link>
      <dc:creator>PsyMar</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Exploding+Bitboards</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Exploding+Bitboards</comments>
      <pubDate>Mon, 09 Mar 2015 12:29:50 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:28:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:28 --&gt;&lt;!-- ws:start:WikiTextTocRule:29: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Bishops&quot;&gt;Bishops&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:29 --&gt;&lt;!-- ws:start:WikiTextTocRule:30: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Rooks&quot;&gt;Rooks&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:30 --&gt;&lt;!-- ws:start:WikiTextTocRule:31: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Results&quot;&gt;Results&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:31 --&gt;&lt;!-- ws:start:WikiTextTocRule:32: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:32 --&gt;&lt;!-- ws:start:WikiTextTocRule:33: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:33 --&gt;&lt;!-- ws:start:WikiTextTocRule:34: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:34 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Board%20Representation&quot;&gt;Board Representation&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Bitboards&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Sliding Piece Attacks&lt;/a&gt; * Exploding Bitboards&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
The expanding or &lt;strong&gt;exploding bitboards&lt;/strong&gt; were created by &lt;a class=&quot;wiki_link&quot; href=&quot;/Harald%20L%C3%BC%C3%9Fen&quot;&gt;Harald Lüßen&lt;/a&gt; with some help from other people in &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:16:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;amp;t=4523&amp;amp;amp;start=80&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: Compact Bitboard Attacks&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Harald%20L%C3%BC%C3%9Fen&amp;quot;&amp;gt;Harald Lüßen&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;Winboard Forum&amp;lt;/a&amp;gt;, September 13, 2006&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:16 --&gt; . The idea is to generate the attacks of a sliding piece from its square outside on all its rays in parallel like the waves of a stone thrown into water. This is done in some steps with multiplications and shifts like in the &lt;a class=&quot;wiki_link&quot; href=&quot;/Kindergarten%20Bitboards&quot;&gt;kindergarten bitboards&lt;/a&gt;. At each step or distance from the original square the rays can be expanded or stopped by other pieces from an occupied bitboard. There are some nasty overflow problems at the border of the board that must be solved. This approach is slower than other techniques. The code below is taken from the chess engine &lt;a class=&quot;wiki_link&quot; href=&quot;/Elephant&quot;&gt;Elephant&lt;/a&gt; which is known for some bitboard comparisons but not for playing strength.&lt;br /&gt;
&lt;br /&gt;
In the example this &lt;a class=&quot;wiki_link&quot; href=&quot;/Square%20Mapping%20Considerations&quot;&gt;big-endian file-mapping&lt;/a&gt; is used:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;    directions and shifts&amp;lt;br/&amp;gt;    +&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+&amp;lt;br/&amp;gt;    |&amp;amp;lt;&amp;amp;lt;= 9|&amp;amp;lt;&amp;amp;lt;= 8|&amp;amp;lt;&amp;amp;lt;= 7|&amp;lt;br/&amp;gt;    +&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+&amp;lt;br/&amp;gt;    |&amp;amp;lt;&amp;amp;lt;= 1|     |&amp;amp;gt;&amp;amp;gt;= 1|&amp;lt;br/&amp;gt;    +&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+&amp;lt;br/&amp;gt;    |&amp;amp;gt;&amp;amp;gt;= 7|&amp;amp;gt;&amp;amp;gt;= 8|&amp;amp;gt;&amp;amp;gt;= 9|&amp;lt;br/&amp;gt;    +&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    +&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+&amp;lt;br/&amp;gt;    | 63 62 61 60 59 58 57 56 | 8&amp;lt;br/&amp;gt;    | 55 54 53 52 51 50 49 48 | 7&amp;lt;br/&amp;gt;    | 47 46 45 44 43 42 41 40 | 6&amp;lt;br/&amp;gt;    | 39 38 37 36 35 35 33 32 | 5&amp;lt;br/&amp;gt;    | 31 30 29 28 27 26 25 24 | 4&amp;lt;br/&amp;gt;    | 23 22 21 20 19 18 17 16 | 3&amp;lt;br/&amp;gt;    | 15 14 13 12 11 10  9  8 | 2&amp;lt;br/&amp;gt;    |  7  6  5  4  3  2  1  0 | 1&amp;lt;br/&amp;gt;    +&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+&amp;lt;br/&amp;gt;       a  b  c  d  e  f  g  h&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;    directions and shifts
    +-----+-----+-----+
    |&amp;lt;&amp;lt;= 9|&amp;lt;&amp;lt;= 8|&amp;lt;&amp;lt;= 7|
    +-----+-----+-----+
    |&amp;lt;&amp;lt;= 1|     |&amp;gt;&amp;gt;= 1|
    +-----+-----+-----+
    |&amp;gt;&amp;gt;= 7|&amp;gt;&amp;gt;= 8|&amp;gt;&amp;gt;= 9|
    +-----+-----+-----+
&amp;nbsp;
    +-------------------------+
    | 63 62 61 60 59 58 57 56 | 8
    | 55 54 53 52 51 50 49 48 | 7
    | 47 46 45 44 43 42 41 40 | 6
    | 39 38 37 36 35 35 33 32 | 5
    | 31 30 29 28 27 26 25 24 | 4
    | 23 22 21 20 19 18 17 16 | 3
    | 15 14 13 12 11 10  9  8 | 2
    |  7  6  5  4  3  2  1  0 | 1
    +-------------------------+
       a  b  c  d  e  f  g  h
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;br /&gt;
The general trick of chasing and pushing around the bits on the board is this: First shift down and sideways far enough to get a good start. Then multiply with 2 to shift one square to the side (left in this mapping) and multiply with 2^8 = 0x100 to move the bit upwards. Use any power of 2 that helps you. Build the sum of all the multiplication factors of all moves for all bits and multiply with that number. There will probably be more bits in the result than there should be because the multiplication works on all original bits. Use a mask to get rid of all the bad bits.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:18:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Bishops&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:18 --&gt;Bishops&lt;/h1&gt;
 For each square there is an ignition of the explosion.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/*&amp;lt;br/&amp;gt;First expanding step (explosion) for a bishop&amp;lt;br/&amp;gt; . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .&amp;lt;br/&amp;gt; . . 1 . 1 . . .&amp;lt;br/&amp;gt; . . .sq . . . .&amp;lt;br/&amp;gt; . . 1 . 1 . . .&amp;lt;br/&amp;gt; . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .&amp;lt;br/&amp;gt;*/&amp;lt;br/&amp;gt;Bitboard initB[64];&amp;lt;br/&amp;gt;void makeInitB()&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    for ( int sq = 0; sq &amp;amp;lt; 64; ++sq )&amp;lt;br/&amp;gt;    {&amp;lt;br/&amp;gt;        Bitboard bb = C64(1) &amp;amp;lt;&amp;amp;lt; sq;&amp;lt;br/&amp;gt;        initB[sq]  = (bb &amp;amp;gt;&amp;amp;gt; 9) &amp;amp;amp; C64(0x7f7f7f7f7f7f7f7f);&amp;lt;br/&amp;gt;        initB[sq] |= (bb &amp;amp;gt;&amp;amp;gt; 7) &amp;amp;amp; C64(0xfefefefefefefefe);&amp;lt;br/&amp;gt;        initB[sq] |= (bb &amp;amp;lt;&amp;amp;lt; 9) &amp;amp;amp; C64(0xfefefefefefefefe);&amp;lt;br/&amp;gt;        initB[sq] |= (bb &amp;amp;lt;&amp;amp;lt; 7) &amp;amp;amp; C64(0x7f7f7f7f7f7f7f7f);&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/*
First expanding step (explosion) for a bishop
 . . . . . . . .
 . . . . . . . .
 . . . . . . . .
 . . 1 . 1 . . .
 . . .sq . . . .
 . . 1 . 1 . . .
 . . . . . . . .
 . . . . . . . .
*/&lt;/span&gt;
Bitboard initB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; makeInitB&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;sq &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        Bitboard bb &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; sq&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        initB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x7f7f7f7f7f7f7f7f&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        initB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0xfefefefefefefefe&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        initB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0xfefefefefefefefe&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        initB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x7f7f7f7f7f7f7f7f&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;The explosion is only allowed along the rays.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/*&amp;lt;br/&amp;gt;Mask for bishop attack rays&amp;lt;br/&amp;gt; . . . . . . . 1&amp;lt;br/&amp;gt; 1 . . . . . 1 .&amp;lt;br/&amp;gt; . 1 . . . 1 . .&amp;lt;br/&amp;gt; . . 1 . 1 . . .&amp;lt;br/&amp;gt; . . .sq . . . .&amp;lt;br/&amp;gt; . . 1 . 1 . . .&amp;lt;br/&amp;gt; . 1 . . . 1 . .&amp;lt;br/&amp;gt; 1 . . . . . 1 .&amp;lt;br/&amp;gt;*/&amp;lt;br/&amp;gt;Bitboard maskB[64];&amp;lt;br/&amp;gt;void makeMaskB()&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    int sq;&amp;lt;br/&amp;gt;    for ( sq = 0; sq &amp;amp;lt; 64; ++sq )&amp;lt;br/&amp;gt;    {&amp;lt;br/&amp;gt;        maskB[sq] = 0;&amp;lt;br/&amp;gt;        int i;&amp;lt;br/&amp;gt;        for ( i = sq - 9; i &amp;amp;gt;= 0 &amp;amp;amp;&amp;amp;amp; i % 8 != 7; i -= 9 )&amp;lt;br/&amp;gt;            maskB[sq] |= C64(1) &amp;amp;lt;&amp;amp;lt; i;&amp;lt;br/&amp;gt;        for ( i = sq - 7; i &amp;amp;gt;= 0 &amp;amp;amp;&amp;amp;amp; i % 8 != 0; i -= 7 )&amp;lt;br/&amp;gt;            maskB[sq] |= C64(1) &amp;amp;lt;&amp;amp;lt; i;&amp;lt;br/&amp;gt;        for ( i = sq + 9; i &amp;amp;lt; 64 &amp;amp;amp;&amp;amp;amp; i % 8 != 0; i += 9 )&amp;lt;br/&amp;gt;            maskB[sq] |= C64(1) &amp;amp;lt;&amp;amp;lt; i;&amp;lt;br/&amp;gt;        for ( i = sq + 7; i &amp;amp;lt; 64 &amp;amp;amp;&amp;amp;amp; i % 8 != 7; i += 7 )&amp;lt;br/&amp;gt;            maskB[sq] |= C64(1) &amp;amp;lt;&amp;amp;lt; i;&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/*
Mask for bishop attack rays
 . . . . . . . 1
 1 . . . . . 1 .
 . 1 . . . 1 . .
 . . 1 . 1 . . .
 . . .sq . . . .
 . . 1 . 1 . . .
 . 1 . . . 1 . .
 1 . . . . . 1 .
*/&lt;/span&gt;
Bitboard maskB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; makeMaskB&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;sq &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        maskB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; i&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            maskB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            maskB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            maskB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            maskB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;For each square there is a maximum number of steps to take.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;/*&amp;lt;br/&amp;gt;Number of expanding steps (explosions) for a bishop&amp;lt;br/&amp;gt;*/&amp;lt;br/&amp;gt;const int repsB[64] =&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    6, 5, 4, 3, 3, 4, 5, 6,&amp;lt;br/&amp;gt;    5, 5, 4, 3, 3, 4, 5, 5,&amp;lt;br/&amp;gt;    4, 4, 4, 3, 3, 4, 4, 4,&amp;lt;br/&amp;gt;    3, 3, 3, 3, 3, 3, 3, 3,&amp;lt;br/&amp;gt;    3, 3, 3, 3, 3, 3, 3, 3,&amp;lt;br/&amp;gt;    4, 4, 4, 3, 3, 4, 4, 4,&amp;lt;br/&amp;gt;    5, 5, 4, 3, 3, 4, 5, 5,&amp;lt;br/&amp;gt;    6, 5, 4, 3, 3, 4, 5, 6,&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;/*
Number of expanding steps (explosions) for a bishop
*/
const int repsB[64] =
{
    6, 5, 4, 3, 3, 4, 5, 6,
    5, 5, 4, 3, 3, 4, 5, 5,
    4, 4, 4, 3, 3, 4, 4, 4,
    3, 3, 3, 3, 3, 3, 3, 3,
    3, 3, 3, 3, 3, 3, 3, 3,
    4, 4, 4, 3, 3, 4, 4, 4,
    5, 5, 4, 3, 3, 4, 5, 5,
    6, 5, 4, 3, 3, 4, 5, 6,
};
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;This does one step of the explosion.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/*&amp;lt;br/&amp;gt;= init               &amp;amp;gt;&amp;amp;gt;= 9               *= 0x5005          &amp;amp;amp;= mask            at |= bb&amp;lt;br/&amp;gt; . . . . . . . .     . . . . . . . .     . . . . . . . .    . . . . . . . .    . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .     . . . . . . . .     . . . . . . . .    . . . . . . . .    . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .     . . . . . . . .     . 1 1 . . 1 . .    . 1 . . . 1 . .    . 1 . . . 1 . .&amp;lt;br/&amp;gt; . . 1 . 1 . . .     . . . . . . . .     . . . . . . . .    . . . . . . . .    . . 1 . 1 . . .&amp;lt;br/&amp;gt; . . . s . . . .     . . . 1 . 1 . .     1 1 . . 1 . . .    . . . s . . . .    . . . s . . . .&amp;lt;br/&amp;gt; . . 1 . 1 . . .     . . . . . . . .     . . . . . . . .    . . . . . . . .    . . 1 . 1 . . .&amp;lt;br/&amp;gt; . . . . . . . .     . . . 1 . 1 . .     . 1 1 . . 1 . .    . 1 . . . 1 . .    . 1 . . . 1 . .&amp;lt;br/&amp;gt; . . . . . . . .     . . . . . . . .     . . . . . . . .    . . . . . . . .    . . . . . . . .&amp;lt;br/&amp;gt;*/&amp;lt;br/&amp;gt;Bitboard bishopAttacks( int sq, const Bitboard &amp;amp;amp;free )&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    Bitboard msk = maskB[sq];&amp;lt;br/&amp;gt;    Bitboard bb  = initB[sq];&amp;lt;br/&amp;gt;    Bitboard at  = bb;&amp;lt;br/&amp;gt;    bb &amp;amp;amp;= free;&amp;lt;br/&amp;gt;    switch ( repsB[sq] )&amp;lt;br/&amp;gt;    {&amp;lt;br/&amp;gt;      case 6:&amp;lt;br/&amp;gt;        bb &amp;amp;gt;&amp;amp;gt;= 9; bb *= 0x00050005; bb &amp;amp;amp;= msk; at |= bb; bb &amp;amp;amp;= free;&amp;lt;br/&amp;gt;      case 5:&amp;lt;br/&amp;gt;        bb &amp;amp;gt;&amp;amp;gt;= 9; bb *= 0x00050005; bb &amp;amp;amp;= msk; at |= bb; bb &amp;amp;amp;= free;&amp;lt;br/&amp;gt;      case 4:&amp;lt;br/&amp;gt;        bb &amp;amp;gt;&amp;amp;gt;= 9; bb *= 0x00050005; bb &amp;amp;amp;= msk; at |= bb; bb &amp;amp;amp;= free;&amp;lt;br/&amp;gt;      case 3:&amp;lt;br/&amp;gt;        bb &amp;amp;gt;&amp;amp;gt;= 9; bb *= 0x00050005; bb &amp;amp;amp;= msk; at |= bb; bb &amp;amp;amp;= free;&amp;lt;br/&amp;gt;        bb &amp;amp;gt;&amp;amp;gt;= 9; bb *= 0x00050005; bb &amp;amp;amp;= msk; at |= bb; bb &amp;amp;amp;= free;&amp;lt;br/&amp;gt;        bb &amp;amp;gt;&amp;amp;gt;= 9; bb *= 0x00050005; bb &amp;amp;amp;= msk; at |= bb;&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;    return at;&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/*
= init               &amp;gt;&amp;gt;= 9               *= 0x5005          &amp;amp;= mask            at |= bb
 . . . . . . . .     . . . . . . . .     . . . . . . . .    . . . . . . . .    . . . . . . . .
 . . . . . . . .     . . . . . . . .     . . . . . . . .    . . . . . . . .    . . . . . . . .
 . . . . . . . .     . . . . . . . .     . 1 1 . . 1 . .    . 1 . . . 1 . .    . 1 . . . 1 . .
 . . 1 . 1 . . .     . . . . . . . .     . . . . . . . .    . . . . . . . .    . . 1 . 1 . . .
 . . . s . . . .     . . . 1 . 1 . .     1 1 . . 1 . . .    . . . s . . . .    . . . s . . . .
 . . 1 . 1 . . .     . . . . . . . .     . . . . . . . .    . . . . . . . .    . . 1 . 1 . . .
 . . . . . . . .     . . . 1 . 1 . .     . 1 1 . . 1 . .    . 1 . . . 1 . .    . 1 . . . 1 . .
 . . . . . . . .     . . . . . . . .     . . . . . . . .    . . . . . . . .    . . . . . . . .
*/&lt;/span&gt;
Bitboard bishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq, &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; Bitboard &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    Bitboard msk &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; maskB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    Bitboard bb  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; initB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    Bitboard at  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;switch&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; repsB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
        bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x00050005&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; msk&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; at &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
        bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x00050005&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; msk&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; at &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
        bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x00050005&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; msk&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; at &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
        bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x00050005&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; msk&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; at &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x00050005&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; msk&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; at &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x00050005&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; msk&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; at &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; at&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;There are some possible optimisations when the repsB[] array is modified in the corners during&lt;br /&gt;
the game or search. Some numbers 7, 8, 9 combined with additional switch cases can work&lt;br /&gt;
as a shortcut for bishops in the corners behind pawns.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:20:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Rooks&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:20 --&gt;Rooks&lt;/h1&gt;
 For each square there is an ignition of the explosion.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/*&amp;lt;br/&amp;gt;First expanding step (explosion) for a rook&amp;lt;br/&amp;gt; . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .&amp;lt;br/&amp;gt; . . . 1 . . . .&amp;lt;br/&amp;gt; . . 1sq 1 . . .&amp;lt;br/&amp;gt; . . . 1 . . . .&amp;lt;br/&amp;gt; . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .&amp;lt;br/&amp;gt;*/&amp;lt;br/&amp;gt;Bitboard initR[64];&amp;lt;br/&amp;gt;void makeInitR()&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    for ( int sq = 0; sq &amp;amp;lt; 64; ++sq )&amp;lt;br/&amp;gt;    {&amp;lt;br/&amp;gt;        Bitboard bb = C64(1) &amp;amp;lt;&amp;amp;lt; sq;&amp;lt;br/&amp;gt;        initR[sq]  = (bb &amp;amp;gt;&amp;amp;gt; 8);&amp;lt;br/&amp;gt;        initR[sq] |= (bb &amp;amp;gt;&amp;amp;gt; 1) &amp;amp;amp; C64(0x7f7f7f7f7f7f7f7f);&amp;lt;br/&amp;gt;        initR[sq] |= (bb &amp;amp;lt;&amp;amp;lt; 1) &amp;amp;amp; C64(0xfefefefefefefefe);&amp;lt;br/&amp;gt;        initR[sq] |= (bb &amp;amp;lt;&amp;amp;lt; 8);&amp;lt;br/&amp;gt;        //logf &amp;amp;lt;&amp;amp;lt; &amp;amp;quot;initR[sq] &amp;amp;quot; &amp;amp;lt;&amp;amp;lt; sq &amp;amp;lt;&amp;amp;lt; endl;&amp;lt;br/&amp;gt;        //logf &amp;amp;lt;&amp;amp;lt; initR[sq].txt8lines() &amp;amp;lt;&amp;amp;lt; endl;&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/*
First expanding step (explosion) for a rook
 . . . . . . . .
 . . . . . . . .
 . . . . . . . .
 . . . 1 . . . .
 . . 1sq 1 . . .
 . . . 1 . . . .
 . . . . . . . .
 . . . . . . . .
*/&lt;/span&gt;
Bitboard initR&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; makeInitR&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;sq &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        Bitboard bb &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; sq&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        initR&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        initR&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x7f7f7f7f7f7f7f7f&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        initR&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0xfefefefefefefefe&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        initR&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;//logf &amp;lt;&amp;lt; &amp;quot;initR[sq] &amp;quot; &amp;lt;&amp;lt; sq &amp;lt;&amp;lt; endl;&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;//logf &amp;lt;&amp;lt; initR[sq].txt8lines() &amp;lt;&amp;lt; endl;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;The explosion is only allowed along the rays.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/*&amp;lt;br/&amp;gt;Mask for rook attack rays&amp;lt;br/&amp;gt; . . . 1 . . . .&amp;lt;br/&amp;gt; . . . 1 . . . .&amp;lt;br/&amp;gt; . . . 1 . . . .&amp;lt;br/&amp;gt; . . . 1 . . . .&amp;lt;br/&amp;gt; 1 1 1sq 1 1 1 1&amp;lt;br/&amp;gt; . . . 1 . . . .&amp;lt;br/&amp;gt; . . . 1 . . . .&amp;lt;br/&amp;gt; . . . 1 . . . .&amp;lt;br/&amp;gt;*/&amp;lt;br/&amp;gt;Bitboard maskR[64];&amp;lt;br/&amp;gt;void makeMaskR()&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    int sq;&amp;lt;br/&amp;gt;    for ( sq = 0; sq &amp;amp;lt; 64; ++sq )&amp;lt;br/&amp;gt;    {&amp;lt;br/&amp;gt;        maskR[sq] = 0;&amp;lt;br/&amp;gt;        int i;&amp;lt;br/&amp;gt;        for ( i = sq - 8; i &amp;amp;gt;= 0; i -= 8 )&amp;lt;br/&amp;gt;            maskR[sq] |= C64(1) &amp;amp;lt;&amp;amp;lt; i;&amp;lt;br/&amp;gt;        for ( i = sq - 1; i &amp;amp;gt;= 0 &amp;amp;amp;&amp;amp;amp; (i &amp;amp;amp; 7) != 7; &amp;amp;#45;-i )&amp;lt;br/&amp;gt;            maskR[sq] |= C64(1) &amp;amp;lt;&amp;amp;lt; i;&amp;lt;br/&amp;gt;        for ( i = sq + 1; i &amp;amp;lt; 64 &amp;amp;amp;&amp;amp;amp; (i &amp;amp;amp; 7) != 0; ++i )&amp;lt;br/&amp;gt;            maskR[sq] |= C64(1) &amp;amp;lt;&amp;amp;lt; i;&amp;lt;br/&amp;gt;        for ( i = sq + 8; i &amp;amp;lt; 64; i += 8 )&amp;lt;br/&amp;gt;            maskR[sq] |= C64(1) &amp;amp;lt;&amp;amp;lt; i;&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/*
Mask for rook attack rays
 . . . 1 . . . .
 . . . 1 . . . .
 . . . 1 . . . .
 . . . 1 . . . .
 1 1 1sq 1 1 1 1
 . . . 1 . . . .
 . . . 1 . . . .
 . . . 1 . . . .
*/&lt;/span&gt;
Bitboard maskR&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; makeMaskR&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;sq &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        maskR&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; i&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            maskR&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;--&lt;/span&gt;i &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            maskR&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;i &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            maskR&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            maskR&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;For each square there is a maximum number of steps to take. The number 8 is just a variant of the 7th step.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/**&amp;lt;br/&amp;gt;Number of expanding steps (explosions) for a rook&amp;lt;br/&amp;gt;*/&amp;lt;br/&amp;gt;const int repsR[64] =&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    7, 6, 6, 6, 6, 6, 6, 8,&amp;lt;br/&amp;gt;    7, 5, 5, 5, 5, 5, 5, 8,&amp;lt;br/&amp;gt;    7, 5, 4, 4, 4, 4, 5, 8,&amp;lt;br/&amp;gt;    7, 5, 4, 3, 3, 4, 5, 8,&amp;lt;br/&amp;gt;    7, 5, 4, 3, 3, 4, 5, 8,&amp;lt;br/&amp;gt;    7, 5, 4, 4, 4, 4, 5, 8,&amp;lt;br/&amp;gt;    7, 5, 5, 5, 5, 5, 5, 8,&amp;lt;br/&amp;gt;    7, 6, 6, 6, 6, 6, 6, 8,&amp;lt;br/&amp;gt;};&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/**
Number of expanding steps (explosions) for a rook
*/&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; repsR&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;,
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;This does one step of the explosion.&lt;br /&gt;
We have a lot of work to avoid overflows, wrap around the unwanted bits.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/*&amp;lt;br/&amp;gt;= init               &amp;amp;gt;&amp;amp;gt;= 8               *= 0x10281         &amp;amp;amp;= mask            at |= bb&amp;lt;br/&amp;gt; . . . . . . . .     . . . . . . . .     . . . . . . . .    . . . . . . . .    . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .     . . . . . . . .     . . . . . . . .    . . . . . . . .    . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .     . . . . . . . .     . . . 1 . . . .    . . . 1 . . . .    . . . 1 . . . .&amp;lt;br/&amp;gt; . . . 1 . . . .     . . . . . . . .     . . 1 . 1 . . .    . . . . . . . .    . . . 1 . . . .&amp;lt;br/&amp;gt; . . 1 s 1 . . .     . . . 1 . . . .     . 1 . 1 . 1 . .    . 1 . s . 1 . .    . 1 1 s 1 1 . .&amp;lt;br/&amp;gt; . . . 1 . . . .     . . 1 . 1 . . .     . . 1 . 1 . . .    . . . . . . . .    . . . 1 . . . .&amp;lt;br/&amp;gt; . . . . . . . .     . . . 1 . . . .     . . . 1 . . . .    . . . 1 . . . .    . . . 1 . . . .&amp;lt;br/&amp;gt; . . . . . . . .     . . . . . . . .     . . . . . . . .    . . . . . . . .    . . . . . . . .&amp;lt;br/&amp;gt;                                       and nasty overflows&amp;lt;br/&amp;gt;*/&amp;lt;br/&amp;gt;Bitboard rookAttacks( int sq, const Bitboard &amp;amp;amp;free )&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    Bitboard msk = maskR[sq];   // The mask kills scattered bits&amp;lt;br/&amp;gt;    Bitboard bb  = initR[sq];   // This drives the expansion/explosion. Here is the start.&amp;lt;br/&amp;gt;    Bitboard at  = bb;          // Collecting the resulting attacks&amp;lt;br/&amp;gt;    Bitboard cl  = at;          // Clears some intermediate overflows&amp;lt;br/&amp;gt;    Bitboard ov;                // A nasty overflow bit when 4 directions in first step are possible.&amp;lt;br/&amp;gt;                                // Not nessessary on left side of board for repsR[sq] = 4 or 5.&amp;lt;br/&amp;gt;                                // Invent new numbers?&amp;lt;br/&amp;gt;    // Perhaps it would be easier and faster to use rankR[][] on all ranks.&amp;lt;br/&amp;gt;    // But I like the &#039;explosive&#039; algorithm. And I want to show that it works.&amp;lt;br/&amp;gt;int repsLeft = 0; // will be overwritten&amp;lt;br/&amp;gt;    bb &amp;amp;amp;= free;&amp;lt;br/&amp;gt;    bb &amp;amp;gt;&amp;amp;gt;= 8;&amp;lt;br/&amp;gt;    switch ( repsR[sq] )&amp;lt;br/&amp;gt;    {&amp;lt;br/&amp;gt;      case 8:&amp;lt;br/&amp;gt;        bb *= 0x00010081;&amp;lt;br/&amp;gt;        repsLeft = 5;&amp;lt;br/&amp;gt;        break;&amp;lt;br/&amp;gt;      case 7:&amp;lt;br/&amp;gt;        bb *= 0x00010201;&amp;lt;br/&amp;gt;        repsLeft = 5;&amp;lt;br/&amp;gt;        break;&amp;lt;br/&amp;gt;      case 6:&amp;lt;br/&amp;gt;        bb *= 0x00010281;&amp;lt;br/&amp;gt;        bb &amp;amp;amp;= ~(C64(1) &amp;amp;lt;&amp;amp;lt; (sq - 6));      // Clears for b-squares a nasty overflow from south-west-first-step to h file&amp;lt;br/&amp;gt;        repsLeft = 5;&amp;lt;br/&amp;gt;        break;&amp;lt;br/&amp;gt;      case 5:&amp;lt;br/&amp;gt;        bb *= 0x00010281;&amp;lt;br/&amp;gt;        ov = (C64(1) &amp;amp;lt;&amp;amp;lt; (sq + 3));&amp;lt;br/&amp;gt;        bb |= (bb &amp;amp;amp; ov) &amp;amp;gt;&amp;amp;gt; 1;&amp;lt;br/&amp;gt;        bb &amp;amp;amp;= ~ov;&amp;lt;br/&amp;gt;        bb &amp;amp;amp;= ~(C64(1) &amp;amp;lt;&amp;amp;lt; (sq - 6));      // Clears for b-squares a nasty overflow from south-west-first-step to h file&amp;lt;br/&amp;gt;        repsLeft = 4;&amp;lt;br/&amp;gt;        break;&amp;lt;br/&amp;gt;      case 4:&amp;lt;br/&amp;gt;        bb *= 0x00010281;&amp;lt;br/&amp;gt;        ov = (C64(1) &amp;amp;lt;&amp;amp;lt; (sq + 3));&amp;lt;br/&amp;gt;        bb |= (bb &amp;amp;amp; ov) &amp;amp;gt;&amp;amp;gt; 1;&amp;lt;br/&amp;gt;        bb &amp;amp;amp;= ~ov;&amp;lt;br/&amp;gt;        repsLeft = 3;&amp;lt;br/&amp;gt;        break;&amp;lt;br/&amp;gt;      case 3:&amp;lt;br/&amp;gt;        bb *= 0x00010281;&amp;lt;br/&amp;gt;        ov = (C64(1) &amp;amp;lt;&amp;amp;lt; (sq + 3));&amp;lt;br/&amp;gt;        bb |= (bb &amp;amp;amp; ov) &amp;amp;gt;&amp;amp;gt; 1;&amp;lt;br/&amp;gt;        bb &amp;amp;amp;= ~ov;&amp;lt;br/&amp;gt;        repsLeft = 2;&amp;lt;br/&amp;gt;        break;&amp;lt;br/&amp;gt;      }&amp;lt;br/&amp;gt;      default:&amp;lt;br/&amp;gt;      /* reaching here is an error */&amp;lt;br/&amp;gt;      break;&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;    bb &amp;amp;amp;= msk; at |= bb;&amp;lt;br/&amp;gt;    while(repsLeft&amp;amp;#45;- &amp;amp;gt; 0)&amp;lt;br/&amp;gt;    {&amp;lt;br/&amp;gt;        bb &amp;amp;amp;= free; bb &amp;amp;amp;= ~cl;&amp;lt;br/&amp;gt;        cl = at;&amp;lt;br/&amp;gt;        bb &amp;amp;gt;&amp;amp;gt;= 8; bb *= 0x00010281; bb &amp;amp;amp;= msk; at |= bb;&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;    if ( sq &amp;amp;lt; 8 ) // or do this before the switch&amp;lt;br/&amp;gt;    {&amp;lt;br/&amp;gt;        int a1a8 = free ;&amp;lt;br/&amp;gt;        at |= rankR[sq][a1a8 &amp;amp;amp; 0x7e];&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;    return at;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/*
= init               &amp;gt;&amp;gt;= 8               *= 0x10281         &amp;amp;= mask            at |= bb
 . . . . . . . .     . . . . . . . .     . . . . . . . .    . . . . . . . .    . . . . . . . .
 . . . . . . . .     . . . . . . . .     . . . . . . . .    . . . . . . . .    . . . . . . . .
 . . . . . . . .     . . . . . . . .     . . . 1 . . . .    . . . 1 . . . .    . . . 1 . . . .
 . . . 1 . . . .     . . . . . . . .     . . 1 . 1 . . .    . . . . . . . .    . . . 1 . . . .
 . . 1 s 1 . . .     . . . 1 . . . .     . 1 . 1 . 1 . .    . 1 . s . 1 . .    . 1 1 s 1 1 . .
 . . . 1 . . . .     . . 1 . 1 . . .     . . 1 . 1 . . .    . . . . . . . .    . . . 1 . . . .
 . . . . . . . .     . . . 1 . . . .     . . . 1 . . . .    . . . 1 . . . .    . . . 1 . . . .
 . . . . . . . .     . . . . . . . .     . . . . . . . .    . . . . . . . .    . . . . . . . .
                                       and nasty overflows
*/&lt;/span&gt;
Bitboard rookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq, &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; Bitboard &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    Bitboard msk &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; maskR&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;co1&quot;&gt;// The mask kills scattered bits&lt;/span&gt;
    Bitboard bb  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; initR&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;co1&quot;&gt;// This drives the expansion/explosion. Here is the start.&lt;/span&gt;
    Bitboard at  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;          &lt;span class=&quot;co1&quot;&gt;// Collecting the resulting attacks&lt;/span&gt;
    Bitboard cl  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; at&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;          &lt;span class=&quot;co1&quot;&gt;// Clears some intermediate overflows&lt;/span&gt;
    Bitboard ov&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;                &lt;span class=&quot;co1&quot;&gt;// A nasty overflow bit when 4 directions in first step are possible.&lt;/span&gt;
                                &lt;span class=&quot;co1&quot;&gt;// Not nessessary on left side of board for repsR[sq] = 4 or 5.&lt;/span&gt;
                                &lt;span class=&quot;co1&quot;&gt;// Invent new numbers?&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// Perhaps it would be easier and faster to use rankR[][] on all ranks.&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// But I like the &#039;explosive&#039; algorithm. And I want to show that it works.&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; repsLeft &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// will be overwritten&lt;/span&gt;
    bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;switch&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; repsR&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
        bb &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x00010081&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        repsLeft &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
        bb &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x00010201&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        repsLeft &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
        bb &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x00010281&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; ~&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;      &lt;span class=&quot;co1&quot;&gt;// Clears for b-squares a nasty overflow from south-west-first-step to h file&lt;/span&gt;
        repsLeft &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
        bb &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x00010281&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        ov &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        bb &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; ov&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; ~ov&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; ~&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;      &lt;span class=&quot;co1&quot;&gt;// Clears for b-squares a nasty overflow from south-west-first-step to h file&lt;/span&gt;
        repsLeft &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
        bb &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x00010281&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        ov &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        bb &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; ov&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; ~ov&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        repsLeft &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
        bb &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x00010281&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        ov &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        bb &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; ov&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; ~ov&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        repsLeft &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;coMULTI&quot;&gt;/* reaching here is an error */&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; msk&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; at &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;repsLeft&lt;span class=&quot;sy2&quot;&gt;--&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; ~cl&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        cl &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; at&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x00010281&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; msk&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; at &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// or do this before the switch&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; a1a8 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        at &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; rankR&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;a1a8 &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x7e&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; at&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;There are some possible optimisations when the repsR[] array is modified in the corners during&lt;br /&gt;
the game or search. Some numbers 9, 10, 11 combined with additional switch cases can work&lt;br /&gt;
as a shortcut for rooks in the corners behind pawns.&lt;br /&gt;
&lt;br /&gt;
In the function rookAttacks() rankR is the well know simple lookup table from other bitboard algorithms.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:9:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;int rankR[8][128];&amp;lt;br/&amp;gt;void makeRankR()&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    for ( int sq = 0; sq &amp;amp;lt; 8; ++sq )&amp;lt;br/&amp;gt;    {&amp;lt;br/&amp;gt;        for ( int i = 0; i &amp;amp;lt; 128; i += 2 )&amp;lt;br/&amp;gt;        {&amp;lt;br/&amp;gt;            int rr = 0;&amp;lt;br/&amp;gt;            int j;&amp;lt;br/&amp;gt;            for ( j = sq - 1; j &amp;amp;gt;= 0; &amp;amp;#45;-j )&amp;lt;br/&amp;gt;            {&amp;lt;br/&amp;gt;                rr |= (1 &amp;amp;lt;&amp;amp;lt; j);&amp;lt;br/&amp;gt;                if ( !(i &amp;amp;amp; (1 &amp;amp;lt;&amp;amp;lt; j)) )  // the 1 bits are the free squares&amp;lt;br/&amp;gt;                    break;&amp;lt;br/&amp;gt;            }&amp;lt;br/&amp;gt;            for ( j = sq + 1; j &amp;amp;lt; 8; ++j )&amp;lt;br/&amp;gt;            {&amp;lt;br/&amp;gt;                rr |= (1 &amp;amp;lt;&amp;amp;lt; j);&amp;lt;br/&amp;gt;                if ( !(i &amp;amp;amp; (1 &amp;amp;lt;&amp;amp;lt; j)) )  // the 1 bits are the free squares&amp;lt;br/&amp;gt;                    break;&amp;lt;br/&amp;gt;            }&amp;lt;br/&amp;gt;            rankR[sq][i  ] = rr;&amp;lt;br/&amp;gt;            rankR[sq][i+1] = rr;&amp;lt;br/&amp;gt;        }&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; rankR&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;128&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; makeRankR&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;sq &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;128&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
            &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; rr &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; j&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; j &lt;span class=&quot;sy1&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;--&lt;/span&gt;j &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                rr &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; j&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; j&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// the 1 bits are the free squares&lt;/span&gt;
                    &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; j &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;j &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                rr &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; j&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; j&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// the 1 bits are the free squares&lt;/span&gt;
                    &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
            rankR&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i  &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; rr&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            rankR&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; rr&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:9 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:22:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Results&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:22 --&gt;Results&lt;/h1&gt;
 The results can be masked or combined just like in other attack bitboards.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:10:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/*&amp;lt;br/&amp;gt;Get a bitboard with all positions set to 1 which can be attacked&amp;lt;br/&amp;gt;from a rook or queen on the square.&amp;lt;br/&amp;gt;*/&amp;lt;br/&amp;gt;Bitboard Board::orthogonal_attacks( byte square ) const&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    Bitboard free = ~(wpieces_ | bpieces_); // from the board representation in the board class&amp;lt;br/&amp;gt;    Bitboard result = rookAttacks( square, free );&amp;lt;br/&amp;gt;    return result;&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;/*&amp;lt;br/&amp;gt;Get a bitboard with all positions set to 1 which can be attacked&amp;lt;br/&amp;gt;from a bishop or queen on the square.&amp;lt;br/&amp;gt;*/&amp;lt;br/&amp;gt;Bitboard Board::diagonal_attacks( byte square ) const&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    Bitboard free = ~(wpieces_ | bpieces_); // from the board representation in the board class&amp;lt;br/&amp;gt;    Bitboard result = bishopAttacks( square, free );&amp;lt;br/&amp;gt;    return result;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/*
Get a bitboard with all positions set to 1 which can be attacked
from a rook or queen on the square.
*/&lt;/span&gt;
Bitboard Board&lt;span class=&quot;sy4&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;me2&quot;&gt;orthogonal_attacks&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; byte square &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    Bitboard &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; ~&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;wpieces_ &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; bpieces_&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// from the board representation in the board class&lt;/span&gt;
    Bitboard result &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; rookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; square, &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; result&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;coMULTI&quot;&gt;/*
Get a bitboard with all positions set to 1 which can be attacked
from a bishop or queen on the square.
*/&lt;/span&gt;
Bitboard Board&lt;span class=&quot;sy4&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;me2&quot;&gt;diagonal_attacks&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; byte square &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    Bitboard &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; ~&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;wpieces_ &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; bpieces_&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// from the board representation in the board class&lt;/span&gt;
    Bitboard result &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; square, &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; result&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:10 --&gt;Another usage requires masks&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:11:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;const Bitboard dirMaskRight[8] =&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    // 0, line_h, line_gh, line_fh, line_eh, line_dh, line_ch, line_bh,&amp;lt;br/&amp;gt;    0, C64(0x0101010101010101), C64(0x0303030303030303), C64(0x0707070707070707), C64(0x0f0f0f0f0f0f0f0f),&amp;lt;br/&amp;gt;    C64(0x1f1f1f1f1f1f1f1f), C64(0x3f3f3f3f3f3f3f3f), C64(0x7f7f7f7f7f7f7f7f)&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;const Bitboard dirMaskLeft[8] =&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    // line_ag, line_af, line_ae, line_ad, line_ac, line_ab, line_a, 0,&amp;lt;br/&amp;gt;    C64(0xfefefefefefefefe), C64(0xfcfcfcfcfcfcfcfc), C64(0xf8f8f8f8f8f8f8f8), C64(0xf0f0f0f0f0f0f0f0),&amp;lt;br/&amp;gt;    C64(0xe0e0e0e0e0e0e0e0), C64(0xc0c0c0c0c0c0c0c0), C64(0x8080808080808080), 0&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;const Bitboard dirMaskUp[8] =&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    // row_28, row_38, row_48, row_58, row_68, row_78, row_8, 0,&amp;lt;br/&amp;gt;    C64(0xffffffffffffff00), C64(0xffffffffffff0000), C64(0xffffffffff000000), C64(0xffffffff00000000),&amp;lt;br/&amp;gt;    C64(0xffffff0000000000), C64(0xffff000000000000), C64(0xff00000000000000), 0&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;const Bitboard dirMaskDown[8] =&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    // 0, row_1, row_12, row_13, row_14, row_15, row_16, row_17,&amp;lt;br/&amp;gt;    0, C64(0x00000000000000ff), C64(0x000000000000ffff), C64(0x0000000000ffffff), C64(0x00000000ffffffff),&amp;lt;br/&amp;gt;    C64(0x000000ffffffffff), C64(0x0000ffffffffffff), C64(0x00ffffffffffffff)&amp;lt;br/&amp;gt;};&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; Bitboard dirMaskRight&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// 0, line_h, line_gh, line_fh, line_eh, line_dh, line_ch, line_bh,&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0101010101010101&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0303030303030303&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0707070707070707&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0f0f0f0f0f0f0f0f&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;,
    C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x1f1f1f1f1f1f1f1f&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x3f3f3f3f3f3f3f3f&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x7f7f7f7f7f7f7f7f&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; Bitboard dirMaskLeft&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// line_ag, line_af, line_ae, line_ad, line_ac, line_ab, line_a, 0,&lt;/span&gt;
    C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0xfefefefefefefefe&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0xfcfcfcfcfcfcfcfc&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0xf8f8f8f8f8f8f8f8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0xf0f0f0f0f0f0f0f0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;,
    C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0xe0e0e0e0e0e0e0e0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0xc0c0c0c0c0c0c0c0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x8080808080808080&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; Bitboard dirMaskUp&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// row_28, row_38, row_48, row_58, row_68, row_78, row_8, 0,&lt;/span&gt;
    C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0xffffffffffffff00&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0xffffffffffff0000&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0xffffffffff000000&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0xffffffff00000000&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;,
    C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0xffffff0000000000&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0xffff000000000000&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0xff00000000000000&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; Bitboard dirMaskDown&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// 0, row_1, row_12, row_13, row_14, row_15, row_16, row_17,&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x00000000000000ff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x000000000000ffff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0000000000ffffff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x00000000ffffffff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;,
    C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x000000ffffffffff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0000ffffffffffff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x00ffffffffffffff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:11 --&gt;to generate attacks in one direction.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:12:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/*&amp;lt;br/&amp;gt;Get a bitboard with all positions set to 1 which can be attacked&amp;lt;br/&amp;gt;from a bishop, rook or queen on the square moving in the direction.&amp;lt;br/&amp;gt;*/&amp;lt;br/&amp;gt;Bitboard Board::direction_attacks( byte square, byte dir ) const&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    Bitboard result;&amp;lt;br/&amp;gt;    Bitboard free = ~(wpieces_ | bpieces_); // from the board representation in the board class&amp;lt;br/&amp;gt;    // 4 3 2&amp;lt;br/&amp;gt;    // 5 0 1&amp;lt;br/&amp;gt;    // 6 7 8&amp;lt;br/&amp;gt;    switch ( dir )&amp;lt;br/&amp;gt;    {&amp;lt;br/&amp;gt;      case 1:&amp;lt;br/&amp;gt;        result = rookAttacks( square, free );&amp;lt;br/&amp;gt;        result &amp;amp;amp;= dirMaskRight[square &amp;amp;amp; 7];&amp;lt;br/&amp;gt;        break;&amp;lt;br/&amp;gt;      case 5:&amp;lt;br/&amp;gt;        result = rookAttacks( square, free );&amp;lt;br/&amp;gt;        result &amp;amp;amp;= dirMaskLeft[square &amp;amp;amp; 7];&amp;lt;br/&amp;gt;        break;&amp;lt;br/&amp;gt;      case 7:&amp;lt;br/&amp;gt;        result = rookAttacks( square, free );&amp;lt;br/&amp;gt;        result &amp;amp;amp;= dirMaskDown[square &amp;amp;gt;&amp;amp;gt; 3];&amp;lt;br/&amp;gt;        break;&amp;lt;br/&amp;gt;      case 3:&amp;lt;br/&amp;gt;        result = rookAttacks( square, free );&amp;lt;br/&amp;gt;        result &amp;amp;amp;= dirMaskUp[square &amp;amp;gt;&amp;amp;gt; 3];&amp;lt;br/&amp;gt;        break;&amp;lt;br/&amp;gt;      case 8:&amp;lt;br/&amp;gt;        result = bishopAttacks( square, free );&amp;lt;br/&amp;gt;        result &amp;amp;amp;= dirMaskRight[square &amp;amp;amp; 7];&amp;lt;br/&amp;gt;        result &amp;amp;amp;= dirMaskDown[square &amp;amp;gt;&amp;amp;gt; 3];&amp;lt;br/&amp;gt;        break;&amp;lt;br/&amp;gt;      case 4:&amp;lt;br/&amp;gt;        result = bishopAttacks( square, free );&amp;lt;br/&amp;gt;        result &amp;amp;amp;= dirMaskLeft[square &amp;amp;amp; 7];&amp;lt;br/&amp;gt;        result &amp;amp;amp;= dirMaskUp[square &amp;amp;gt;&amp;amp;gt; 3];&amp;lt;br/&amp;gt;        break;&amp;lt;br/&amp;gt;      case 2:&amp;lt;br/&amp;gt;        result = bishopAttacks( square, free );&amp;lt;br/&amp;gt;        result &amp;amp;amp;= dirMaskRight[square &amp;amp;amp; 7];&amp;lt;br/&amp;gt;        result &amp;amp;amp;= dirMaskUp[square &amp;amp;gt;&amp;amp;gt; 3];&amp;lt;br/&amp;gt;        break;&amp;lt;br/&amp;gt;      case 6:&amp;lt;br/&amp;gt;        result = bishopAttacks( square, free );&amp;lt;br/&amp;gt;        result &amp;amp;amp;= dirMaskLeft[square &amp;amp;amp; 7];&amp;lt;br/&amp;gt;        result &amp;amp;amp;= dirMaskDown[square &amp;amp;gt;&amp;amp;gt; 3];&amp;lt;br/&amp;gt;        break;&amp;lt;br/&amp;gt;      default:&amp;lt;br/&amp;gt;        result = 0;&amp;lt;br/&amp;gt;        break;&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;    return result;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/*
Get a bitboard with all positions set to 1 which can be attacked
from a bishop, rook or queen on the square moving in the direction.
*/&lt;/span&gt;
Bitboard Board&lt;span class=&quot;sy4&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;me2&quot;&gt;direction_attacks&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; byte square, byte dir &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    Bitboard result&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    Bitboard &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; ~&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;wpieces_ &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; bpieces_&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// from the board representation in the board class&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// 4 3 2&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// 5 0 1&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// 6 7 8&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;switch&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; dir &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
        result &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; rookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; square, &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        result &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; dirMaskRight&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;square &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
        result &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; rookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; square, &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        result &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; dirMaskLeft&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;square &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
        result &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; rookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; square, &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        result &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; dirMaskDown&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;square &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
        result &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; rookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; square, &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        result &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; dirMaskUp&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;square &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
        result &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; square, &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        result &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; dirMaskRight&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;square &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        result &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; dirMaskDown&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;square &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
        result &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; square, &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        result &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; dirMaskLeft&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;square &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        result &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; dirMaskUp&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;square &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
        result &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; square, &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        result &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; dirMaskRight&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;square &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        result &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; dirMaskUp&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;square &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
        result &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; square, &lt;span class=&quot;kw3&quot;&gt;free&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        result &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; dirMaskLeft&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;square &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        result &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; dirMaskDown&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;square &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
        result &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; result&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:12 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:24:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:24 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:84:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;t=4523&amp;amp;start=80&quot; rel=&quot;nofollow&quot;&gt;Re: Compact Bitboard Attacks&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Harald%20L%C3%BC%C3%9Fen&quot;&gt;Harald Lüßen&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, September 13, 2006&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:84 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:26:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:26 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:013:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Exploding Bitboards&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Exploding Bitboards&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Exploding_Bitboards includeBody-Exploding%20Bitboards includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Elephant&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Elephant&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 19, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Exploding+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Exploding Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 9, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Harald+L%C3%BC%C3%9Fen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Harald Lüßen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 20, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sherwin+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sherwin Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 20, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:013 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>First Rank Attacks</title>
      <link>https://chessprogramming.wikispaces.com/First+Rank+Attacks</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/First+Rank+Attacks</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/First+Rank+Attacks</comments>
      <pubDate>Sat, 28 Aug 2010 21:33:55 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:16:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:16 --&gt;&lt;!-- ws:start:WikiTextTocRule:17: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Introduction to Occupancy Lookup&quot;&gt;Introduction to Occupancy Lookup&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:17 --&gt;&lt;!-- ws:start:WikiTextTocRule:18: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Introduction to Occupancy Lookup-One Byte Only&quot;&gt;One Byte Only&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:18 --&gt;&lt;!-- ws:start:WikiTextTocRule:19: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Introduction to Occupancy Lookup-Overdetermined?&quot;&gt;Overdetermined?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:19 --&gt;&lt;!-- ws:start:WikiTextTocRule:20: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Introduction to Occupancy Lookup-The Outer Squares&quot;&gt;The Outer Squares&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:20 --&gt;&lt;!-- ws:start:WikiTextTocRule:21: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Attacks on all Ranks&quot;&gt;Attacks on all Ranks&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:21 --&gt;&lt;!-- ws:start:WikiTextTocRule:22: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:22 --&gt;&lt;!-- ws:start:WikiTextTocRule:23: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:23 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Board%20Representation&quot;&gt;Board Representation&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Bitboards&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Sliding Piece Attacks&lt;/a&gt; * First Rank Attacks&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
The technique of &lt;a class=&quot;wiki_link&quot; href=&quot;/Occupancy&quot;&gt;occupancy&lt;/a&gt; lookups is base for &lt;a class=&quot;wiki_link&quot; href=&quot;/Rotated%20Bitboards&quot;&gt;rotated-&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Kindergarten%20Bitboards&quot;&gt;kindergarten&lt;/a&gt; -bitboards.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:4:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Introduction to Occupancy Lookup&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:4 --&gt;Introduction to Occupancy Lookup&lt;/h1&gt;
 The first &lt;a class=&quot;wiki_link&quot; href=&quot;/Ranks&quot;&gt;rank&lt;/a&gt; is the ideal line to introduce occupancy lookups.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:6:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Introduction to Occupancy Lookup-One Byte Only&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:6 --&gt;One Byte Only&lt;/h2&gt;
 Assume we (temporary) reduce the chess-board to one &lt;a class=&quot;wiki_link&quot; href=&quot;/Ranks&quot;&gt;rank&lt;/a&gt;. Occupancy bitboard is one &lt;a class=&quot;wiki_link&quot; href=&quot;/Byte&quot;&gt;byte&lt;/a&gt; with up to 256 states. A &lt;a class=&quot;wiki_link&quot; href=&quot;/Rook&quot;&gt;rook&lt;/a&gt; attack-set from one of the eight &lt;a class=&quot;wiki_link&quot; href=&quot;/Squares&quot;&gt;squares&lt;/a&gt; (&lt;a class=&quot;wiki_link&quot; href=&quot;/Files&quot;&gt;file&lt;/a&gt;) on this single rank is also only one byte. Thus we can construct an &lt;a class=&quot;wiki_link&quot; href=&quot;/Array&quot;&gt;array&lt;/a&gt; of bytes[256][8], indexed by all 256 occupancies and 8 files, to lookup the pre-calculated rank-attack bytes.&lt;br /&gt;
&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:44:&amp;lt;img src=&amp;quot;/file/view/firstRank.JPG/47379251/firstRank.JPG&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;img src=&quot;/file/view/firstRank.JPG/47379251/firstRank.JPG&quot; alt=&quot;firstRank.JPG&quot; title=&quot;firstRank.JPG&quot; /&gt;&lt;!-- ws:end:WikiTextLocalImageRule:44 --&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;Occupancy of the first rank = 01001010B&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:45:&amp;lt;img src=&amp;quot;/file/view/firstRankA.JPG/47379293/firstRankA.JPG&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;img src=&quot;/file/view/firstRankA.JPG/47379293/firstRankA.JPG&quot; alt=&quot;firstRankA.JPG&quot; title=&quot;firstRankA.JPG&quot; /&gt;&lt;!-- ws:end:WikiTextLocalImageRule:45 --&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;Rank-attacks ::= f (e-file, Occupancy) = 01110110B&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;BYTE arrFirstRankAttacks256x8[256][8]; // 2048 Bytes = 2KByte&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;firstRankAttack = arrFirstRankAttacks256x8[rankOccupancy][squareOnRank];&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;BYTE arrFirstRankAttacks256x8&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;256&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 2048 Bytes = 2KByte&lt;/span&gt;
&amp;nbsp;
firstRankAttack &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; arrFirstRankAttacks256x8&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;rankOccupancy&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;squareOnRank&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:8:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Introduction to Occupancy Lookup-Overdetermined?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:8 --&gt;Overdetermined?&lt;/h2&gt;
 In fact both indices seem somehow overdetermined, since the rook is already member of occupancy. But rather than to make the redundant rook-bit disappear to use only the remaining seven occupancy bits, with half table size - which is not that cheap and simple either - we better decide to uncouple this items to eventually pass (virtual) rook squares, not actually member of occupancy. We better rely on another property to reduce the table fourfold.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:24:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@TheOuterSquares&amp;quot; title=&amp;quot;Anchor: TheOuterSquares&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;TheOuterSquares&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:24 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:10:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Introduction to Occupancy Lookup-The Outer Squares&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:10 --&gt;The Outer Squares&lt;/h2&gt;
 If we think about to the occupancy lookup, we may recognize that the outer squares don&#039;t matter. There are no more squares behind. The outer squares are either attacked or not - independent from their occupancy state. We can use the &lt;strong&gt;six inner bits&lt;/strong&gt; only as lookup-index with two additional cheap instructions.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;BYTE arrFirstRankAttacks64x8[64][8]; // 512 Bytes = 1/2KByte&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;firstRankAttack = arrFirstRankAttacks64x8[(rankOccupancy &amp;amp;gt;&amp;amp;gt; 1)&amp;amp;amp; 63][squareOnRank];&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;BYTE arrFirstRankAttacks64x8&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 512 Bytes = 1/2KByte&lt;/span&gt;
&amp;nbsp;
firstRankAttack &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; arrFirstRankAttacks64x8&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;rankOccupancy &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;63&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;squareOnRank&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:25:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@AttacksOnAllRanks&amp;quot; title=&amp;quot;Anchor: AttacksOnAllRanks&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;AttacksOnAllRanks&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:25 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:12:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Attacks on all Ranks&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:12 --&gt;Attacks on all Ranks&lt;/h1&gt;
 Since it is simple to shift ranks up and down, the general rank attack getter is already handy.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;BYTE arrFirstRankAttacks64x8[64*8]; // 512 Bytes = 1/2KByte&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 rankAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   unsigned int file = sq &amp;amp;amp;  7;&amp;lt;br/&amp;gt;   unsigned int rkx8 = sq &amp;amp;amp; 56; // rank * 8&amp;lt;br/&amp;gt;   occ = (occ &amp;amp;gt;&amp;amp;gt; rkx8) &amp;amp;amp; 2*63;&amp;lt;br/&amp;gt;   U64 attacks = arrFirstRankAttacks64x8[4*occ + file];&amp;lt;br/&amp;gt;   return attacks &amp;amp;lt;&amp;amp;lt; rkx8;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;BYTE arrFirstRankAttacks64x8&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 512 Bytes = 1/2KByte&lt;/span&gt;
&amp;nbsp;
U64 rankAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; file &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; rkx8 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;56&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// rank * 8&lt;/span&gt;
   occ &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; rkx8&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;63&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   U64 attacks &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; arrFirstRankAttacks64x8&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;occ &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; file&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; attacks &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; rkx8&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;The &lt;a class=&quot;wiki_link&quot; href=&quot;/Array&quot;&gt;array&lt;/a&gt; is defined one-dimensional, and has to indexed by 8*occ + file. The reason was playing the optimization game and to safe the right shift one, but to scale by 4 instead of 8, which is done by the address calculation unit anyway.&lt;br /&gt;
&lt;br /&gt;
This routine may complete the &lt;a class=&quot;wiki_link&quot; href=&quot;/Hyperbola%20Quintessence&quot;&gt;Hyperbola Quintessence&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:14:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc5&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:14 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:03:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;First Rank Attacks&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;First Rank Attacks&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-First_Rank_Attacks includeBody-First%20Rank%20Attacks includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Amoeba&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Amoeba&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 19, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Amundsen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Amundsen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Android-Chess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Android-Chess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 2, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Best+Magics+so+far&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Best Magics so far&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 13, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BMI2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BMI2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Brainless&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Brainless&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Byte&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Byte&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 5, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Chesley&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Chesley&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 25, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Classical+Approach&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Classical Approach&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 28, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Congruent+Modulo+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Congruent Modulo Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 26, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dumb&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dumb&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 10, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dumb7Fill&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dumb7Fill&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Efficient+Generation+of+Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Efficient Generation of Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/First+Rank+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;First Rank Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 28, 2010&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Fridel+Fainshtein&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Fridel Fainshtein&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 8, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hiding+the+Implementation&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hiding the Implementation&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 3, 2011&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hyperbola+Quintessence&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hyperbola Quintessence&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kindergarten+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kindergarten Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 1, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kurt&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kurt&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 20, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Magic+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Magic Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 13, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Occupancy+of+any+Line&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Occupancy of any Line&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 16, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Prophet&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Prophet&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 30, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rabbit&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rabbit&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 5, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Roberto+Waldteufel&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Roberto Waldteufel&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rotated+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rotated Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sayuri&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sayuri&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 1, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/The+switch+Approach&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;The switch Approach&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 5, 2010&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Vajolet&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Vajolet&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Wing&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Wing&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 26, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Winglet&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Winglet&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 26, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/X-ray+Attacks+%28Bitboards%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;X-ray Attacks (Bitboards)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 31, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Yaakov+HaCohen-Kerner&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Yaakov HaCohen-Kerner&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 23, 2014&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:03 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Half-open file</title>
      <link>https://chessprogramming.wikispaces.com/Half-open+file</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Half-open+file</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Half-open+file</comments>
      <pubDate>Tue, 11 Mar 2014 19:14:27 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:7:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:7 --&gt;&lt;!-- ws:start:WikiTextTocRule:8: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:8 --&gt;&lt;!-- ws:start:WikiTextTocRule:9: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:9 --&gt;&lt;!-- ws:start:WikiTextTocRule:10: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:10 --&gt;&lt;!-- ws:start:WikiTextTocRule:11: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:11 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Dictionary&quot;&gt;Dictionary&lt;/a&gt; * Half-open file&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Half-open file&lt;/strong&gt; or semi-open file, is a &lt;a class=&quot;wiki_link&quot; href=&quot;/Files&quot;&gt;file&lt;/a&gt; on which we do not have a &lt;a class=&quot;wiki_link&quot; href=&quot;/Pawn&quot;&gt;pawn&lt;/a&gt;, but the opponent has at least one. It can be used to increase the vertical &lt;a class=&quot;wiki_link&quot; href=&quot;/Mobility&quot;&gt;mobility&lt;/a&gt; of the major &lt;a class=&quot;wiki_link&quot; href=&quot;/Pieces&quot;&gt;pieces&lt;/a&gt;, to attack &lt;a class=&quot;wiki_link&quot; href=&quot;/Weak%20Pawns&quot;&gt;weak pawns&lt;/a&gt; and to pressure enemy position or to create an &lt;a class=&quot;wiki_link&quot; href=&quot;/Outposts&quot;&gt;outpost&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:1:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:1 --&gt;See also&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Open%20file&quot;&gt;Open file&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Pawns%20and%20Files%20%28Bitboards%29&quot;&gt;Pawns and Files (Bitboards)&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:3:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:3 --&gt;External Links&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Half-open_file&quot; rel=&quot;nofollow&quot;&gt;Half-open file from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:5:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:5 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:00:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Half-open file&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Half-open file&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Half-open_file includeBody-Half-open%20file includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Backward+Pawn&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Backward Pawn&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 5, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Battery&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Battery&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 29, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Candidate+Passed+Pawn&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Candidate Passed Pawn&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 11, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dictionary&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dictionary&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Exacto&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Exacto&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 3, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Files&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Files&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 22, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Half-open+file&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Half-open file&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 11, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hanging+pawns&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hanging pawns&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 5, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Isolated+Pawn&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Isolated Pawn&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 18, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Minority+Attack&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Minority Attack&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 6, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Open+file&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Open file&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 15, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Open+Pawns+%28Bitboards%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Open Pawns (Bitboards)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Outposts&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Outposts&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pawn+Fills&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pawn Fills&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 18, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pawns+and+Files+%28Bitboards%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pawns and Files (Bitboards)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 16, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rook+on+Open+File&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rook on Open File&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:00 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Dictionary&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Hashing Dictionaries</title>
      <link>https://chessprogramming.wikispaces.com/Hashing+Dictionaries</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Hashing+Dictionaries</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Hashing+Dictionaries</comments>
      <pubDate>Sat, 01 Mar 2014 13:31:56 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:28:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:28 --&gt;&lt;!-- ws:start:WikiTextTocRule:29: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Avoiding Rotated Bitboards with Direct Lookup&quot;&gt;Avoiding Rotated Bitboards with Direct Lookup&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:29 --&gt;&lt;!-- ws:start:WikiTextTocRule:30: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Avoiding Rotated Bitboards with Direct Lookup-Abstract&quot;&gt;Abstract&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:30 --&gt;&lt;!-- ws:start:WikiTextTocRule:31: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:31 --&gt;&lt;!-- ws:start:WikiTextTocRule:32: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#External Links-Class Libraries&quot;&gt;Class Libraries&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:32 --&gt;&lt;!-- ws:start:WikiTextTocRule:33: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:33 --&gt;&lt;!-- ws:start:WikiTextTocRule:34: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:34 --&gt;&lt;!-- ws:start:WikiTextTocRule:35: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:35 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Board%20Representation&quot;&gt;Board Representation&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Bitboards&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Sliding Piece Attacks&lt;/a&gt; * Hashing Dictionaries&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
This approach using associate arrays or &lt;a class=&quot;wiki_link&quot; href=&quot;/Hash%20Table&quot;&gt;hash tables&lt;/a&gt; was introduced in the &lt;a class=&quot;wiki_link&quot; href=&quot;/ICGA%20Journal&quot;&gt;ICGA Journal&lt;/a&gt; (June 2007) by &lt;a class=&quot;wiki_link&quot; href=&quot;/Sam%20Tannous&quot;&gt;Sam Tannous&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:8:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Sam%20Tannous&amp;quot;&amp;gt;Sam Tannous&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;2007&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://arxiv.org/abs/0704.3773&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Avoiding Rotated Bitboards with Direct Lookup&amp;lt;/a&amp;gt;&amp;lt;/em&amp;gt;. &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/ICGA%20Journal#30_2&amp;quot;&amp;gt;ICGA Journal, Vol. 30, No. 2&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://arxiv.org/PS_cache/arxiv/pdf/0704/0704.3773v2.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;pdf&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:8 --&gt;. Like other &lt;a class=&quot;wiki_link&quot; href=&quot;/Occupancy&quot;&gt;occupancy&lt;/a&gt; lookup approaches it works line-wise for ranks, files, diagonals and anti-diagonals. It uses hash arrays from an interpreted, high level language, &lt;a class=&quot;wiki_link&quot; href=&quot;/Python&quot;&gt;Python&lt;/a&gt;:&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;tt&gt;Many high level programming languages (notably &lt;a class=&quot;wiki_link&quot; href=&quot;/Python&quot;&gt;Python&lt;/a&gt; (van Rossum, 1993)) have useful predefined data structures (e.g. associative arrays) which are dynamically resizable hash tables that resolve collisions by probing techniques. The basic lookup function used in Python is based on Algorithm D: Open Addressing with Double Hashing from Section 6.4 in Knuth&lt;/tt&gt; &lt;!-- ws:start:WikiTextRefRule:14:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Donald%20Knuth&amp;quot;&amp;gt;Donald Knuth&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;1998&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;The Art of Computer Programming&amp;lt;/em&amp;gt;. Volume 3, Sorting and Searching. Addison Wesley. ISBN 0201896850&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:14 --&gt;.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:16:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Avoiding Rotated Bitboards with Direct Lookup&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:16 --&gt;Avoiding Rotated Bitboards with Direct Lookup&lt;/h1&gt;
 Sam Tannous compared this approach to a &lt;a class=&quot;wiki_link&quot; href=&quot;/Rotated%20Bitboards&quot;&gt;Rotated Bitboards&lt;/a&gt; implementation in Python and found direct lookup favorable for move generation. In languages like &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;, targeting 64-bit cpus like &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt;, or even in &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt;, it is likely another story if one compares &lt;em&gt;Open Addressing with Double Hashing&lt;/em&gt; with &lt;a class=&quot;wiki_link&quot; href=&quot;/Rotated%20Bitboards&quot;&gt;rotated&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Hash%20Table#PerfectHashing&quot;&gt;perfect hashing&lt;/a&gt; techniques like &lt;a class=&quot;wiki_link&quot; href=&quot;/Kindergarten%20Bitboards&quot;&gt;Kindergarten&lt;/a&gt; or even &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards&quot;&gt;Magic Bitboards&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:18:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Avoiding Rotated Bitboards with Direct Lookup-Abstract&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:18 --&gt;Abstract&lt;/h2&gt;
Quoted from &lt;em&gt;Avoiding Rotated Bitboards with Direct Lookup&lt;/em&gt;: &lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;tt&gt;This paper describes an approach for obtaining direct access to the attacked squares of sliding pieces without resorting to rotated bitboards. The technique involves creating four &lt;a class=&quot;wiki_link&quot; href=&quot;/Hash%20Table&quot;&gt;hash tables&lt;/a&gt; using the built in hash arrays from an interpreted, high level language. The rank, file, and diagonal occupancy are first isolated by masking the desired portion of the board. The attacked squares are then directly retrieved from the hash tables. Maintaining incrementally updated rotated bitboards becomes unnecessary as does all the updating, mapping and shifting required to access the attacked squares. Finally, rotated bitboard move generation speed is compared with that of the direct hash table lookup method.&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:20:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:20 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.employees.org/%7Estannous/&quot; rel=&quot;nofollow&quot;&gt;Sam Tannous homepage&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:22:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc3&quot;&gt;&lt;a name=&quot;External Links-Class Libraries&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:22 --&gt;Class Libraries&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://docs.python.org/lib/module-UserDict.html&quot; rel=&quot;nofollow&quot;&gt;UserDict - Class wrapper for dictionary objects&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://docs.python.org/lib/lib.html&quot; rel=&quot;nofollow&quot;&gt;Python Library Reference&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://docs.python.org/lib/defaultdict-objects.html&quot; rel=&quot;nofollow&quot;&gt;defaultdict objects&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://docs.python.org/lib/lib.html&quot; rel=&quot;nofollow&quot;&gt;Python Library Reference&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://doc.trolltech.com/2.3/qmap.html&quot; rel=&quot;nofollow&quot;&gt;QMap Class Reference&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://doc.trolltech.com/2.3/index.html&quot; rel=&quot;nofollow&quot;&gt;Qt On-line Reference Documentation&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/s897094z%28VS.80%29.aspx&quot; rel=&quot;nofollow&quot;&gt;CMap Class&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/d06h2x6e%28VS.80%29.aspx&quot; rel=&quot;nofollow&quot;&gt;MFC Library Reference&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:24:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:24 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:117:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Sam%20Tannous&quot;&gt;Sam Tannous&lt;/a&gt; (&lt;strong&gt;2007&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://arxiv.org/abs/0704.3773&quot; rel=&quot;nofollow&quot;&gt;Avoiding Rotated Bitboards with Direct Lookup&lt;/a&gt;&lt;/em&gt;. &lt;a class=&quot;wiki_link&quot; href=&quot;/ICGA%20Journal#30_2&quot;&gt;ICGA Journal, Vol. 30, No. 2&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://arxiv.org/PS_cache/arxiv/pdf/0704/0704.3773v2.pdf&quot; rel=&quot;nofollow&quot;&gt;pdf&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Donald%20Knuth&quot;&gt;Donald Knuth&lt;/a&gt; (&lt;strong&gt;1998&lt;/strong&gt;). &lt;em&gt;The Art of Computer Programming&lt;/em&gt;. Volume 3, Sorting and Searching. Addison Wesley. ISBN 0201896850&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:117 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:26:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc5&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:26 --&gt;What links here?&lt;/h1&gt;
&lt;!-- ws:start:WikiTextIncludeRule:00:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Hashing Dictionaries&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;20&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Hashing Dictionaries&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;20&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Hashing_Dictionaries includeBody-Hashing%20Dictionaries includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Congruent+Modulo+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Congruent Modulo Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 26, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Efficient+Generation+of+Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Efficient Generation of Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hash+Table&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hash Table&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 1, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hashing+Dictionaries&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hashing Dictionaries&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 1, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mark+Levene&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mark Levene&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 2, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Python&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Python&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 31, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sam+Tannous&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sam Tannous&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 1, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Shatranj+%28toolkit%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Shatranj (toolkit)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 16, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Trevor+Fenner&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Trevor Fenner&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 2, 2015&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:00 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Kindergarten Bitboards</title>
      <link>https://chessprogramming.wikispaces.com/Kindergarten+Bitboards</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Kindergarten+Bitboards</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Kindergarten+Bitboards</comments>
      <pubDate>Tue, 01 Aug 2017 19:55:05 GMT</pubDate>
      <description>&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Board%20Representation&quot;&gt;Board Representation&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Bitboards&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Sliding Piece Attacks&lt;/a&gt; * Kindergarten Bitboards&lt;/strong&gt;&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:597:&amp;lt;a href=&amp;quot;http://www.imj.org.il/imagine/collections/item.asp?itemNum=194576&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/Group_of_Masks.jpg/157881193/232x303/Group_of_Masks.jpg&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; style=&amp;quot;height: 303px; width: 232px;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;http://www.imj.org.il/imagine/collections/item.asp?itemNum=194576&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/Group_of_Masks.jpg/157881193/232x303/Group_of_Masks.jpg&quot; alt=&quot;Group_of_Masks.jpg&quot; title=&quot;Group_of_Masks.jpg&quot; style=&quot;height: 303px; width: 232px;&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:597 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td rowspan=&quot;2&quot;&gt;&lt;strong&gt;Kindergarten&lt;/strong&gt; bitboards &lt;!-- ws:start:WikiTextRefRule:18:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;amp;t=5958&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Magic Bitboards Explained!&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Michael%20Sherwin&amp;quot;&amp;gt;Michael Sherwin&amp;lt;/a&amp;gt; and reply by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Gerd%20Isenberg&amp;quot;&amp;gt;Gerd Isenberg&amp;lt;/a&amp;gt; to call it Kindergarten Bitboards, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;Winboard Forum&amp;lt;/a&amp;gt;, December 4, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Timeline#2006&amp;quot;&amp;gt;2006&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:18 --&gt; was a kind of interactive forum development &lt;!-- ws:start:WikiTextRefRule:23:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.open-aurec.com/wbforum/viewtopic.php?t=4523&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Compact Bitboard Attacks&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Tom%20Likens&amp;quot;&amp;gt;Tom Likens&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;Winboard Forum&amp;lt;/a&amp;gt;, March 14, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Timeline#2006&amp;quot;&amp;gt;2006&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:23 --&gt; with a lot of meanders &lt;!-- ws:start:WikiTextRefRule:28:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.stmintz.com/ccc/index.php?id=489834&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;rotated bitboards obsolete?&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Gerd%20Isenberg&amp;quot;&amp;gt;Gerd Isenberg&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, February 26, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Timeline#2006&amp;quot;&amp;gt;2006&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-3&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:28 --&gt; . There were two issues involved - first to calculate the &lt;a class=&quot;wiki_link&quot; href=&quot;/Occupancy%20of%20any%20Line&quot;&gt;occupancy of any line&lt;/a&gt; from the &lt;a class=&quot;wiki_link&quot; href=&quot;/Occupancy&quot;&gt;occupied bitboard&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:32:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.stmintz.com/ccc/index.php?id=491079&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: Some thoughts on Dann Corbit&#039;s rotated alternative&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Steffan%20Westcott&amp;quot;&amp;gt;Steffan Westcott&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, March 03, 2006&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-4&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-4&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:32 --&gt; - and second, compact and dense lookup tables.&lt;br /&gt;
&lt;br /&gt;
As a quintessence &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt; came up with this nomination. It relies on fast 64-bit multiplication, but is otherwise quite resource friendly and a compromise between calculation and table-size.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Arts#Klee&quot;&gt;Paul Klee&lt;/a&gt;, Group of Masks, 1939 &lt;!-- ws:start:WikiTextRefRule:34:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.imj.org.il/imagine/collections/viewDataE5.asp?case=Modern%20Art&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;IMAGINE - The Israel Museum&#039;s searchable collections database&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-5&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-5&quot;&gt;[5]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:34 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextTocRule:75:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:75 --&gt;&lt;!-- ws:start:WikiTextTocRule:76: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Ranks and Diagonals&quot;&gt;Ranks and Diagonals&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:76 --&gt;&lt;!-- ws:start:WikiTextTocRule:77: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#File-Attacks&quot;&gt;File-Attacks&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:77 --&gt;&lt;!-- ws:start:WikiTextTocRule:78: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Shared Rank Lookup&quot;&gt;Shared Rank Lookup&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:78 --&gt;&lt;!-- ws:start:WikiTextTocRule:79: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#x32-bit Versions&quot;&gt;32-bit Versions&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:79 --&gt;&lt;!-- ws:start:WikiTextTocRule:80: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Magic Compression&quot;&gt;Magic Compression&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:80 --&gt;&lt;!-- ws:start:WikiTextTocRule:81: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:81 --&gt;&lt;!-- ws:start:WikiTextTocRule:82: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Forum Posts&quot;&gt;Forum Posts&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:82 --&gt;&lt;!-- ws:start:WikiTextTocRule:83: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:83 --&gt;&lt;!-- ws:start:WikiTextTocRule:84: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:84 --&gt;&lt;!-- ws:start:WikiTextTocRule:85: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:85 --&gt;&lt;!-- ws:start:WikiTextTocRule:86: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:86 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:55:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Ranks and Diagonals&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:55 --&gt;Ranks and Diagonals&lt;/h1&gt;
 &lt;a class=&quot;wiki_link&quot; href=&quot;/Ranks&quot;&gt;Ranks&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/diagonals&quot;&gt;diagonals&lt;/a&gt; - that is their appropriate &lt;a class=&quot;wiki_link&quot; href=&quot;/On%20an%20empty%20Board#LineAttacks&quot;&gt;line-mask&lt;/a&gt; by square-index - are first intersected by the occupancy of the whole board. Doesn&#039;t matter whether the slider itself is cleared or not - it is redundant anyway, considered by the pre-calculated lookup-table.&lt;br /&gt;
&lt;br /&gt;
Since there is only up to one bit per file, the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Multiplication&quot;&gt;north-fill multiplication&lt;/a&gt; by the A-file maps the diagonal to the 8th rank. Or - since we only need the &lt;a class=&quot;wiki_link&quot; href=&quot;/First%20Rank%20Attacks#TheOuterSquares&quot;&gt;inner six bits&lt;/a&gt;, we combine the required shift left one by multiplying with the B-file. Shifting right the product by 58 (64-6) leaves the six-bit occupancy-index in the 0..63 range. For instance the diagonal-attacks of a bishop on d4. &#039;A&#039;-&#039;H&#039; represent the masked occupied bits along this diagonal, which are either zero or one.&lt;br /&gt;
&lt;!-- ws:start:WikiTextIncludeRule:013:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/page?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;MappingHint&amp;amp;quot;&amp;quot; title=&amp;quot;Include page: page=&amp;amp;quot;MappingHint&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;

&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a href=&quot;/Square%20Mapping%20Considerations&quot;&gt;&lt;img src=&quot;/file/view/mapping.JPG/93134172/mapping.JPG&quot; alt=&quot;mapping.JPG&quot; title=&quot;mapping.JPG&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;em&gt;Code samples and bitboard diagrams rely on &lt;a class=&quot;wiki_link&quot; href=&quot;/Square%20Mapping%20Considerations#LittleEndianRankFileMapping&quot;&gt;Little endian file and rank mapping&lt;/a&gt;&lt;/em&gt;.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:end:WikiTextIncludeRule:013 --&gt;&lt;br /&gt;
We need &#039;B&#039;-&#039;G&#039; as six bit number:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;masked line      *  B-File           =  B-G upper six       occupancy 6 bit&amp;lt;br/&amp;gt;. . . . . . . H     . 1 . . . . . .     . A[B C . E F G]    . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . G .     . 1 . . . . . .     . A B C . E F G     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . F . .     . 1 . . . . . .     . A B C . E F .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . E . . .     . 1 . . . . . .     . A B C . E . .  &amp;amp;gt;&amp;amp;gt; . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .  *  . 1 . . . . . .  =  . A B C . . . .  58 . . . . . . . .&amp;lt;br/&amp;gt;. . C . . . . .     . 1 . . . . . .     . A B C . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. B . . . . . .     . 1 . . . . . .     . A B . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;A . . . . . . .     . 1 . . . . . .     . A . . . . . .    [B C . E F G]. .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;masked line      *  B-File           =  B-G upper six       occupancy 6 bit
. . . . . . . H     . 1 . . . . . .     . A[B C . E F G]    . . . . . . . .
. . . . . . G .     . 1 . . . . . .     . A B C . E F G     . . . . . . . .
. . . . . F . .     . 1 . . . . . .     . A B C . E F .     . . . . . . . .
. . . . E . . .     . 1 . . . . . .     . A B C . E . .  &amp;gt;&amp;gt; . . . . . . . .
. . . . . . . .  *  . 1 . . . . . .  =  . A B C . . . .  58 . . . . . . . .
. . C . . . . .     . 1 . . . . . .     . A B C . . . .     . . . . . . . .
. B . . . . . .     . 1 . . . . . .     . A B . . . . .     . . . . . . . .
A . . . . . . .     . 1 . . . . . .     . A . . . . . .    [B C . E F G]. .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;The pre-calculated lookup-table contains the &lt;a class=&quot;wiki_link&quot; href=&quot;/First%20Rank%20Attacks&quot;&gt;attacks of the first rank&lt;/a&gt; - but eight copies in each &lt;a class=&quot;wiki_link&quot; href=&quot;/Ranks&quot;&gt;rank&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Byte&quot;&gt;byte&lt;/a&gt;. It is indexed by the six bit occupied-state (&#039;B&#039;-&#039;G&#039;) and the &lt;a class=&quot;wiki_link&quot; href=&quot;/Files&quot;&gt;file&lt;/a&gt; of the slider&#039;s &lt;a class=&quot;wiki_link&quot; href=&quot;/Squares&quot;&gt;square&lt;/a&gt;. It needs to be intersected with the same line-mask as formerly the occupancy - to map the first rank attack bits to the appropriate line - that&#039;s all. Appropriate pre-calculated attack bits are represented by &#039;a&#039;-&#039;h&#039;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;8 copies of rank      the attack set&amp;lt;br/&amp;gt;attacks &amp;amp;amp; l-mask  -&amp;amp;gt;  of this line&amp;lt;br/&amp;gt;a b c . e f g h       . . . . . . . h&amp;lt;br/&amp;gt;a b c . e f g h       . . . . . . g .&amp;lt;br/&amp;gt;a b c . e f g h       . . . . . f . .&amp;lt;br/&amp;gt;a b c . e f g h       . . . . e . . .&amp;lt;br/&amp;gt;a b c . e f g h       . . . . . . . .&amp;lt;br/&amp;gt;a b c . e f g h       . . c . . . . .&amp;lt;br/&amp;gt;a b c . e f g h       . b . . . . . .&amp;lt;br/&amp;gt;a b c . e f g h       a . . . . . . .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;8 copies of rank      the attack set
attacks &amp;amp; l-mask  -&amp;gt;  of this line
a b c . e f g h       . . . . . . . h
a b c . e f g h       . . . . . . g .
a b c . e f g h       . . . . . f . .
a b c . e f g h       . . . . e . . .
a b c . e f g h       . . . . . . . .
a b c . e f g h       . . c . . . . .
a b c . e f g h       . b . . . . . .
a b c . e f g h       a . . . . . . .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;Since all &lt;a class=&quot;wiki_link&quot; href=&quot;/ranks&quot;&gt;ranks&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/diagonals&quot;&gt;diagonals&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/anti-diagonals&quot;&gt;anti-diagonals&lt;/a&gt; are properly file-aligned, it works perfectly with some redundant occupied bits for shorter diagonals as well, like here the outer bit &#039;B&#039;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;masked line      *  B-File           =  B-G upper six       occupancy 6 bit&amp;lt;br/&amp;gt;. . . . . . . .     . 1 . . . . . .     H .[B C . E F G]    . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . H     . 1 . . . . . .     . . B C . E F G     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . G .     . 1 . . . . . .     . . B C . E F G     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . F . .     . 1 . . . . . .     . . B C . E F .  &amp;amp;gt;&amp;amp;gt; . . . . . . . .&amp;lt;br/&amp;gt;. . . . E . . .  *  . 1 . . . . . .  =  . . B C . E . .  58 . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . 1 . . . . . .     . . B C . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . C . . . . .     . 1 . . . . . .     . . B C . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. B . . . . . .     . 1 . . . . . .     . . B . . . . .    [B C . E F G]. .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;masked line      *  B-File           =  B-G upper six       occupancy 6 bit
. . . . . . . .     . 1 . . . . . .     H .[B C . E F G]    . . . . . . . .
. . . . . . . H     . 1 . . . . . .     . . B C . E F G     . . . . . . . .
. . . . . . G .     . 1 . . . . . .     . . B C . E F G     . . . . . . . .
. . . . . F . .     . 1 . . . . . .     . . B C . E F .  &amp;gt;&amp;gt; . . . . . . . .
. . . . E . . .  *  . 1 . . . . . .  =  . . B C . E . .  58 . . . . . . . .
. . . . . . . .     . 1 . . . . . .     . . B C . . . .     . . . . . . . .
. . C . . . . .     . 1 . . . . . .     . . B C . . . .     . . . . . . . .
. B . . . . . .     . 1 . . . . . .     . . B . . . . .    [B C . E F G]. .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;Appropriate pre-calculated attack bits are represented by &#039;b&#039;-&#039;h&#039; here:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;8 copies of rank      the attack set   or  the attack set&amp;lt;br/&amp;gt;attacks &amp;amp;amp; l-mask  -&amp;amp;gt;  of this line     -&amp;amp;gt;  of the shorter diagonal&amp;lt;br/&amp;gt;a b c . e f g h       . . . . . . . h      . . . . . . . .&amp;lt;br/&amp;gt;a b c . e f g h       . . . . . . g .      . . . . . . . h&amp;lt;br/&amp;gt;a b c . e f g h       . . . . . f . .      . . . . . . g .&amp;lt;br/&amp;gt;a b c . e f g h       . . . . e . . .      . . . . . f . .&amp;lt;br/&amp;gt;a b c . e f g h       . . . . . . . .      . . . . e . . .&amp;lt;br/&amp;gt;a b c . e f g h       . . c . . . . .      . . . . . . . .&amp;lt;br/&amp;gt;a b c . e f g h       . b . . . . . .      . . c . . . . .&amp;lt;br/&amp;gt;a b c . e f g h       a . . . . . . .      . b . . . . . .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;8 copies of rank      the attack set   or  the attack set
attacks &amp;amp; l-mask  -&amp;gt;  of this line     -&amp;gt;  of the shorter diagonal
a b c . e f g h       . . . . . . . h      . . . . . . . .
a b c . e f g h       . . . . . . g .      . . . . . . . h
a b c . e f g h       . . . . . f . .      . . . . . . g .
a b c . e f g h       . . . . e . . .      . . . . . f . .
a b c . e f g h       . . . . . . . .      . . . . e . . .
a b c . e f g h       . . c . . . . .      . . . . . . . .
a b c . e f g h       . b . . . . . .      . . c . . . . .
a b c . e f g h       a . . . . . . .      . b . . . . . .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;Wasn&#039;t that simple? That is why it is called &lt;strong&gt;kindergarten&lt;/strong&gt; bitboards!&lt;br /&gt;
&lt;br /&gt;
The trick is to share one 4KByte table by three line-directions by re-using the mask for a final intersection. Of course one may use the calculated occupied state to index &lt;a class=&quot;wiki_link&quot; href=&quot;/Rotated%20Bitboards&quot;&gt;rotated bitboards&lt;/a&gt; like tables of 32KByte each. But dividing the table size by 3*8 on the cost of that additional &#039;and&#039; (and keeping the mask inside a register) is tempting. Of course - like always with computation versus memory issues - it depends on the cache- and memory using and footprint inside a particular chess program and the hardware architecture, which solution is preferable. So far L1 &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Cache&quot; rel=&quot;nofollow&quot;&gt;Cache&lt;/a&gt; is a rare resource, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Translation_Lookaside_Buffer&quot; rel=&quot;nofollow&quot;&gt;Translation Lookaside Buffer&lt;/a&gt; als well.&lt;br /&gt;
&lt;br /&gt;
Like other none rotated approaches, namely &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards&quot;&gt;magic bitboards&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Hyperbola%20Quintessence#ArrayOfStructs&quot;&gt;hyperbola quintessence&lt;/a&gt;, the nice thing is that one can &lt;a class=&quot;wiki_link&quot; href=&quot;/Hiding%20the%20Implementation&quot;&gt;hide the implementation details&lt;/a&gt; behind a stateless interface. In &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt; /&lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt; one may use &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Header_file&quot; rel=&quot;nofollow&quot;&gt;header files&lt;/a&gt; with exclusive, conditional compiled inlined routines, as combinations and variations of the mentioned approaches.&lt;br /&gt;
&lt;br /&gt;
The three routines only differ by the line-mask applied. As pointed out by &lt;a class=&quot;wiki_link&quot; href=&quot;/Aleks%20Peshkov&quot;&gt;Aleks Peshkov&lt;/a&gt;, it is smarter to index by file, occupancy, since fillUpAttacks[sq&amp;amp;7] may be shared by two (bishop) or three (queen) line-attack getters.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 fillUpAttacks[8][64];  // 4 KByte&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 diagonalAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   const U64 bFile = C64(0x0202020202020202);&amp;lt;br/&amp;gt;   occ = (diagonalMaskEx[sq] &amp;amp;amp; occ) * bFile &amp;amp;gt;&amp;amp;gt; 58;&amp;lt;br/&amp;gt;   return diagonalMaskEx[sq] &amp;amp;amp; fillUpAttacks[sq&amp;amp;amp;7][occ];&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 antiDiagAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   const U64 bFile = C64(0x0202020202020202);&amp;lt;br/&amp;gt;   occ = (antidiagMaskEx[sq] &amp;amp;amp; occ) * bFile &amp;amp;gt;&amp;amp;gt; 58;&amp;lt;br/&amp;gt;   return antidiagMaskEx[sq] &amp;amp;amp; fillUpAttacks[sq&amp;amp;amp;7][occ];&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 rankAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   const U64 bFile = C64(0x0202020202020202);&amp;lt;br/&amp;gt;   occ = (rankMaskEx[sq] &amp;amp;amp; occ) * bFile &amp;amp;gt;&amp;amp;gt; 58;&amp;lt;br/&amp;gt;   return rankMaskEx[sq] &amp;amp;amp; fillUpAttacks[sq&amp;amp;amp;7][occ];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 fillUpAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// 4 KByte&lt;/span&gt;
&amp;nbsp;
U64 diagonalAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 bFile &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0202020202020202&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;diagonalMaskEx&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; occ&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; bFile &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;58&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; diagonalMaskEx&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; fillUpAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occ&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
U64 antiDiagAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 bFile &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0202020202020202&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;antidiagMaskEx&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; occ&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; bFile &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;58&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; antidiagMaskEx&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; fillUpAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occ&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
U64 rankAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 bFile &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0202020202020202&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;rankMaskEx&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; occ&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; bFile &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;58&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; rankMaskEx&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; fillUpAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occ&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;One may use similar structs for the line-masks than the &lt;a class=&quot;wiki_link&quot; href=&quot;/Hyperbola%20Quintessence#ArrayOfStructs&quot;&gt;hyperbola quintessence&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:87:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@FileAttacks&amp;quot; title=&amp;quot;Anchor: FileAttacks&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;FileAttacks&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:87 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:57:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;File-Attacks&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:57 --&gt;File-Attacks&lt;/h1&gt;
 &lt;a class=&quot;wiki_link&quot; href=&quot;/Files&quot;&gt;Files&lt;/a&gt; need tad more work. Shift the board left (arithmetical right!) to the A-file to mask it. To get the inner six bits, a &lt;a class=&quot;wiki_link&quot; href=&quot;/Flipping%20Mirroring%20and%20Rotating#FiletoaRank&quot;&gt;flip-multiplication&lt;/a&gt; by the c2-h7 diagonal is applied with further shift right 58. The lookup-table contains the A-file attacks, which are shifted &amp;quot;back&amp;quot; to the original file.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 aFileAttacks [8][64];  // 4 KByte&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 fileAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   const U64 aFile   = C64(0x0101010101010101);&amp;lt;br/&amp;gt;   const U64 diac2h7 = C64(0x0080402010080400);&amp;lt;br/&amp;gt;   occ = aFile  &amp;amp;amp; (occ &amp;amp;gt;&amp;amp;gt; (sq&amp;amp;amp;7));&amp;lt;br/&amp;gt;   occ = (diac2h7 *  occ ) &amp;amp;gt;&amp;amp;gt; 58;&amp;lt;br/&amp;gt;   return aFileAttacks[sq&amp;amp;gt;&amp;amp;gt;3][occ] &amp;amp;lt;&amp;amp;lt; (sq&amp;amp;amp;7);&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 aFileAttacks &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// 4 KByte&lt;/span&gt;
&amp;nbsp;
U64 fileAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 aFile   &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0101010101010101&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 diac2h7 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0080402010080400&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; aFile  &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;diac2h7 &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;  occ &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;58&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; aFileAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occ&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;This is how it works:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;masked A-file    *  c2-h7 Diagonal    =  occupancy&amp;lt;br/&amp;gt;H . . . . . . .     . . . . . . . .     . .[G F E D C B]    . . . . . . . .&amp;lt;br/&amp;gt;G . . . . . . .     . . . . . . . 1     . . F E D C B A     . . . . . . . .&amp;lt;br/&amp;gt;F . . . . . . .     . . . . . . 1 .     . . E D C B A .     . . . . . . . .&amp;lt;br/&amp;gt;E . . . . . . .     . . . . . 1 . .     . . D C B A . .  &amp;amp;gt;&amp;amp;gt; . . . . . . . .&amp;lt;br/&amp;gt;D . . . . . . .  *  . . . . 1 . . .  =  . . C B A . . .  58 . . . . . . . .&amp;lt;br/&amp;gt;C . . . . . . .     . . . 1 . . . .     . . B A . . . .     . . . . . . . .&amp;lt;br/&amp;gt;B . . . . . . .     . . 1 . . . . .     . . A . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;A . . . . . . .     . . . . . . . .     . . . . . . . .    [G F E D C B]. .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;masked A-file    *  c2-h7 Diagonal    =  occupancy
H . . . . . . .     . . . . . . . .     . .[G F E D C B]    . . . . . . . .
G . . . . . . .     . . . . . . . 1     . . F E D C B A     . . . . . . . .
F . . . . . . .     . . . . . . 1 .     . . E D C B A .     . . . . . . . .
E . . . . . . .     . . . . . 1 . .     . . D C B A . .  &amp;gt;&amp;gt; . . . . . . . .
D . . . . . . .  *  . . . . 1 . . .  =  . . C B A . . .  58 . . . . . . . .
C . . . . . . .     . . . 1 . . . .     . . B A . . . .     . . . . . . . .
B . . . . . . .     . . 1 . . . . .     . . A . . . . .     . . . . . . . .
A . . . . . . .     . . . . . . . .     . . . . . . . .    [G F E D C B]. .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;Note that the six inner bit occupancy is reversed - considered in the pre-calculated aFileAttacks &lt;a class=&quot;wiki_link&quot; href=&quot;/Array&quot;&gt;array&lt;/a&gt;. This reversed lookup was justified to share first rank-attacks by all directions - with a dense lookup of 512 Byte. But the 4KByte tables outperform the additional multiplications and shift of the dense version - and one may alternatively multiply with the flipped diagonal, the c7-h2 anti-diagonal:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;masked A-file    *  c7-h2 AntiDiag   =  occupancy&amp;lt;br/&amp;gt;H . . . . . . .     . . . . . . . .     . .[B C D E F G]    . . . . . . . .&amp;lt;br/&amp;gt;G . . . . . . .     . . 1 . . . . .     . . A B C D E F     . . . . . . . .&amp;lt;br/&amp;gt;F . . . . . . .     . . . 1 . . . .     . . . A B C D E     . . . . . . . .&amp;lt;br/&amp;gt;E . . . . . . .     . . . . 1 . . .     . . . . A B C D  &amp;amp;gt;&amp;amp;gt; . . . . . . . .&amp;lt;br/&amp;gt;D . . . . . . .  *  . . . . . 1 . .  =  . . . . . A B C  58 . . . . . . . .&amp;lt;br/&amp;gt;C . . . . . . .     . . . . . . 1 .     . . . . . . A B     . . . . . . . .&amp;lt;br/&amp;gt;B . . . . . . .     . . . . . . . 1     . . . . . . . A     . . . . . . . .&amp;lt;br/&amp;gt;A . . . . . . .     . . . . . . . .     . . . . . . . .    [B C D E F G]. .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;masked A-file    *  c7-h2 AntiDiag   =  occupancy
H . . . . . . .     . . . . . . . .     . .[B C D E F G]    . . . . . . . .
G . . . . . . .     . . 1 . . . . .     . . A B C D E F     . . . . . . . .
F . . . . . . .     . . . 1 . . . .     . . . A B C D E     . . . . . . . .
E . . . . . . .     . . . . 1 . . .     . . . . A B C D  &amp;gt;&amp;gt; . . . . . . . .
D . . . . . . .  *  . . . . . 1 . .  =  . . . . . A B C  58 . . . . . . . .
C . . . . . . .     . . . . . . 1 .     . . . . . . A B     . . . . . . . .
B . . . . . . .     . . . . . . . 1     . . . . . . . A     . . . . . . . .
A . . . . . . .     . . . . . . . .     . . . . . . . .    [B C D E F G]. .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:59:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Shared Rank Lookup&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:59 --&gt;Shared Rank Lookup&lt;/h1&gt;
 As often, &lt;a class=&quot;wiki_link&quot; href=&quot;/Space-Time%20Tradeoff&quot;&gt;computation versus memory size&lt;/a&gt;. One may share a 512Byte Lookup of the first rank by all lines with some trailing computation. Multiplying with the A-file (fill north) for ranks and diagonals, and multiplying with the diagonal for the file. Likely the additional multiplication don&#039;t pays off.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;const BYTE firstRankAttacks[8][64];&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 fileAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   const U64 aFile   = C64(0x0101010101010101);&amp;lt;br/&amp;gt;   const U64 hFile   = C64(0x8080808080808080);&amp;lt;br/&amp;gt;   const U64 diaa1h8 = C64(0x8040201008040201);&amp;lt;br/&amp;gt;   const U64 diac2h7 = C64(0x0080402010080400);&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;   unsigned int f = sq &amp;amp;amp; 7;&amp;lt;br/&amp;gt;   occ =   aFile   &amp;amp;amp; (occ   &amp;amp;gt;&amp;amp;gt;  f);&amp;lt;br/&amp;gt;   occ = ( diac2h7 *  occ ) &amp;amp;gt;&amp;amp;gt; 58;&amp;lt;br/&amp;gt;   occ =   diaa1h8 * firstRankAttacks[(sq^56)&amp;amp;gt;&amp;amp;gt;3][occ];&amp;lt;br/&amp;gt;   return ( hFile  &amp;amp;amp;  occ ) &amp;amp;gt;&amp;amp;gt; (f^7);&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 diagonalAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   const U64 aFile = C64(0x0101010101010101);&amp;lt;br/&amp;gt;   const U64 bFile = C64(0x0202020202020202);&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;   unsigned int f = sq &amp;amp;amp; 7;&amp;lt;br/&amp;gt;   occ  =  diagonalMaskEx[sq] &amp;amp;amp; occ;&amp;lt;br/&amp;gt;   occ  = (bFile * occ ) &amp;amp;gt;&amp;amp;gt; 58;&amp;lt;br/&amp;gt;   occ  =  aFile *  firstRankAttacks[f][occ];&amp;lt;br/&amp;gt;   return  diagonalMaskEx[sq] &amp;amp;amp; occ;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; BYTE firstRankAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
U64 fileAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 aFile   &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0101010101010101&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 hFile   &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x8080808080808080&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 diaa1h8 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x8040201008040201&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 diac2h7 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0080402010080400&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; f &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;   aFile   &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ   &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;  f&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; diac2h7 &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;  occ &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;58&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;   diaa1h8 &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; firstRankAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;56&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occ&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; hFile  &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;  occ &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;f&lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
U64 diagonalAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 aFile &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0101010101010101&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 bFile &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0202020202020202&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; f &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  diagonalMaskEx&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; occ&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bFile &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; occ &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;58&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  aFile &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;  firstRankAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;f&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occ&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt;  diagonalMaskEx&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; occ&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:61:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;x32-bit Versions&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:61 --&gt;32-bit Versions&lt;/h1&gt;
 One other variation of the memory versus computation theme was encouraged by 32-bit mode. 64-bit multiplication is quite expensive in 32-bit mode - a call using three imuls. Thus, it is more efficient to use shift-or plus 32-bit multiplication, which might in fact be used in 64-bit mode as well. &lt;a class=&quot;wiki_link&quot; href=&quot;/Piotr%20Cichy&quot;&gt;Piotr Cichy&lt;/a&gt; proposed a multiplication less &lt;a class=&quot;wiki_link&quot; href=&quot;/Parallel%20Prefix%20Algorithms&quot;&gt;parallel prefix shift&lt;/a&gt; approach similar to &lt;a class=&quot;wiki_link&quot; href=&quot;/Occupancy%20of%20any%20Line&quot;&gt;Occupancy of any Line&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:38:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=29296&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Kindergarten bitboards without multiplying&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Piotr%20Cichy&amp;quot;&amp;gt;Piotr Cichy&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, August 07, 2009&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-6&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-6&quot;&gt;[6]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:38 --&gt; , which is a good alternative for processors with slow multiplication.&lt;br /&gt;
&lt;br /&gt;
An efficient and tricky file-approach was introduced by &lt;a class=&quot;wiki_link&quot; href=&quot;/Zach%20Wegner&quot;&gt;Zach Wegner&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:42:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.open-aurec.com/wbforum/viewtopic.php?topic_view=threads&amp;amp;amp;p=26851&amp;amp;amp;t=4523&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Zach&#039;s tricky 32-bit approach&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Zach%20Wegner&amp;quot;&amp;gt;Zach Wegner&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;Winboard Forum&amp;lt;/a&amp;gt;, August 22, 2006&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-7&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-7&quot;&gt;[7]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:42 --&gt;, using a 32KByte, &lt;a class=&quot;wiki_link&quot; href=&quot;/Rotated%20Bitboards&quot;&gt;rotated like&lt;/a&gt; lookup-table:&lt;br /&gt;
&lt;tt&gt;It is quite strange, yes, but it is an out of order mapping. There are only 5 bits because each bit in the factor maps more than one bit. The trick here is the odd shift 29, so that the multiply does not overflow individual bits. I have since found that 25 and 27 will work with the same magic&lt;/tt&gt;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:9:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;occ&amp;lt;br/&amp;gt;. . . . . . . .&amp;lt;br/&amp;gt;a . . . . . . .&amp;lt;br/&amp;gt;b . . . . . . .    occ | occ &amp;amp;gt;&amp;amp;gt; 29    * 0x01041041 with the index bracketed&amp;lt;br/&amp;gt;c . . . . . . .    ...\               ...\               ...\&amp;lt;br/&amp;gt;d . . . . . . .    d . . . . . . .    1 . . . . . . .    d a[f c e b d a]&amp;lt;br/&amp;gt;e . . . . . . .    e . . a . . . .    . . 1 . . . . .    e b . a f c e b&amp;lt;br/&amp;gt;f . . . . . . .    f . . b . . . .    . . . . 1 . . .    f c . b . . f c&amp;lt;br/&amp;gt;. . . . . . . .    . . . c . . . .    1 . . . . . 1 .    . . . c . . . .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;occ
. . . . . . . .
a . . . . . . .
b . . . . . . .    occ | occ &amp;gt;&amp;gt; 29    * 0x01041041 with the index bracketed
c . . . . . . .    ...\               ...\               ...\
d . . . . . . .    d . . . . . . .    1 . . . . . . .    d a[f c e b d a]
e . . . . . . .    e . . a . . . .    . . 1 . . . . .    e b . a f c e b
f . . . . . . .    f . . b . . . .    . . . . 1 . . .    f c . b . . f c
. . . . . . . .    . . . c . . . .    1 . . . . . 1 .    . . . c . . . .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:9 --&gt;&lt;tt&gt;The interesting thing is that this works for any masked file. In fact if it was shifted to the a-file, you could get away with the 3-bit factor 0x00041040 (but using a shift of 23).&lt;/tt&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:10:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 arrFileAttacks[64][64]; // [sq][occ64] 32KByte&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 fileAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   occ &amp;amp;amp;= fileMask[sq];&amp;lt;br/&amp;gt;   U32 fold  = (U32)occ | (U32)(occ &amp;amp;gt;&amp;amp;gt; 29);&amp;lt;br/&amp;gt;   U32 occ64 = fold * 0x01041041 &amp;amp;gt;&amp;amp;gt; 26;&amp;lt;br/&amp;gt;   return arrFileAttacks[sq][occ64];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 arrFileAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// [sq][occ64] 32KByte&lt;/span&gt;
&amp;nbsp;
U64 fileAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   occ &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; fileMask&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   U32 fold  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U32&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;occ &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U32&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;29&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   U32 occ64 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; fold &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x01041041&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;26&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; arrFileAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occ64&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:10 --&gt;&lt;br /&gt;
Ranks and diagonals are trivial, this version favors rotated like memory size for less computation and same operations than file-attacks. One may therefor generalize the routine by a line-direction parameter:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:11:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 arrDiagonalAttacks[64][64]; // [sq][occ64] 32KByte&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 diagonalAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   occ &amp;amp;amp;= diagonalMaskEx[sq];&amp;lt;br/&amp;gt;   U32 fold  = (U32)occ | (U32)(occ &amp;amp;gt;&amp;amp;gt; 32);&amp;lt;br/&amp;gt;   U32 occ64 = fold * 0x02020202 &amp;amp;gt;&amp;amp;gt; 26;&amp;lt;br/&amp;gt;   return arrDiagonalAttacks[sq][occ64];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 arrDiagonalAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// [sq][occ64] 32KByte&lt;/span&gt;
&amp;nbsp;
U64 diagonalAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   occ &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; diagonalMaskEx&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   U32 fold  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U32&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;occ &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U32&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   U32 occ64 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; fold &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x02020202&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;26&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; arrDiagonalAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occ64&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:11 --&gt;A similar approach was proposed by &lt;a class=&quot;wiki_link&quot; href=&quot;/Andrew%20Fan&quot;&gt;Andrew Fan&lt;/a&gt; in 2009, been active in his &lt;a class=&quot;wiki_link&quot; href=&quot;/FireFly&quot;&gt;own engine&lt;/a&gt; for a few years (2006 earliest recorded file time) &lt;!-- ws:start:WikiTextRefRule:46:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;amp;t=50616&amp;amp;amp;p=192200&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;32-bit Magic experiments&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Andrew%20Fan&amp;quot;&amp;gt;Andrew Fan&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;Winboard Forum&amp;lt;/a&amp;gt;, December 03, 2009&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-8&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-8&quot;&gt;[8]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:46 --&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:88:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@MagicCompression&amp;quot; title=&amp;quot;Anchor: MagicCompression&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;MagicCompression&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:88 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:63:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Magic Compression&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:63 --&gt;Magic Compression&lt;/h1&gt;
 So far Kindergarten bitboards performs a &lt;a class=&quot;wiki_link&quot; href=&quot;/Hash%20Table#PerfectHashing&quot;&gt;perfect hashing&lt;/a&gt; of the up to six relevant and scattered occupied bits of any line to a six-bit index - which is a bijective mapping of 64 different occupancies per line to 64 indices for the precalculated attack sets.&lt;br /&gt;
&lt;br /&gt;
If we have a closer look to the attack sets, say of a rook on the a-file, we enumerate far less disjoint sets. A rook on a1 (a8) has seven different attack-sets on that file, depending on the occupancy of a2-a7. On a2 (a7) there is even one attack set less, on a3 (a6) 2 times 5 and on a4 (a5) 3 times 4 attack-sets. Thus, there are {7, 6, 10, 12, 12, 10, 6, 7} disjoint attack-sets per square on line, or 70 in total over all eight squares.&lt;br /&gt;
&lt;br /&gt;
While kindergarten bitboards apply a minimal perfect mapping of scattered bits to a six-bit index, the mapping of the attack-sets is surjective, since each of the 64 occupancies maps only up to 12 distinct sets. Of course that is because occupancies &amp;quot;behind&amp;quot; the first blocker are redundant and map the same attack.&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/Grant%20Osborne&quot;&gt;Grant Osborne&lt;/a&gt; came up with the idea, derived from &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards&quot;&gt;magic bitboards&lt;/a&gt; - to use different &amp;quot;magic&amp;quot; factors per square (rank), where multiplication may produce carries and enough so called constructive collisions to gain only five or even four bit indices and therefor denser tables. Since different squares may have different table sizes (16 or 32 entries), a Java-like &lt;a class=&quot;wiki_link&quot; href=&quot;/Array&quot;&gt;array&lt;/a&gt; is used for the attacks, in C implemented as array of pointers to the arbitrary sized attack tables. The variable right shift by either 60 or 59 is encoded inside the otherwise redundant upper six bits of the magic factor, as mentioned in &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards#IncorporatingtheShift&quot;&gt;incorporating the shift&lt;/a&gt; of magic bitboards.&lt;br /&gt;
&lt;br /&gt;
Grant&#039;s proposal, so far with {5,4,4,5,5,4,4,5} bit ranges for the lookups per square for vertical rook attacks, results in a 1.5 KByte array instead the 4KByte of the initial Kindergarten file attack getter &lt;!-- ws:start:WikiTextRefRule:50:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;amp;p=198660&amp;amp;amp;t=21329&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: How to reduce the &amp;amp;quot;bits&amp;amp;quot; used in a magic number&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Grant%20Osborne&amp;quot;&amp;gt;Grant Osborne&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, July 04, 2008&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-9&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-9&quot;&gt;[9]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:50 --&gt; . Whether the effort of the rank-indexed magic-factor plus additional pointer indirection pays off the memory saving is another question, and should be tried inside a concrete chess program with its individual cache- and memory footprint.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:12:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 aFileAttacks[4*32+4*16]; // 1.5KByte&amp;lt;br/&amp;gt;U64 aPtrFileAttacks[8]; // points to appropriate aFileAttacks&amp;lt;br/&amp;gt;U64 fileMagic[8] = {&amp;lt;br/&amp;gt;   0xEFFFA39DB01B23A3, // 5-bit&amp;lt;br/&amp;gt;   0xF024691A3227FF42, // 4-bit&amp;lt;br/&amp;gt;   0xF2808817CAD6FF0C, // 4-bit see below&amp;lt;br/&amp;gt;   0xED6EDFBE467977D5, // 5-bit&amp;lt;br/&amp;gt;   0xEC87CB0D961EC43A, // 5-bit&amp;lt;br/&amp;gt;   0xF2FF594E14D8801C, // 4-bit&amp;lt;br/&amp;gt;   0xF2FF5D69D4E3E7D6, // 4-bit&amp;lt;br/&amp;gt;   0xEE404B349599FF88  // 5-bit&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 fileAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   unsigned int file = sq &amp;amp;amp;  7;&amp;lt;br/&amp;gt;   unsigned int rank = sq &amp;amp;gt;&amp;amp;gt; 3;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;   occ =  0x0001010101010100 &amp;amp;amp; (occ &amp;amp;gt;&amp;amp;gt; file);&amp;lt;br/&amp;gt;   occ = (fileMagic[rank] * occ) &amp;amp;gt;&amp;amp;gt; (fileMagic[rank] &amp;amp;gt;&amp;amp;gt; 58);  // four&amp;amp;amp;five bit index&amp;lt;br/&amp;gt;   return *(aPtrFileAttacks[rank] + occ) &amp;amp;lt;&amp;amp;lt; file;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 aFileAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 1.5KByte&lt;/span&gt;
U64 aPtrFileAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// points to appropriate aFileAttacks&lt;/span&gt;
U64 fileMagic&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;nu12&quot;&gt;0xEFFFA39DB01B23A3&lt;/span&gt;, &lt;span class=&quot;co1&quot;&gt;// 5-bit&lt;/span&gt;
   &lt;span class=&quot;nu12&quot;&gt;0xF024691A3227FF42&lt;/span&gt;, &lt;span class=&quot;co1&quot;&gt;// 4-bit&lt;/span&gt;
   &lt;span class=&quot;nu12&quot;&gt;0xF2808817CAD6FF0C&lt;/span&gt;, &lt;span class=&quot;co1&quot;&gt;// 4-bit see below&lt;/span&gt;
   &lt;span class=&quot;nu12&quot;&gt;0xED6EDFBE467977D5&lt;/span&gt;, &lt;span class=&quot;co1&quot;&gt;// 5-bit&lt;/span&gt;
   &lt;span class=&quot;nu12&quot;&gt;0xEC87CB0D961EC43A&lt;/span&gt;, &lt;span class=&quot;co1&quot;&gt;// 5-bit&lt;/span&gt;
   &lt;span class=&quot;nu12&quot;&gt;0xF2FF594E14D8801C&lt;/span&gt;, &lt;span class=&quot;co1&quot;&gt;// 4-bit&lt;/span&gt;
   &lt;span class=&quot;nu12&quot;&gt;0xF2FF5D69D4E3E7D6&lt;/span&gt;, &lt;span class=&quot;co1&quot;&gt;// 4-bit&lt;/span&gt;
   &lt;span class=&quot;nu12&quot;&gt;0xEE404B349599FF88&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// 5-bit&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
U64 fileAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; file &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; rank &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   occ &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  &lt;span class=&quot;nu12&quot;&gt;0x0001010101010100&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; file&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;fileMagic&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;rank&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; occ&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;fileMagic&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;rank&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;58&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// four&amp;amp;five bit index&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;aPtrFileAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;rank&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; occ&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; file&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:12 --&gt;The table demonstrates how it works for file-attack of the a3 rook with a four bit range only five relevant occupied bits, since a3 is member of the inner six bits. The empirical determined factor is 0xF2808817CAD6FF0C, six upper bits contain the right shift for the product, for this square shift 60:&lt;br /&gt;
&lt;tt&gt;&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;occupancy (A-File)&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;product&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;index 0..15&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;attack set&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;o - outer squares don&#039;t care&lt;br /&gt;
x - empty or any piece&lt;br /&gt;
. - empty&lt;br /&gt;
b - Blocker - any piece&lt;br /&gt;
R - Rook&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;occupancy *&lt;br /&gt;
0xF2808817CAD6FF0C&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;upper&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/Nibble&quot;&gt;nibble&lt;/a&gt;&lt;br /&gt;
in&lt;br /&gt;
product&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;1 attacked&lt;br /&gt;
. not attacked&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;o&lt;br /&gt;
x&lt;br /&gt;
x&lt;br /&gt;
x&lt;br /&gt;
b&lt;br /&gt;
R&lt;br /&gt;
b&lt;br /&gt;
o&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1. attack-set&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
1&lt;br /&gt;
.&lt;br /&gt;
1&lt;br /&gt;
.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0000010101000100&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x3A28F9D5E2FF0C00&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;3&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000001000100&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0001010101000100&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x3934F9D5E2FF0C00&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;3&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000001000100&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0000000101000100&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x6329EDD5E2FF0C00&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;6&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000001000100&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0000010001000100&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x6F51FAC9E2FF0C00&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;6&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000001000100&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0001000101000100&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x6235EDD5E2FF0C00&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;6&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000001000100&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0001010001000100&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x6E5DFAC9E2FF0C00&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;6&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000001000100&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0000000001000100&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x9852EEC9E2FF0C00&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;9&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000001000100&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0001000001000100&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x975EEEC9E2FF0C00&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;9&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000001000100&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;o&lt;br /&gt;
x&lt;br /&gt;
x&lt;br /&gt;
x&lt;br /&gt;
b&lt;br /&gt;
R&lt;br /&gt;
.&lt;br /&gt;
o&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;2. attack set&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
1&lt;br /&gt;
.&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0000000001000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x17CAD6FF0C000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000001000101&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0001000001000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x16D6D6FF0C000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000001000101&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0000010101000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0xB9A0E20B0C000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;11&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000001000101&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0001010101000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0xB8ACE20B0C000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;11&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000001000101&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0000000101000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0xE2A1D60B0C000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;14&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000001000101&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0000010001000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0xEEC9E2FF0C000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;14&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000001000101&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0001000101000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0xE1ADD60B0C000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;14&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000001000101&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0001010001000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0xEDD5E2FF0C000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;14&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000001000101&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;o&lt;br /&gt;
x&lt;br /&gt;
x&lt;br /&gt;
b&lt;br /&gt;
.&lt;br /&gt;
R&lt;br /&gt;
b&lt;br /&gt;
o&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;3. attack set&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
.&lt;br /&gt;
1&lt;br /&gt;
.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0001010100000100&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x216A22D6D6FF0C00&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;2&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000101000100&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0000010100000100&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x225E22D6D6FF0C00&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;2&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000101000100&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0000000100000100&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x4B5F16D6D6FF0C00&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;4&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000101000100&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0001000100000100&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x4A6B16D6D6FF0C00&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;4&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000101000100&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;o&lt;br /&gt;
x&lt;br /&gt;
x&lt;br /&gt;
b&lt;br /&gt;
.&lt;br /&gt;
R&lt;br /&gt;
.&lt;br /&gt;
o&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;4. attack set&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
.&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0000010100000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0xA1D60B0C00000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;10&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000101000101&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0001010100000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0xA0E20B0C00000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;10&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000101000101&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0000000100000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0xCAD6FF0C00000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;12&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000101000101&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0001000100000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0xC9E2FF0C00000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;12&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000101000101&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;o&lt;br /&gt;
x&lt;br /&gt;
b&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
R&lt;br /&gt;
b&lt;br /&gt;
o&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;5. attack set&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;.&lt;br /&gt;
.&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
.&lt;br /&gt;
1&lt;br /&gt;
.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0000010000000100&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x578723CAD6FF0C00&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;5&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000010101000100&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0001010000000100&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x569323CAD6FF0C00&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;5&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000010101000100&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;o&lt;br /&gt;
x&lt;br /&gt;
b&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
R&lt;br /&gt;
.&lt;br /&gt;
o&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;6. attack set&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;.&lt;br /&gt;
.&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
.&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0000010000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0xD6FF0C0000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;13&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000010101000101&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0001010000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0xD60B0C0000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;13&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000010101000101&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;o&lt;br /&gt;
b&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
R&lt;br /&gt;
b&lt;br /&gt;
o&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;7. attack set&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;.&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
.&lt;br /&gt;
1&lt;br /&gt;
.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0001000000000100&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x7F9417CAD6FF0C00&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;7&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0001010101000100&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;o&lt;br /&gt;
b&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
R&lt;br /&gt;
.&lt;br /&gt;
o&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;8. attack set&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;.&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
.&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0001000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0xFF0C000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;15&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0001010101000101&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;o&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
R&lt;br /&gt;
b&lt;br /&gt;
o&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;9. attack set&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;1&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
.&lt;br /&gt;
1&lt;br /&gt;
.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0000000000000100&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x808817CAD6FF0C00&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;8&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0101010101000100&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;o&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
R&lt;br /&gt;
.&lt;br /&gt;
o&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;10. attack set,&lt;br /&gt;
no blocker&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;1&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
.&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0000000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x0000000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0101010101000101&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;/tt&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:65:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc5&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:65 --&gt;See also&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Flipping%20Mirroring%20and%20Rotating#RankFileAndDiagonal&quot;&gt;Flipping, Mirroring and Rotating of Rank, File and Diagonal&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards&quot;&gt;Magic Bitboards&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Occupancy%20of%20any%20Line&quot;&gt;Occupancy of any Line&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Rotated%20Bitboards&quot;&gt;Rotated Bitboards&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/OliThink#SlidingPieceAttacks&quot;&gt;Sliding Piece Attacks in OliThink&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Winglet#SlidingAttacks&quot;&gt;Sliding Piece Attacks in Winglet&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:67:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc6&quot;&gt;&lt;a name=&quot;Forum Posts&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:67 --&gt;Forum Posts&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://groups.google.com/d/msg/rec.games.chess.computer/YvFagyuVogw/2vNJw_qT8IYJ&quot; rel=&quot;nofollow&quot;&gt;Re: Rotated bitboards&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Urban%20Koistinen&quot;&gt;Urban Koistinen&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;rgcc&lt;/a&gt;, October 31, 1997 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Occupancy%20of%20any%20Line#CollapsedFiles&quot;&gt;Collapsed files&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Occupancy%20of%20any%20Line#CollapsedRanks&quot;&gt;Collapsed ranks&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=489834&quot; rel=&quot;nofollow&quot;&gt;rotated bitboards obsolete?&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, February 26, &lt;a class=&quot;wiki_link&quot; href=&quot;/Timeline#2006&quot;&gt;2006&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=491079&quot; rel=&quot;nofollow&quot;&gt;Re: Some thoughts on Dann Corbit&#039;s rotated alternative&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Steffan%20Westcott&quot;&gt;Steffan Westcott&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, March 03, 2006&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?t=4523&quot; rel=&quot;nofollow&quot;&gt;Compact Bitboard Attacks&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Tom%20Likens&quot;&gt;Tom Likens&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, March 14, &lt;a class=&quot;wiki_link&quot; href=&quot;/Timeline#2006&quot;&gt;2006&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?topic_view=threads&amp;amp;p=26851&amp;amp;t=4523&quot; rel=&quot;nofollow&quot;&gt;Zach&#039;s tricky 32-bit approach&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Zach%20Wegner&quot;&gt;Zach Wegner&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, August 22, &lt;a class=&quot;wiki_link&quot; href=&quot;/Timeline#2006&quot;&gt;2006&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;t=5958&quot; rel=&quot;nofollow&quot;&gt;Magic Bitboards Explained!&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Michael%20Sherwin&quot;&gt;Michael Sherwin&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, December 04, 2006&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=24724&quot; rel=&quot;nofollow&quot;&gt;Kindergarten Bitboard Approach by Gerd Isenberg&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Edsel%20Apostol&quot;&gt;Edsel Apostol&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, November 05, 2008 » &lt;a class=&quot;wiki_link&quot; href=&quot;/OliThink&quot;&gt;OliThink&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=29296&quot; rel=&quot;nofollow&quot;&gt;Kindergarten bitboards without multiplying&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Piotr%20Cichy&quot;&gt;Piotr Cichy&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 07, 2009&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=30742&quot; rel=&quot;nofollow&quot;&gt;Kindergarten Bitboard help&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gregory%20Strong&quot;&gt;Gregory Strong&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, November 22, 2009&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;t=50616&amp;amp;p=192200&quot; rel=&quot;nofollow&quot;&gt;32-bit Magic experiments&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Andrew%20Fan&quot;&gt;Andrew Fan&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, December 03, 2009 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards&quot;&gt;Magic Bitboards&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=31348&quot; rel=&quot;nofollow&quot;&gt;Kindergarten bitboards and Xiangqi move genaration?&lt;/a&gt; by Han Chengye, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, December 30, 2009 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Chinese%20Chess&quot;&gt;Chinese Chess&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:69:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc7&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:69 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Kindergarten&quot; rel=&quot;nofollow&quot;&gt;Kindergarten from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#GeorgeBenson&quot;&gt;George Benson&lt;/a&gt; -  &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/This_Masquerade&quot; rel=&quot;nofollow&quot;&gt;This Masquerade&lt;/a&gt;, 1976, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/YouTube&quot; rel=&quot;nofollow&quot;&gt;YouTube&lt;/a&gt; Video&lt;br /&gt;
&lt;!-- ws:start:WikiTextMediaRule:51:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/youtube/T8eXCdjdSHE?h=315&amp;amp;w=560&amp;quot; class=&amp;quot;WikiMedia WikiMediaYoutube&amp;quot; id=&amp;quot;wikitext@@media@@type=&amp;amp;quot;youtube&amp;amp;quot; key=&amp;amp;quot;T8eXCdjdSHE&amp;amp;quot; width=&amp;amp;quot;560&amp;amp;quot;&amp;quot; title=&amp;quot;YouTube Video&amp;quot;height=&amp;quot;315&amp;quot; width=&amp;quot;560&amp;quot;/&amp;gt; --&gt;&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/T8eXCdjdSHE&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;!-- ws:end:WikiTextMediaRule:51 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#PatMetheny&quot;&gt;Pat Metheny&lt;/a&gt; and friends - &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/This_Masquerade&quot; rel=&quot;nofollow&quot;&gt;This Masquerade&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Jazz_Baltica&quot; rel=&quot;nofollow&quot;&gt;Jazz Baltica&lt;/a&gt;, July 6, 2003, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/YouTube&quot; rel=&quot;nofollow&quot;&gt;YouTube&lt;/a&gt; Video&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Nils_Landgren_%28musician%29&quot; rel=&quot;nofollow&quot;&gt;Nils Landgren&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#LarsDanielsson&quot;&gt;Lars Danielsson&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Wolfgang_Haffner&quot; rel=&quot;nofollow&quot;&gt;Wolfgang Haffner&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Esbj%C3%B6rn_Svensson&quot; rel=&quot;nofollow&quot;&gt;Esbjörn Svensson&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#PatMetheny&quot;&gt;Pat Metheny&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#MichaelBrecker&quot;&gt;Michael Brecker&lt;/a&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextMediaRule:52:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/custom/23645450?h=0&amp;amp;w=0&amp;quot; class=&amp;quot;WikiMedia WikiMediaCustom&amp;quot; id=&amp;quot;wikitext@@media@@type=&amp;amp;quot;custom&amp;amp;quot; key=&amp;amp;quot;23645450&amp;amp;quot;&amp;quot; title=&amp;quot;Custom Media&amp;quot;/&amp;gt; --&gt;&lt;iframe width=&quot;560&quot; height=&quot;360&quot; src=&quot;//www.youtube.com/embed/Lzrp7H4j8TE?rel=0&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;&lt;!-- ws:end:WikiTextMediaRule:52 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:71:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc8&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:71 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:1105:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;t=5958&quot; rel=&quot;nofollow&quot;&gt;Magic Bitboards Explained!&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Michael%20Sherwin&quot;&gt;Michael Sherwin&lt;/a&gt; and reply by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt; to call it Kindergarten Bitboards, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, December 4, &lt;a class=&quot;wiki_link&quot; href=&quot;/Timeline#2006&quot;&gt;2006&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?t=4523&quot; rel=&quot;nofollow&quot;&gt;Compact Bitboard Attacks&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Tom%20Likens&quot;&gt;Tom Likens&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, March 14, &lt;a class=&quot;wiki_link&quot; href=&quot;/Timeline#2006&quot;&gt;2006&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-3&quot;&gt;&lt;a href=&quot;#cite_ref-3&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=489834&quot; rel=&quot;nofollow&quot;&gt;rotated bitboards obsolete?&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, February 26, &lt;a class=&quot;wiki_link&quot; href=&quot;/Timeline#2006&quot;&gt;2006&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-4&quot;&gt;&lt;a href=&quot;#cite_ref-4&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=491079&quot; rel=&quot;nofollow&quot;&gt;Re: Some thoughts on Dann Corbit&#039;s rotated alternative&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Steffan%20Westcott&quot;&gt;Steffan Westcott&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, March 03, 2006&lt;/li&gt;
&lt;li id=&quot;cite_note-5&quot;&gt;&lt;a href=&quot;#cite_ref-5&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.imj.org.il/imagine/collections/viewDataE5.asp?case=Modern%20Art&quot; rel=&quot;nofollow&quot;&gt;IMAGINE - The Israel Museum&#039;s searchable collections database&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-6&quot;&gt;&lt;a href=&quot;#cite_ref-6&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=29296&quot; rel=&quot;nofollow&quot;&gt;Kindergarten bitboards without multiplying&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Piotr%20Cichy&quot;&gt;Piotr Cichy&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 07, 2009&lt;/li&gt;
&lt;li id=&quot;cite_note-7&quot;&gt;&lt;a href=&quot;#cite_ref-7&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?topic_view=threads&amp;amp;p=26851&amp;amp;t=4523&quot; rel=&quot;nofollow&quot;&gt;Zach&#039;s tricky 32-bit approach&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Zach%20Wegner&quot;&gt;Zach Wegner&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, August 22, 2006&lt;/li&gt;
&lt;li id=&quot;cite_note-8&quot;&gt;&lt;a href=&quot;#cite_ref-8&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;t=50616&amp;amp;p=192200&quot; rel=&quot;nofollow&quot;&gt;32-bit Magic experiments&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Andrew%20Fan&quot;&gt;Andrew Fan&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, December 03, 2009&lt;/li&gt;
&lt;li id=&quot;cite_note-9&quot;&gt;&lt;a href=&quot;#cite_ref-9&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;p=198660&amp;amp;t=21329&quot; rel=&quot;nofollow&quot;&gt;Re: How to reduce the &amp;quot;bits&amp;quot; used in a magic number&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Grant%20Osborne&quot;&gt;Grant Osborne&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, July 04, 2008&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:1105 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:73:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc9&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:73 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:014:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Kindergarten Bitboards&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Kindergarten Bitboards&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Kindergarten_Bitboards includeBody-Kindergarten%20Bitboards includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tfoot class=&quot;includeBacklinksFooter&quot;&gt;
    &lt;tr&gt;
      &lt;td colspan=&quot;5&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/page/links/Kindergarten+Bitboards&quot;&gt;More Links&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tfoot&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Andreas+Guettinger&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Andreas Guettinger&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 14, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Andrew+Fan&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Andrew Fan&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 30, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Array&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Array&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 1, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitboard+Serialization&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitboard Serialization&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 24, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BMI2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BMI2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Chinese+Chess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Chinese Chess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 16, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Chiron&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Chiron&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Congruent+Modulo+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Congruent Modulo Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 26, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Efficient+Generation+of+Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Efficient Generation of Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Exploding+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Exploding Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 9, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Firefly&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Firefly&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 23, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/First+Rank+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;First Rank Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 28, 2010&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Flipping+Mirroring+and+Rotating&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Flipping Mirroring and Rotating&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 14, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Grant+Osborne&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Grant Osborne&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 2, 2011&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gregory+Strong&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gregory Strong&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hash+Table&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hash Table&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 1, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hashing+Dictionaries&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hashing Dictionaries&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 1, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hiding+the+Implementation&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hiding the Implementation&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 3, 2011&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hyperbola+Quintessence&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hyperbola Quintessence&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Jazz&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Jazz&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 4, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kindergarten+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kindergarten Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 1, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kurt&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kurt&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 20, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Magic+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Magic Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 13, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mark+Levene&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mark Levene&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 2, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Occupancy+of+any+Line&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Occupancy of any Line&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 16, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/OliThink&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;OliThink&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 19, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Protector&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Protector&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 12, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rodent&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rodent&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 11, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rotated+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rotated Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SIMD+techniques&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SIMD techniques&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 26, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Simplex&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Simplex&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sjaak+%28Glebbeek%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sjaak (Glebbeek)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 4, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Space-Time+Tradeoff&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Space-Time Tradeoff&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 17, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sungorus&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sungorus&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 11, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Tigran&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Tigran&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 16, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Tom+Likens&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Tom Likens&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Trevor+Fenner&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Trevor Fenner&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 2, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Vajolet&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Vajolet&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:014 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Magic Bitboards</title>
      <link>https://chessprogramming.wikispaces.com/Magic+Bitboards</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Magic+Bitboards</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Magic+Bitboards</comments>
      <pubDate>Fri, 13 Apr 2018 13:09:31 GMT</pubDate>
      <description>&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Board%20Representation&quot;&gt;Board Representation&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Bitboards&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Sliding Piece Attacks&lt;/a&gt; * Magic Bitboards&lt;/strong&gt;&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:678:&amp;lt;a href=&amp;quot;http://www.puckergallery.com/artists/bak_major/bak_major_all.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/AuspiciousMoon.jpg/157861339/305x245/AuspiciousMoon.jpg&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; style=&amp;quot;height: 245px; width: 305px;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;http://www.puckergallery.com/artists/bak_major/bak_major_all.html&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/AuspiciousMoon.jpg/157861339/305x245/AuspiciousMoon.jpg&quot; alt=&quot;AuspiciousMoon.jpg&quot; title=&quot;AuspiciousMoon.jpg&quot; style=&quot;height: 245px; width: 305px;&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:678 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td rowspan=&quot;2&quot;&gt;&lt;strong&gt;Magic bitboards&lt;/strong&gt;,&lt;br /&gt;
a multiply-right-shift &lt;a class=&quot;wiki_link&quot; href=&quot;/Hash%20Table#PerfectHashing&quot;&gt;perfect hashing&lt;/a&gt; algorithm to index an attack bitboard database - which leaves both line-attacks of bishop or rook in one run. Thanks to the fast 64-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Multiplication&quot;&gt;multiplication&lt;/a&gt; and fast and huge &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Cache&quot; rel=&quot;nofollow&quot;&gt;caches&lt;/a&gt; of recent processors, Magic Bitboards has become a &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/De_facto_standard&quot; rel=&quot;nofollow&quot;&gt;de facto standard&lt;/a&gt; of modern bitboard engines, as used for instance in &lt;a class=&quot;wiki_link&quot; href=&quot;/Crafty&quot;&gt;Crafty&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Arasan&quot;&gt;Arasan&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Stockfish&quot;&gt;Stockfish&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Houdini&quot;&gt;Houdini&lt;/a&gt;. While &lt;a class=&quot;wiki_link&quot; href=&quot;/Robert%20Hyatt&quot;&gt;Robert Hyatt&lt;/a&gt; reported no immediate speed gain over &lt;a class=&quot;wiki_link&quot; href=&quot;/Rotated%20Bitboards&quot;&gt;Rotated Bitboards&lt;/a&gt; in Crafty &lt;!-- ws:start:WikiTextRefRule:16:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;amp;p=140141&amp;amp;amp;t=16002&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: BitBoard Tests Magic v Non-Rotated 32 Bits v 64 Bits&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Robert%20Hyatt&amp;quot;&amp;gt;Robert Hyatt&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, August 25, 2007&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:16 --&gt; , &lt;a class=&quot;wiki_link&quot; href=&quot;/Jon%20Dart&quot;&gt;Jon Dart&lt;/a&gt; mentioned a 20-25% speedup &lt;!-- ws:start:WikiTextRefRule:19:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.arasanchess.org/blogs/aug08.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Arasan Blog - Aug 26, 2008&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Jon%20Dart&amp;quot;&amp;gt;Jon Dart&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:19 --&gt; in Arasan over rotated.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Arts#Bak&quot;&gt;Samuel Bak&lt;/a&gt; - Auspicious Moon, 2001 &lt;!-- ws:start:WikiTextRefRule:22:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.puckergallery.com/artists/bak_major/bak_major_all.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Major Works&amp;lt;/a&amp;gt; from &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.puckergallery.com/artists/bak_index/bak_publications.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Samuel Bak - represented by Pucker Gallery since 1969&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-3&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:22 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextTocRule:179:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:179 --&gt;&lt;!-- ws:start:WikiTextTocRule:180: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#History&quot;&gt;History&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:180 --&gt;&lt;!-- ws:start:WikiTextTocRule:181: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#How it works&quot;&gt;How it works&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:181 --&gt;&lt;!-- ws:start:WikiTextTocRule:182: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Perfect Hashing&quot;&gt;Perfect Hashing&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:182 --&gt;&lt;!-- ws:start:WikiTextTocRule:183: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Perfect Hashing-Wishing Dreams&quot;&gt;Wishing Dreams&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:183 --&gt;&lt;!-- ws:start:WikiTextTocRule:184: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Implementations&quot;&gt;Implementations&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:184 --&gt;&lt;!-- ws:start:WikiTextTocRule:185: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Implementations-Fancy&quot;&gt;Fancy&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:185 --&gt;&lt;!-- ws:start:WikiTextTocRule:186: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Implementations-Plain&quot;&gt;Plain&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:186 --&gt;&lt;!-- ws:start:WikiTextTocRule:187: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Implementations-Fixed shift Fancy&quot;&gt;Fixed shift Fancy&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:187 --&gt;&lt;!-- ws:start:WikiTextTocRule:188: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Implementations-Black Magic Bitboards&quot;&gt;Black Magic Bitboards&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:188 --&gt;&lt;!-- ws:start:WikiTextTocRule:189: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Implementations-Byte Lookup&quot;&gt;Byte Lookup&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:189 --&gt;&lt;!-- ws:start:WikiTextTocRule:190: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Implementations-32-bit Magics&quot;&gt;32-bit Magics&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:190 --&gt;&lt;!-- ws:start:WikiTextTocRule:191: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Implementations-Sharing Attacks&quot;&gt;Sharing Attacks&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:191 --&gt;&lt;!-- ws:start:WikiTextTocRule:192: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Implementations-Incorporating the Shift&quot;&gt;Incorporating the Shift&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:192 --&gt;&lt;!-- ws:start:WikiTextTocRule:193: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Implementations-Incorporating Offset&quot;&gt;Incorporating Offset&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:193 --&gt;&lt;!-- ws:start:WikiTextTocRule:194: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Implementations-Initalization&quot;&gt;Initalization&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:194 --&gt;&lt;!-- ws:start:WikiTextTocRule:195: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Implementations-Initalization-Looking for Magics&quot;&gt;Looking for Magics&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:195 --&gt;&lt;!-- ws:start:WikiTextTocRule:196: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Implementations-Initalization-Magic Records&quot;&gt;Magic Records&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:196 --&gt;&lt;!-- ws:start:WikiTextTocRule:197: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:197 --&gt;&lt;!-- ws:start:WikiTextTocRule:198: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Publications&quot;&gt;Publications&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:198 --&gt;&lt;!-- ws:start:WikiTextTocRule:199: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Forum Posts&quot;&gt;Forum Posts&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:199 --&gt;&lt;!-- ws:start:WikiTextTocRule:200: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Forum Posts-2006&quot;&gt;2006&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:200 --&gt;&lt;!-- ws:start:WikiTextTocRule:201: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Forum Posts-2007&quot;&gt;2007&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:201 --&gt;&lt;!-- ws:start:WikiTextTocRule:202: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Forum Posts-2008&quot;&gt;2008&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:202 --&gt;&lt;!-- ws:start:WikiTextTocRule:203: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Forum Posts-2009&quot;&gt;2009&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:203 --&gt;&lt;!-- ws:start:WikiTextTocRule:204: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Forum Posts-2010 ...&quot;&gt;2010 ...&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:204 --&gt;&lt;!-- ws:start:WikiTextTocRule:205: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Forum Posts-2015 ...&quot;&gt;2015 ...&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:205 --&gt;&lt;!-- ws:start:WikiTextTocRule:206: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:206 --&gt;&lt;!-- ws:start:WikiTextTocRule:207: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Other Magic Stuff&quot;&gt;Other Magic Stuff&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:207 --&gt;&lt;!-- ws:start:WikiTextTocRule:208: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:208 --&gt;&lt;!-- ws:start:WikiTextTocRule:209: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:209 --&gt;&lt;!-- ws:start:WikiTextTocRule:210: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:210 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:119:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;History&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:119 --&gt;History&lt;/h1&gt;
 The magic bitboard approach was motivated by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&#039;s&lt;/a&gt; multi-direction hashing technique &lt;a class=&quot;wiki_link&quot; href=&quot;/Kindergarten%20Bitboards&quot;&gt;kindergarten bitboards&lt;/a&gt; and probably by Gerd&#039;s and &lt;a class=&quot;wiki_link&quot; href=&quot;/Tony%20van%20Roon-Werten&quot;&gt;Tony van Roon-Werten&#039;s&lt;/a&gt; early trials to map line-wise &lt;a class=&quot;wiki_link&quot; href=&quot;/Occupancy&quot;&gt;occupancies&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/De%20Bruijn%20sequence&quot;&gt;De Bruijn&lt;/a&gt;- or random number multiplication &lt;!-- ws:start:WikiTextRefRule:26:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.stmintz.com/ccc/index.php?id=489834&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;rotated bitboards obsolete?&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Gerd%20Isenberg&amp;quot;&amp;gt;Gerd Isenberg&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, February 26, 2006&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-4&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-4&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:26 --&gt; . &lt;a class=&quot;wiki_link&quot; href=&quot;/Lasse%20Hansen&quot;&gt;Lasse Hansen&lt;/a&gt; had the idea to hash the up to twelve relevant occupied bits of &lt;strong&gt;both directions&lt;/strong&gt; of a rook- or bishop movement simultaneously &lt;!-- ws:start:WikiTextRefRule:31:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.open-aurec.com/wbforum/viewtopic.php?t=5015&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Fast(er) bitboard move generator&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Lasse%20Hansen&amp;quot;&amp;gt;Lasse Hansen&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;Winboard Forum&amp;lt;/a&amp;gt;, June 14, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Timeline#2006&amp;quot;&amp;gt;2006&amp;lt;/a&amp;gt;, Initial idea&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-5&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-5&quot;&gt;[5]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:31 --&gt; .&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/Pradu%20Kannan&quot;&gt;Pradu Kannan&#039;s&lt;/a&gt; improvements to Lasse Hansen&#039;s initial approach was to introduce a &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt;-like, two-dimensional &lt;a class=&quot;wiki_link&quot; href=&quot;/Array&quot;&gt;array&lt;/a&gt; with individual size for each square and all it&#039;s relevant occupancies &lt;!-- ws:start:WikiTextRefRule:38:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Pradu%20Kannan&amp;quot;&amp;gt;Pradu Kannan&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;2007&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;Magic Move-Bitboard Generation in Computer Chess&amp;lt;/em&amp;gt;, as &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.pradu.us/old/Nov27_2008/Buzz/research/magic/Bitboards.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;pdf&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-6&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-6&quot;&gt;[6]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:38 --&gt; . Big savings in table-size - since many squares on either orthogonal or diagonal lines require less bits than others, especially considering the &lt;a class=&quot;wiki_link&quot; href=&quot;/First%20Rank%20Attacks#TheOuterSquares&quot;&gt;inner six bits&lt;/a&gt;. While center squares are more dense for rooks, it is the opposite for bishops &lt;!-- ws:start:WikiTextRefRule:43:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.open-aurec.com/wbforum/viewtopic.php?t=5441&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;List of magics for bitboard move generation&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Pradu%20Kannan&amp;quot;&amp;gt;Pradu Kannan&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;Winboard Forum&amp;lt;/a&amp;gt;, August 23, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Timeline#2006&amp;quot;&amp;gt;2006&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-7&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-7&quot;&gt;[7]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:43 --&gt; .&lt;br /&gt;
&lt;br /&gt;
Recently, &lt;a class=&quot;wiki_link&quot; href=&quot;/Robert%20Purves&quot;&gt;Robert Purves&lt;/a&gt; coined the names Plain and Fancy Magics &lt;!-- ws:start:WikiTextRefRule:47:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=35858&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Plain and fancy magic on modern hardware&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Robert%20Purves&amp;quot;&amp;gt;Robert Purves&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, August 22, 2010&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-8&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-8&quot;&gt;[8]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:47 --&gt; , and found Hansen&#039;s initial Plain Magics with 2 MiB table for rooks and 256 KiB for bishops nearly indistinguishable from Fancy (about 800 KiB and 38 KiB) on his &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Intel_Core_i5&quot; rel=&quot;nofollow&quot;&gt;Intel i5&lt;/a&gt; with huge L3 smart cache, see &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards#Plain&quot;&gt;plain&lt;/a&gt; versus &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards#Fancy&quot;&gt;fancy&lt;/a&gt; source code. In the same &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt; forum thread, &lt;a class=&quot;wiki_link&quot; href=&quot;/Robert%20Houdart&quot;&gt;Robert Houdart&lt;/a&gt; proposed a &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards#ByteLookup&quot;&gt;byte lookup&lt;/a&gt; per square for further table reductions.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:121:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;How it works&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:121 --&gt;How it works&lt;/h1&gt;
 A magic move-bitboard generation technique consists of four key steps:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Mask the relevant occupancy bits to form a key. For example if you had a rook on a1, the relevant occupancy bits will be from a2-a7 and b1-g1.&lt;/li&gt;&lt;li&gt;Multiply the key by a &amp;quot;magic number&amp;quot; to obtain an index mapping. This magic number can be generated by brute-force &lt;a class=&quot;wiki_link&quot; href=&quot;/Trial%20and%20Error&quot;&gt;trial and error&lt;/a&gt; quite easily although it isn&#039;t 100% certain that the magic number is the best possible (see step 3).&lt;/li&gt;&lt;li&gt;Right shift the index mapping by 64-n bits to create an index, where n is the number of bits in the index. A better magic number will have less bits required in the index.&lt;/li&gt;&lt;li&gt;Use the index to reference a preinitialized move database.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;
The following illustration should give an impression, how magic bitboards work. All masked relevant occupied bits are perfectly hashed to the consecutive occupied state to index the pre-calculated attack-sets. Constructive collisions, where different occupancies map same attack-sets - since different bits are outer redundant bits &amp;quot;behind&amp;quot; the first blocker, are desired and even necessary to apply a perfect hashing with N bits.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;                                        any consecutive&amp;lt;br/&amp;gt;relevant occupancy                      combination of&amp;lt;br/&amp;gt;bishop b1, 5 bits                       the masked bits&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . .[C D E F G]&amp;lt;br/&amp;gt;. . . . . . . .     . 1 . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . G .     . 1 . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . F . .     . 1 . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . E . . .  *  . 1 . . . . . .  =  . . garbage . .    &amp;amp;gt;&amp;amp;gt; (64- 5)&amp;lt;br/&amp;gt;. . . D . . . .     . 1 . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . C . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;                                        any consecutive&amp;lt;br/&amp;gt;relevant occupancy                      combination of&amp;lt;br/&amp;gt;bishop d4, 9 bits                       the masked bits&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     2 4 5 B C E F G]&amp;lt;br/&amp;gt;. . . . . . G .     . . .some . . .     . . . . . . .[1&amp;lt;br/&amp;gt;. 5 . . . F . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . 4 . E . . .     . . .magic. . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .  *  . . . . . . . .  =  . . garbage . .    &amp;amp;gt;&amp;amp;gt; (64- 9)&amp;lt;br/&amp;gt;. . C . 2 . . .     . . .bits . . .     . . . . . . . .&amp;lt;br/&amp;gt;. B . . . 1 . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;                                        any consecutive&amp;lt;br/&amp;gt;relevant occupancy                      combination of&amp;lt;br/&amp;gt;rook d4, 10 bits                        the masked bits&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     4 5 6 B C E F G]&amp;lt;br/&amp;gt;. . . 6 . . . .     . . .some . . .     . . . . . .[1 2&amp;lt;br/&amp;gt;. . . 5 . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . 4 . . . .     . . .magic. . .     . . . . . . . .&amp;lt;br/&amp;gt;. B C . E F G .  *  . . . . . . . .  =  . . garbage . .    &amp;amp;gt;&amp;amp;gt; (64-10)&amp;lt;br/&amp;gt;. . . 2 . . . .     . . .bits . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . 1 . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;                                        any consecutive&amp;lt;br/&amp;gt;relevant occupancy                      combination of&amp;lt;br/&amp;gt;rook a1, 12 bits                        the masked bits&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     5 6 B C D E F G]&amp;lt;br/&amp;gt;6 . . . . . . .     . . .some . . .     . . . .[1 2 3 4&amp;lt;br/&amp;gt;5 . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;4 . . . . . . .     . . .magic. . .     . . . . . . . .&amp;lt;br/&amp;gt;3 . . . . . . .  *  . . . . . . . .  =  . . garbage . .    &amp;amp;gt;&amp;amp;gt; (64-12)&amp;lt;br/&amp;gt;2 . . . . . . .     . . .bits . . .     . . . . . . . .&amp;lt;br/&amp;gt;1 . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. B C D E F G .     . . . . . . . .     . . . . . . . .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;                                        any consecutive
relevant occupancy                      combination of
bishop b1, 5 bits                       the masked bits
. . . . . . . .     . . . . . . . .     . . .[C D E F G]
. . . . . . . .     . 1 . . . . . .     . . . . . . . .
. . . . . . G .     . 1 . . . . . .     . . . . . . . .
. . . . . F . .     . 1 . . . . . .     . . . . . . . .
. . . . E . . .  *  . 1 . . . . . .  =  . . garbage . .    &amp;gt;&amp;gt; (64- 5)
. . . D . . . .     . 1 . . . . . .     . . . . . . . .
. . C . . . . .     . . . . . . . .     . . . . . . . .
. . . . . . . .     . . . . . . . .     . . . . . . . .
&amp;nbsp;
                                        any consecutive
relevant occupancy                      combination of
bishop d4, 9 bits                       the masked bits
. . . . . . . .     . . . . . . . .     2 4 5 B C E F G]
. . . . . . G .     . . .some . . .     . . . . . . .[1
. 5 . . . F . .     . . . . . . . .     . . . . . . . .
. . 4 . E . . .     . . .magic. . .     . . . . . . . .
. . . . . . . .  *  . . . . . . . .  =  . . garbage . .    &amp;gt;&amp;gt; (64- 9)
. . C . 2 . . .     . . .bits . . .     . . . . . . . .
. B . . . 1 . .     . . . . . . . .     . . . . . . . .
. . . . . . . .     . . . . . . . .     . . . . . . . .
&amp;nbsp;
                                        any consecutive
relevant occupancy                      combination of
rook d4, 10 bits                        the masked bits
. . . . . . . .     . . . . . . . .     4 5 6 B C E F G]
. . . 6 . . . .     . . .some . . .     . . . . . .[1 2
. . . 5 . . . .     . . . . . . . .     . . . . . . . .
. . . 4 . . . .     . . .magic. . .     . . . . . . . .
. B C . E F G .  *  . . . . . . . .  =  . . garbage . .    &amp;gt;&amp;gt; (64-10)
. . . 2 . . . .     . . .bits . . .     . . . . . . . .
. . . 1 . . . .     . . . . . . . .     . . . . . . . .
. . . . . . . .     . . . . . . . .     . . . . . . . .
&amp;nbsp;
                                        any consecutive
relevant occupancy                      combination of
rook a1, 12 bits                        the masked bits
. . . . . . . .     . . . . . . . .     5 6 B C D E F G]
6 . . . . . . .     . . .some . . .     . . . .[1 2 3 4
5 . . . . . . .     . . . . . . . .     . . . . . . . .
4 . . . . . . .     . . .magic. . .     . . . . . . . .
3 . . . . . . .  *  . . . . . . . .  =  . . garbage . .    &amp;gt;&amp;gt; (64-12)
2 . . . . . . .     . . .bits . . .     . . . . . . . .
1 . . . . . . .     . . . . . . . .     . . . . . . . .
. B C D E F G .     . . . . . . . .     . . . . . . . .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;The above illustration is correct for the b1 bishop, since it has only one ray and one bit per file and works &lt;a class=&quot;wiki_link&quot; href=&quot;/Kindergarten%20Bitboards&quot;&gt;kindergarten&lt;/a&gt; like. In general a one to one mapping of N scattered occupied bits to N consecutive bits is not always possible due to overflows. A perfect mapping of N scattered bits to N consecutive bits is likely not minimal for most squares. It requires one or two gaps inside the consecutive N bits, to avoid collisions, blowing up the table size.&lt;br /&gt;
&lt;br /&gt;
But the purpose is to perfectly hash attack-sets rather than consecutive occupied bits. The number of distinct attack-sets is much smaller than the relevant occupancies. Thus, with the help of constructive collisions, some initial guess how to map the bits, and/or &lt;a class=&quot;wiki_link&quot; href=&quot;/Trial%20and%20Error&quot;&gt;trial and error&lt;/a&gt;, using exactly N bits is always possible. If one tries hard enough to maximize constructive collisions - even less. There are some N-1 ones reported at &lt;a class=&quot;wiki_link&quot; href=&quot;/Best%20Magics%20so%20far&quot;&gt;Best Magics so far&lt;/a&gt;, which will half the individual table size for some squares in the widespread &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards#Fancy&quot;&gt;Fancy Magic Bitboards&lt;/a&gt; approach.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:123:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Perfect Hashing&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:123 --&gt;Perfect Hashing&lt;/h1&gt;
 Magic bitboards applies &lt;a class=&quot;wiki_link&quot; href=&quot;/Hash%20Table#PerfectHashing&quot;&gt;perfect hashing&lt;/a&gt;. A &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Surjection&quot; rel=&quot;nofollow&quot;&gt;surjective function&lt;/a&gt;, to map the vector of all relevant occupancies to a range of attack-sets per square. The less bits the attack-set - the closer the blockers, the more those attack-sets are shared by occupancies with different, but redundant outer squares.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The &lt;strong&gt;cardinality&lt;/strong&gt; of all &lt;strong&gt;relevant occupancies&lt;/strong&gt; is determined by the number of bits to map, varying from five to twelve - thus, the cardinality is the power of two the number of bits, varying from 32 to 4096.&lt;/li&gt;&lt;li&gt;The &lt;strong&gt;cardinality&lt;/strong&gt; of &lt;strong&gt;distinct attack-sets&lt;/strong&gt; is determined by the product of the length of each of the max four direction rays greater than zero (or one). The rook on d4 has 3*4*3*4 = 144 distinct attack-sets, a bishop on a8 has only 7.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
The &lt;strong&gt;ratio&lt;/strong&gt; of both cardinalities, that is all &lt;strong&gt;relevant occupancies&lt;/strong&gt; versus the all &lt;strong&gt;distinct attack-sets&lt;/strong&gt; is illustrated below: As a quarter of a board - due to the symmetry, the other squares may deduced by flipping and mirroring. Noticeable is the huge 4096/49 ratio of 2^12 occupied states versus 7 times 7 attack-sets of the edge rooks - 12 bits instead of 6. Those &amp;quot;expensive&amp;quot; squares make constructive collisions very desirable. To become more &amp;quot;minimal&amp;quot; by saving an index bit - to halve down the table for one square or the other.&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th colspan=&quot;4&quot;&gt;bishop on square&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;#occs/&lt;br /&gt;
#attset&lt;br /&gt;
&lt;/th&gt;
        &lt;th colspan=&quot;4&quot;&gt;rook on square&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;A&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;B&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;C&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;D&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;A&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;B&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;C&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;D&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;8&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;64/7&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;32/6&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;32/10&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;32/ 12&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;8&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;4096/49&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;2048/42&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;2048/ 70&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;2048/ 84&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;7&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;32/6&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;32/6&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;32/10&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;32/ 12&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;7&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;2048/42&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1024/36&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1024/ 60&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1024/ 72&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;6&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;32/10&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;32/10&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;128/40&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;128/ 48&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;6&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;2048/70&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1024/60&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1024/100&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1024/120&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;5&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;32/12&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;32/12&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;128/48&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;512/108&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;5&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;2048/84&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1024/72&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1024/120&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1024/144&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th colspan=&quot;4&quot;&gt;bishop on square&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th colspan=&quot;4&quot;&gt;rook on square&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;A&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;B&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;C&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;D&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;A&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;B&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;C&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;D&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;8&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;9.14&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;5.33&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;3.20&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;2.67&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;8&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;83.59&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;48.76&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;29.26&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;24.38&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;7&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;5.33&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;5.33&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;3.20&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;2.67&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;7&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;48.76&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;28.44&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;17.07&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;14.22&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;6&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;3.20&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;3.20&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;3.20&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;2.67&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;6&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;29.26&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;17.07&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;10.24&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;8.53&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;5&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;2.67&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;2.67&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;2.67&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;4.74&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;5&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;24.38&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;14.22&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;8.53&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;7.11&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
The idea to implement minimal perfect hashing by an additional 16-bit indirection turned out to be slower (see conditional compiles in Pradu Kannan&#039;s source &lt;!-- ws:start:WikiTextRefRule:51:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.pradu.us/old/Nov27_2008/Buzz/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Buzz - A Winboard Chess Playing Program by Pradu Kannan&amp;lt;/a&amp;gt; - Source of &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Pradu%20Kannan&amp;quot;&amp;gt;Pradu Kannan&#039;s&amp;lt;/a&amp;gt; &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Magic%20Bitboards&amp;quot;&amp;gt;magic&amp;lt;/a&amp;gt; Move Generator, PERFECT_MAGIC_HASH&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-9&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-9&quot;&gt;[9]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:51 --&gt; ).&lt;br /&gt;
&lt;br /&gt;
Recent table sizes were about 38 KiB for the bishop attacks, but still about 800 KiB for rook attacks (Fancy). That sounds huge, considering L1 and L2 (L3) cache-sizes and number of cachelines and pages needed - we likely fetch distinct cachelines for each different square or occupancy. On the other hand caches and pages become larger in future processors. And occupancy and squares of the lookups don&#039;t change that randomly inside a search that we can still expect a lot of L1-hits. Unfortunately changes in occupancy outside the blockers and therefor not affecting the attack-set will introduce some more cache misses.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:125:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Perfect Hashing-Wishing Dreams&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:125 --&gt;Wishing Dreams&lt;/h2&gt;
Since there are 1428/4900 &lt;strong&gt;distinct&lt;/strong&gt; attack sets for the bishop/rook attacks, we can use 11(2048 &amp;gt; 1428)/13(8196 &amp;gt; 4900) index bits for all bishop/rook attack bitboards. The table size will be 16KB for the bishop attacks and 64KB for rook attacks. To make it possible, we must find a group of magics (one per square and dependent each other). All the magics in the group must hash its all &lt;strong&gt;relevant occupancies&lt;/strong&gt; into the same 11/13 bit index without any collision with others (anyhow for each square, different occupancies can hash to the same attack sets).&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 bishopAttacks[2048]; // 16KB&amp;lt;br/&amp;gt;U64 rookAttacks[8196]; // 64KB&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;struct GMagic {&amp;lt;br/&amp;gt;   U64 mask;  // to mask relevant squares of both lines (no outer squares) and include sliding piece itself&amp;lt;br/&amp;gt;   U64 magic; // magic 64-bit factor&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;GMagic mBishopTbl[64]; //1KB&amp;lt;br/&amp;gt;GMagic mRookTbl[64]; //1KB&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 bishopAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   occ &amp;amp;amp;= mBishopTbl[sq].mask;&amp;lt;br/&amp;gt;   occ *= mBishopTbl[sq].magic;&amp;lt;br/&amp;gt;   occ &amp;amp;gt;&amp;amp;gt;= 64-11;  //fixed shift&amp;lt;br/&amp;gt;   return bishopAttacks[occ]; //no offset&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 rookAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   occ &amp;amp;amp;= mRookTbl[sq].mask;&amp;lt;br/&amp;gt;   occ *= mRookTbl[sq].magic;&amp;lt;br/&amp;gt;   occ &amp;amp;gt;&amp;amp;gt;= 64-13;&amp;lt;br/&amp;gt;   return rookAttacks[occ];&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 bishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2048&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 16KB&lt;/span&gt;
U64 rookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8196&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 64KB&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;struct&lt;/span&gt; GMagic &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64 mask&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// to mask relevant squares of both lines (no outer squares) and include sliding piece itself&lt;/span&gt;
   U64 magic&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// magic 64-bit factor&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
GMagic mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;//1KB&lt;/span&gt;
GMagic mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;//1KB&lt;/span&gt;
&amp;nbsp;
U64 bishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   occ &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;mask&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;magic&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;11&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;//fixed shift&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; bishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occ&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;//no offset&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
U64 rookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   occ &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;mask&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;magic&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;13&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; rookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occ&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;But the idea seems like a wishing dream. Can we find ONE of the &lt;strong&gt;magic group&lt;/strong&gt; of magics? Does it exist in theory? If not, can we use more bits to reach the condition? If yes, can we find a good magic group? A good magic group means that all the hash value &amp;lt;=n, so we can reduce the table size to n, until it reach to 1428/4900. Enough? If all hash values are grouped by square, can we think about using the &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards#PostMask&quot;&gt;Sharing Attacks&lt;/a&gt; method?&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:127:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Implementations&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:127 --&gt;Implementations&lt;/h1&gt;
 Despite its huge table size, register usage and code size are important issues as well - and here Magic Bitboards are unbeatable. There are enough variations of &lt;a class=&quot;wiki_link&quot; href=&quot;/Space-Time%20Tradeoff&quot;&gt;space-time tradeoff&lt;/a&gt; and implementation details of that theme for all who like to play the optimization game. &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;-source code with various precompiler options is available from &lt;a class=&quot;wiki_link&quot; href=&quot;/Pradu%20Kannan&quot;&gt;Pradu Kannan&#039;s&lt;/a&gt; site. MINIMIZE_MAGIC is about Plain versus Fancy &lt;!-- ws:start:WikiTextRefRule:55:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.pradu.us/old/Nov27_2008/Buzz/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Buzz - A Winboard Chess Playing Program by Pradu Kannan&amp;lt;/a&amp;gt; - Source of &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Pradu%20Kannan&amp;quot;&amp;gt;Pradu Kannan&#039;s&amp;lt;/a&amp;gt; &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Magic%20Bitboards&amp;quot;&amp;gt;magic&amp;lt;/a&amp;gt; Move Generator, MINIMIZE_MAGIC&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-10&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-10&quot;&gt;[10]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:55 --&gt; , while PERFECT_MAGIC_HASH enables an additional indirection via 16-bit indices. As always, with space-time tradeoffs - it depends on the individual cache- and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Memory_footprint&quot; rel=&quot;nofollow&quot;&gt;memory footprint&lt;/a&gt; inside a particular chess program and the hardware architecture, which solution is preferable.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:211:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Fancy&amp;quot; title=&amp;quot;Anchor: Fancy&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Fancy&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:211 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:129:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Implementations-Fancy&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:129 --&gt;Fancy&lt;/h2&gt;
 Fancy Magic Bitboards is the main stream implementation as proposed by &lt;a class=&quot;wiki_link&quot; href=&quot;/Pradu%20Kannan&quot;&gt;Pradu Kannan&lt;/a&gt; with individual table sizes for each square. It requires an individual shift, to leave that many index bits remaining as determined by the population of relevant occupancies. As mentioned, if one tries hard enough to maximize constructive collisions while &lt;a class=&quot;wiki_link&quot; href=&quot;/Looking%20for%20Magics&quot;&gt;looking for magics&lt;/a&gt;, one may half the size for several individual squares, see &lt;a class=&quot;wiki_link&quot; href=&quot;/Best%20Magics%20so%20far&quot;&gt;Best Magics so far&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 attack_table[...]; // ~840 KiB all rook and bishop attacks, less with constructive collisions optimization&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;struct SMagic {&amp;lt;br/&amp;gt;   U64* ptr;  // pointer to attack_table for each particular square&amp;lt;br/&amp;gt;   U64 mask;  // to mask relevant squares of both lines (no outer squares)&amp;lt;br/&amp;gt;   U64 magic; // magic 64-bit factor&amp;lt;br/&amp;gt;   int shift; // shift right&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;SMagic mBishopTbl[64];&amp;lt;br/&amp;gt;SMagic mRookTbl[64];&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 bishopAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   U64* aptr = mBishopTbl[sq].ptr;&amp;lt;br/&amp;gt;   occ      &amp;amp;amp;= mBishopTbl[sq].mask;&amp;lt;br/&amp;gt;   occ      *= mBishopTbl[sq].magic;&amp;lt;br/&amp;gt;   occ     &amp;amp;gt;&amp;amp;gt;= mBishopTbl[sq].shift;&amp;lt;br/&amp;gt;   return aptr[occ];&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 rookAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   U64* aptr = mRookTbl[sq].ptr;&amp;lt;br/&amp;gt;   occ      &amp;amp;amp;= mRookTbl[sq].mask;&amp;lt;br/&amp;gt;   occ      *= mRookTbl[sq].magic;&amp;lt;br/&amp;gt;   occ     &amp;amp;gt;&amp;amp;gt;= mRookTbl[sq].shift;&amp;lt;br/&amp;gt;   return aptr[occ];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 attack_table&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;...&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// ~840 KiB all rook and bishop attacks, less with constructive collisions optimization&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;struct&lt;/span&gt; SMagic &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; ptr&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// pointer to attack_table for each particular square&lt;/span&gt;
   U64 mask&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// to mask relevant squares of both lines (no outer squares)&lt;/span&gt;
   U64 magic&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// magic 64-bit factor&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; shift&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// shift right&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
SMagic mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
SMagic mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
U64 bishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; aptr &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;ptr&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ      &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;mask&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ      &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;magic&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ     &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; aptr&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occ&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
U64 rookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; aptr &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;ptr&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ      &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;mask&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ      &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;magic&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ     &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; aptr&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occ&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:212:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Plain&amp;quot; title=&amp;quot;Anchor: Plain&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Plain&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:212 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:131:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc6&quot;&gt;&lt;a name=&quot;Implementations-Plain&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:131 --&gt;Plain&lt;/h2&gt;
 Plain Magic Bitboards, &lt;a class=&quot;wiki_link&quot; href=&quot;/Lasse%20Hansen&quot;&gt;Lasse Hansen&#039;s&lt;/a&gt; initial approach, takes much more memory for homogeneous two-dimensional attack &lt;a class=&quot;wiki_link&quot; href=&quot;/Array&quot;&gt;arrays&lt;/a&gt;. 32 KiB  per rook square, 4 KiB  for each bishop square. It does not need a variable shift and therefor needs one processor register less to further reduce register pressure, despite shorter code. Unfortunately, so far, there are two &lt;a class=&quot;wiki_link&quot; href=&quot;/Best%20Magics%20so%20far&quot;&gt;rook corner squares&lt;/a&gt; (0 and 7), which prohibit dividing the rook table size by two.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 mBishopAttacks[64] [512]; // 256 K&amp;lt;br/&amp;gt;U64 mRookAttacks  [64][4096]; // 2048K&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;struct SMagic {&amp;lt;br/&amp;gt;   U64 mask;  // to mask relevant squares of both lines (no outer squares)&amp;lt;br/&amp;gt;   U64 magic; // magic 64-bit factor&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;SMagic mBishopTbl[64];&amp;lt;br/&amp;gt;SMagic mRookTbl  [64];&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 bishopAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   occ &amp;amp;amp;= mBishopTbl[sq].mask;&amp;lt;br/&amp;gt;   occ *= mBishopTbl[sq].magic;&amp;lt;br/&amp;gt;   occ &amp;amp;gt;&amp;amp;gt;= 64-9;&amp;lt;br/&amp;gt;   return mBishopAttacks[sq][occ];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 mBishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;512&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 256 K&lt;/span&gt;
U64 mRookAttacks  &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4096&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 2048K&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;struct&lt;/span&gt; SMagic &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64 mask&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// to mask relevant squares of both lines (no outer squares)&lt;/span&gt;
   U64 magic&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// magic 64-bit factor&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
SMagic mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
SMagic mRookTbl  &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
U64 bishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   occ &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;mask&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;magic&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; mBishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occ&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:213:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@FixedShiftFancy&amp;quot; title=&amp;quot;Anchor: FixedShiftFancy&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;FixedShiftFancy&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:213 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:133:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc7&quot;&gt;&lt;a name=&quot;Implementations-Fixed shift Fancy&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:133 --&gt;Fixed shift Fancy&lt;/h2&gt;
 A fancy fixed shift variation was introduced by &lt;a class=&quot;wiki_link&quot; href=&quot;/Onno%20Garms&quot;&gt;Onno Garms&lt;/a&gt;, looking for magics producing factors with appropriate reduced value ranges. That is, leave 12 bit rook indices for all squares, but with upper bit(s) clear for all possible occupancies for all the squares with less than 12 relevant bits, so that it efficiently becomes a less 12 bit index. Onno believes that it is possible to find magic factors with that property for most of those squares, to come close to the fancy table size with the advantage of a fixed shift &lt;!-- ws:start:WikiTextRefRule:59:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;amp;t=50043&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Magic with fixed shift&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Onno%20Garms&amp;quot;&amp;gt;Onno Garms&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;Winboard Forum&amp;lt;/a&amp;gt;, March 18, 2009&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-11&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-11&quot;&gt;[11]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:59 --&gt; . Even an &amp;quot;overlapping&amp;quot; of square arrays is feasible, if they contain accordant unused slot gaps on both ends. &lt;a class=&quot;wiki_link&quot; href=&quot;/Volker%20Annuss&quot;&gt;Volker Annuss&lt;/a&gt; came up with a fixed shift solution of only 800 KiB  and below &lt;!-- ws:start:WikiTextRefRule:63:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;amp;t=51162&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Fixed shift magics with 800KB lookup table&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Volker%20Annuss&amp;quot;&amp;gt;Volker Annuss&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;Winboard Forum&amp;lt;/a&amp;gt;, September, 05, 2010&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-12&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-12&quot;&gt;[12]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:63 --&gt; &lt;!-- ws:start:WikiTextRefRule:67:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=60065&amp;amp;amp;start=14&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: understanding fixed shift fancy magic bitboard generation&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Volker%20Annuss&amp;quot;&amp;gt;Volker Annuss&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, May 06, 2016&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-13&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-13&quot;&gt;[13]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:67 --&gt;, and more recently even innovated with &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards#BlackMagics&quot;&gt;Black Magic Bitboards&lt;/a&gt;. &lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 attack_table[...]; // &amp;amp;gt; 800 KiB  - 1.x MiB  - depending on the effort on looking for magics&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;struct SMagic {&amp;lt;br/&amp;gt;   U64* ptr;  // pointer to attack_table for each particular square&amp;lt;br/&amp;gt;   U64 mask;  // to mask relevant squares of both lines (no outer squares)&amp;lt;br/&amp;gt;   U64 magic; // magic 64-bit factor&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;SMagic mBishopTbl[64];&amp;lt;br/&amp;gt;SMagic mRookTbl[64];&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 rookAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   U64* aptr = mRookTbl[sq].ptr;&amp;lt;br/&amp;gt;   occ      &amp;amp;amp;= mRookTbl[sq].mask;&amp;lt;br/&amp;gt;   occ      *= mRookTbl[sq].magic;&amp;lt;br/&amp;gt;   occ     &amp;amp;gt;&amp;amp;gt;= 64-12;&amp;lt;br/&amp;gt;   return aptr[occ];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 attack_table&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;...&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// &amp;gt; 800 KiB  - 1.x MiB  - depending on the effort on looking for magics&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;struct&lt;/span&gt; SMagic &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; ptr&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// pointer to attack_table for each particular square&lt;/span&gt;
   U64 mask&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// to mask relevant squares of both lines (no outer squares)&lt;/span&gt;
   U64 magic&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// magic 64-bit factor&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
SMagic mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
SMagic mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
U64 rookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; aptr &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;ptr&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ      &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;mask&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ      &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;magic&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ     &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; aptr&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occ&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:214:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@BlackMagics&amp;quot; title=&amp;quot;Anchor: BlackMagics&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;BlackMagics&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:214 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:135:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc8&quot;&gt;&lt;a name=&quot;Implementations-Black Magic Bitboards&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:135 --&gt;Black Magic Bitboards&lt;/h2&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/Volker%20Annuss&quot;&gt;Volker Annuss&#039;&lt;/a&gt; most recent innovation and further improvement of his already dense 700 KiB &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards#FixedShiftFancy&quot;&gt;fixed shift fancy&lt;/a&gt; reference implementation is called &lt;strong&gt;Black Magic Bitboards&lt;/strong&gt;, introduced in &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt; in August 2017 &lt;!-- ws:start:WikiTextRefRule:71:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=64790&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Black magic bitboards&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Volker%20Annuss&amp;quot;&amp;gt;Volker Annuss&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, August 03, 2017&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-14&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-14&quot;&gt;[14]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:71 --&gt;. Instead of &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt; with a mask to clear the not relevant occupancy bits, he used the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;union&lt;/a&gt; with the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ComplementSet&quot;&gt;complement&lt;/a&gt; of mask to set all not relevant occupancy bits. &lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;  and mask[d4]  vs.   or ~mask[d4]&amp;lt;br/&amp;gt;. . . . . . . .     1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;. . . 1 . . . .     1 1 1 . 1 1 1 1&amp;lt;br/&amp;gt;. . . 1 . . . .     1 1 1 . 1 1 1 1&amp;lt;br/&amp;gt;. . . 1 . . . .     1 1 1 . 1 1 1 1&amp;lt;br/&amp;gt;. 1 1 . 1 1 1 .     1 . . 1 . . . 1&amp;lt;br/&amp;gt;. . . 1 . . . .     1 1 1 . 1 1 1 1&amp;lt;br/&amp;gt;. . . 1 . . . .     1 1 1 . 1 1 1 1&amp;lt;br/&amp;gt;. . . . . . . .     1 1 1 1 1 1 1 1&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;  and mask[d4]  vs.   or ~mask[d4]
. . . . . . . .     1 1 1 1 1 1 1 1
. . . 1 . . . .     1 1 1 . 1 1 1 1
. . . 1 . . . .     1 1 1 . 1 1 1 1
. . . 1 . . . .     1 1 1 . 1 1 1 1
. 1 1 . 1 1 1 .     1 . . 1 . . . 1
. . . 1 . . . .     1 1 1 . 1 1 1 1
. . . 1 . . . .     1 1 1 . 1 1 1 1
. . . . . . . .     1 1 1 1 1 1 1 1&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;&lt;br /&gt;
This trick, which basically adds a huge constant to the occupancy factor, enables to find &lt;strong&gt;Black Magics&lt;/strong&gt; yielding in even smaller array sizes per square, determined by maximum and minimum index - the latter no longer zero for the empty occupancy! Unfortunately so far, the individual savings with denser square arrays don&#039;t completely advance to the size of the combined overlapping table, since overlapping became harder due to smaller gaps &lt;!-- ws:start:WikiTextRefRule:75:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=64790&amp;amp;amp;start=11&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: Black magic bitboards&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Volker%20Annuss&amp;quot;&amp;gt;Volker Annuss&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, August 04, 2017&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-15&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-15&quot;&gt;[15]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:75 --&gt; . However, 692 KiB  for the complete rook and bishop attack table is the new fixed shift reference. Black Magic Bitboards are now used in Volker&#039;s engine &lt;a class=&quot;wiki_link&quot; href=&quot;/Arminius&quot;&gt;Arminius&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:79:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=64790&amp;amp;amp;start=14&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: Black magic bitboards&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Volker%20Annuss&amp;quot;&amp;gt;Volker Annuss&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, August 04, 2017&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-16&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-16&quot;&gt;[16]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:79 --&gt; &lt;!-- ws:start:WikiTextRefRule:84:&amp;amp;lt;ref&amp;amp;gt;source code according to the &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Magic%20Bitboards#FixedShiftFancy&amp;quot;&amp;gt;fixed shift fancy&amp;lt;/a&amp;gt; sample - array size from Volker&#039;s posting, also containing black magics and arrayoffsets, see &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=64790&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Black magic bitboards&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Volker%20Annuss&amp;quot;&amp;gt;Volker Annuss&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, August 03, 2017&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-17&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-17&quot;&gt;[17]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:84 --&gt;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 attack_table[88507]; // 692 KiB for published black magics by Volker Annuss (new size 88316 aka 690 KiB) &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;struct SBlackMagic {&amp;lt;br/&amp;gt;   U64* ptr;  // pointer to attack_table for each particular square&amp;lt;br/&amp;gt;   U64 notmask;  // to mask relevant squares of both lines (no outer squares)&amp;lt;br/&amp;gt;   U64 blackmagic; // black magic 64-bit factor&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;SBlackMagic mBishopTbl[64];&amp;lt;br/&amp;gt;SBlackMagic mRookTbl[64];&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 rookAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   U64* aptr = mRookTbl[sq].ptr;&amp;lt;br/&amp;gt;   occ      |= mRookTbl[sq].notmask;&amp;lt;br/&amp;gt;   occ      *= mRookTbl[sq].blackmagic;&amp;lt;br/&amp;gt;   occ     &amp;amp;gt;&amp;amp;gt;= 64-12;&amp;lt;br/&amp;gt;   return aptr[occ];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 attack_table&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;88507&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 692 KiB for published black magics by Volker Annuss (new size 88316 aka 690 KiB) &lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;struct&lt;/span&gt; SBlackMagic &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; ptr&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// pointer to attack_table for each particular square&lt;/span&gt;
   U64 notmask&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// to mask relevant squares of both lines (no outer squares)&lt;/span&gt;
   U64 blackmagic&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// black magic 64-bit factor&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
SBlackMagic mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
SBlackMagic mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
U64 rookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; aptr &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;ptr&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ      &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;notmask&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ      &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;blackmagic&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ     &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; aptr&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occ&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:215:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@ByteLookup&amp;quot; title=&amp;quot;Anchor: ByteLookup&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;ByteLookup&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:215 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:137:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc9&quot;&gt;&lt;a name=&quot;Implementations-Byte Lookup&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:137 --&gt;Byte Lookup&lt;/h2&gt;
 Since there are only up to 144 different attack sets per square, &lt;a class=&quot;wiki_link&quot; href=&quot;/Robert%20Houdart&quot;&gt;Robert Houdart&lt;/a&gt; proposed to lookup &lt;a class=&quot;wiki_link&quot; href=&quot;/Byte&quot;&gt;bytes&lt;/a&gt; by square and hashed occupancy for a minimal perfect hashing with an additional indirection via an offset per square, which is successfully used in his engine &lt;a class=&quot;wiki_link&quot; href=&quot;/Houdini&quot;&gt;Houdini&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:88:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;amp;p=368026&amp;amp;amp;t=35858&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: Plain and fancy magic on modern hardware&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Robert%20Houdart&amp;quot;&amp;gt;Robert Houdart&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, August 26, 2010&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-18&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-18&quot;&gt;[18]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:88 --&gt; . Following sample code uses the Plain fixed shift method, while it may also applied for the dense Fancy one.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;byte mBishopAttacks[64] [512]; // 32 K&amp;lt;br/&amp;gt;byte mRookAttacks  [64][4096]; // 256 K&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 mRookLookup[4900];  // 39 K&amp;lt;br/&amp;gt;U64 mBishopLookup[1428];  // 11 K&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;struct SMagic {&amp;lt;br/&amp;gt;   U64 mask;  // to mask relevant squares of both lines (no outer squares)&amp;lt;br/&amp;gt;   U64 magic; // magic 64-bit factor&amp;lt;br/&amp;gt;   int offset;   // offset into lookup table&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;SMagic mBishopTbl[64];&amp;lt;br/&amp;gt;SMagic mRookTbl  [64];&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 bishopAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   occ &amp;amp;amp;= mBishopTbl[sq].mask;&amp;lt;br/&amp;gt;   occ *= mBishopTbl[sq].magic;&amp;lt;br/&amp;gt;   occ &amp;amp;gt;&amp;amp;gt;= 64-9;&amp;lt;br/&amp;gt;   return mBishopLookup[mBishopTbl[sq].offset + mBishopAttack[sq][occ]];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;byte mBishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;512&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 32 K&lt;/span&gt;
byte mRookAttacks  &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4096&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 256 K&lt;/span&gt;
&amp;nbsp;
U64 mRookLookup&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4900&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// 39 K&lt;/span&gt;
U64 mBishopLookup&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1428&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// 11 K&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;struct&lt;/span&gt; SMagic &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64 mask&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// to mask relevant squares of both lines (no outer squares)&lt;/span&gt;
   U64 magic&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// magic 64-bit factor&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; offset&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;co1&quot;&gt;// offset into lookup table&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
SMagic mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
SMagic mRookTbl  &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
U64 bishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   occ &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;mask&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;magic&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; mBishopLookup&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;offset&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; mBishopAttack&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occ&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:216:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@32Bit&amp;quot; title=&amp;quot;Anchor: 32Bit&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;32Bit&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:216 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:139:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc10&quot;&gt;&lt;a name=&quot;Implementations-32-bit Magics&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:139 --&gt;32-bit Magics&lt;/h2&gt;
 Optimizations are possible for 32-bit systems, as proposed by &lt;a class=&quot;wiki_link&quot; href=&quot;/Grant%20Osborne&quot;&gt;Grant Osborne&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:92:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.open-aurec.com/wbforum/viewtopic.php?t=5997&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;A Faster Magic Move Bitboard Generator?&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Grant%20Osborne&amp;quot;&amp;gt;Grant Osborne&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;Winboard Forum&amp;lt;/a&amp;gt;, December 15, 2006&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-19&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-19&quot;&gt;[19]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:92 --&gt; . Instead of letting the compiler split up a 64-bit multiply, two 32-bit multiplications can be manually implemented. Multiply the low bits of the magic with the low bits of the key and add it with the product of the high bits of the magic and the high bits of the key and use the upper bits of the sum to index the move database. For the bishops one may try only one 32-bit multiplication after xoring the masked high and low half.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;struct {&amp;lt;br/&amp;gt;  unsigned int rookMaskLo;&amp;lt;br/&amp;gt;  unsigned int rookMaskHi;&amp;lt;br/&amp;gt;  unsigned int rookMagicLo;&amp;lt;br/&amp;gt;  unsigned int rookMagicHi;&amp;lt;br/&amp;gt;  unsigned int rookShift;&amp;lt;br/&amp;gt;  U64 *pRookAttacks;&amp;lt;br/&amp;gt;} sm[64];&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 rookAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   unsigned int lo = (int) occ;&amp;lt;br/&amp;gt;   unsigned int hi = (int)(occ &amp;amp;gt;&amp;amp;gt; 32);&amp;lt;br/&amp;gt;   lo &amp;amp;amp;= sm[sq].rookMaskLo;&amp;lt;br/&amp;gt;   hi &amp;amp;amp;= sm[sq].rookMaskHi;&amp;lt;br/&amp;gt;   lo *= sm[sq].rookMagicLo;&amp;lt;br/&amp;gt;   hi *= sm[sq].rookMagicHi;&amp;lt;br/&amp;gt;   lo  = (lo ^ hi) &amp;amp;gt;&amp;amp;gt; sm[sq].rookShift;&amp;lt;br/&amp;gt;   return sm[sq].pRookAttacks[lo];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;struct&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
  &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; rookMaskLo&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; rookMaskHi&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; rookMagicLo&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; rookMagicHi&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; rookShift&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
  U64 &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;pRookAttacks&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; sm&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
U64 rookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; lo &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; occ&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; hi &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   lo &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sm&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;rookMaskLo&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   hi &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sm&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;rookMaskHi&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   lo &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sm&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;rookMagicLo&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   hi &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sm&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;rookMagicHi&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   lo  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lo &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; hi&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; sm&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;rookShift&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; sm&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;pRookAttacks&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;lo&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:217:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@PostMask&amp;quot; title=&amp;quot;Anchor: PostMask&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;PostMask&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:217 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:141:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc11&quot;&gt;&lt;a name=&quot;Implementations-Sharing Attacks&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:141 --&gt;Sharing Attacks&lt;/h2&gt;
 The development has not finished. &lt;a class=&quot;wiki_link&quot; href=&quot;/Lasse%20Hansen&quot;&gt;Lasse Hansen&lt;/a&gt; came up with another stunning idea &lt;!-- ws:start:WikiTextRefRule:96:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Lasse%20Hansen&amp;quot;&amp;gt;Lasse Hansen&#039;s&amp;lt;/a&amp;gt; &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.open-aurec.com/wbforum/viewtopic.php?topic_view=threads&amp;amp;amp;p=185506&amp;amp;amp;t=5441&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;postmask trick&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;Winboard Forum&amp;lt;/a&amp;gt;, May 09, 2008&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-20&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-20&quot;&gt;[20]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:96 --&gt; , to use a final &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt; by attacks &lt;a class=&quot;wiki_link&quot; href=&quot;/on%20an%20empty%20board&quot;&gt;on an empty board&lt;/a&gt;, to share tables by two (rooks) or even four (bishops) squares. Bishop sharing is simple to understand, since there are light and dark colored bishops with disjoint attacks-sets, able to share the pre-calculated union of two square-attacks.&lt;br /&gt;
&lt;br /&gt;
The trick is to share even equal colored bishops and rooks where both attack-sets are not disjoint - but all members of the intersection are always set, since they are direct neighbors of both sliders. This is how rooks and bishops may share union-attack-sets by two resp. four squares:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:9:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;int rookSharing[64] = {&amp;lt;br/&amp;gt;   0,  1,  2,  3,  4,  5,  6,  7,&amp;lt;br/&amp;gt;   1,  0,  3,  2,  5,  4,  7,  6,&amp;lt;br/&amp;gt;   8,  9, 10, 11, 12, 13, 14, 15,&amp;lt;br/&amp;gt;   9,  8, 11, 10, 13, 12, 15, 14,&amp;lt;br/&amp;gt;  16, 17, 18, 19, 20, 21, 22, 23,&amp;lt;br/&amp;gt;  17, 16, 19, 18, 21, 20, 23, 22,&amp;lt;br/&amp;gt;  24, 25, 26, 27, 28, 29, 30, 31,&amp;lt;br/&amp;gt;  25, 24, 27, 26, 29, 28, 31, 30,&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;int bishopSharing[64] = {&amp;lt;br/&amp;gt;   0,  2,  4,  4,  4,  4, 12, 14,&amp;lt;br/&amp;gt;   0,  2,  5,  5,  5,  5, 12, 14,&amp;lt;br/&amp;gt;   0,  2,  6,  6,  6,  6, 12, 14,&amp;lt;br/&amp;gt;   0,  2,  7,  7,  7,  7, 12, 14,&amp;lt;br/&amp;gt;   1,  3,  8,  8,  8,  8, 13, 15,&amp;lt;br/&amp;gt;   1,  3,  9,  9,  9,  9, 13, 15,&amp;lt;br/&amp;gt;   1,  3, 10, 10, 10, 10, 13, 15,&amp;lt;br/&amp;gt;   1,  3, 11, 11, 11, 11, 13, 15,&amp;lt;br/&amp;gt;};&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;int rookSharing[64] = {
   0,  1,  2,  3,  4,  5,  6,  7,
   1,  0,  3,  2,  5,  4,  7,  6,
   8,  9, 10, 11, 12, 13, 14, 15,
   9,  8, 11, 10, 13, 12, 15, 14,
  16, 17, 18, 19, 20, 21, 22, 23,
  17, 16, 19, 18, 21, 20, 23, 22,
  24, 25, 26, 27, 28, 29, 30, 31,
  25, 24, 27, 26, 29, 28, 31, 30,
};
&amp;nbsp;
int bishopSharing[64] = {
   0,  2,  4,  4,  4,  4, 12, 14,
   0,  2,  5,  5,  5,  5, 12, 14,
   0,  2,  6,  6,  6,  6, 12, 14,
   0,  2,  7,  7,  7,  7, 12, 14,
   1,  3,  8,  8,  8,  8, 13, 15,
   1,  3,  9,  9,  9,  9, 13, 15,
   1,  3, 10, 10, 10, 10, 13, 15,
   1,  3, 11, 11, 11, 11, 13, 15,
};&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:9 --&gt;On the cost of one additional and-instruction, post-masking has the potential to almost halve the rook tables - and even better for the already small bishop tables. Additionally, four union attack bitboards can be shared by eight rook- and six bishop-squares.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:10:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;R 1 1 1 1 1 1 1    1 R 1 1 1 1 1 1    1 1 R 1 1 1 1 1    1 1 1 R 1 1 1 1&amp;lt;br/&amp;gt;B R 1 1 1 1 1 1    R B 1 1 1 1 1 1    1 1 B R 1 1 1 1    1 1 R B 1 1 1 1&amp;lt;br/&amp;gt;1 1 1 . . . . .    1 1 1 . . . . .    . 1 1 1 1 . . .    . . 1 1 1 . . .&amp;lt;br/&amp;gt;1 1 1 1 . . . 1    1 1 . 1 . . . .    1 . 1 1 1 1 . .    . 1 1 1 . 1 . .&amp;lt;br/&amp;gt;1 1 . 1 1 . 1 .    1 1 . . 1 . . .    . . 1 1 . 1 1 .    1 . 1 1 . . 1 .&amp;lt;br/&amp;gt;1 1 . . 1 B . .    1 1 . . . 1 . .    . . 1 1 . . 1 B    . . 1 1 . . . 1&amp;lt;br/&amp;gt;1 1 . . 1 1 1 .    1 1 . . . . 1 .    . . 1 1 . . 1 1    . . 1 1 . . . .&amp;lt;br/&amp;gt;1 1 . 1 . . 1 1    1 1 . . . . . 1    . . 1 1 . 1 . .    . . 1 1 . . . .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;R 1 1 1 1 1 1 1    1 R 1 1 1 1 1 1    1 1 R 1 1 1 1 1    1 1 1 R 1 1 1 1
B R 1 1 1 1 1 1    R B 1 1 1 1 1 1    1 1 B R 1 1 1 1    1 1 R B 1 1 1 1
1 1 1 . . . . .    1 1 1 . . . . .    . 1 1 1 1 . . .    . . 1 1 1 . . .
1 1 1 1 . . . 1    1 1 . 1 . . . .    1 . 1 1 1 1 . .    . 1 1 1 . 1 . .
1 1 . 1 1 . 1 .    1 1 . . 1 . . .    . . 1 1 . 1 1 .    1 . 1 1 . . 1 .
1 1 . . 1 B . .    1 1 . . . 1 . .    . . 1 1 . . 1 B    . . 1 1 . . . 1
1 1 . . 1 1 1 .    1 1 . . . . 1 .    . . 1 1 . . 1 1    . . 1 1 . . . .
1 1 . 1 . . 1 1    1 1 . . . . . 1    . . 1 1 . 1 . .    . . 1 1 . . . .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:10 --&gt;If the additional post-mask becomes member of a structure, it exceeds 32 byte in 64-bit mode. A structure of arrays may be preferable than an array of structures.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:11:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 attack_table[...]; // ~400K Byte for all rook and (shared) bishop attacks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;struct SMagic {&amp;lt;br/&amp;gt;   U64* ptr;      // pointer to attack_table for each particular square&amp;lt;br/&amp;gt;   U64 magic;     // magic 64-bit factor&amp;lt;br/&amp;gt;   U64 premask;   // to mask relevant squares of both lines (no outer squares)&amp;lt;br/&amp;gt;   U64 postmask;  // attacks on the otherwise empty board&amp;lt;br/&amp;gt;   int shift;     // shift right&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;SMagic mBishopTbl[64];&amp;lt;br/&amp;gt;SMagic mRookTbl[64];&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 bishopAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   U64* aptr = mBishopTbl[sq].ptr;&amp;lt;br/&amp;gt;   occ      &amp;amp;amp;= mBishopTbl[sq].premask;&amp;lt;br/&amp;gt;   occ      *= mBishopTbl[sq].magic;&amp;lt;br/&amp;gt;   occ     &amp;amp;gt;&amp;amp;gt;= mBishopTbl[sq].shift;&amp;lt;br/&amp;gt;   return      mBishopTbl[sq].postmask &amp;amp;amp; aptr[occ];&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 rookAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   U64* aptr = mRookTbl[sq].ptr;&amp;lt;br/&amp;gt;   occ      &amp;amp;amp;= mRookTbl[sq].premask;&amp;lt;br/&amp;gt;   occ      *= mRookTbl[sq].magic;&amp;lt;br/&amp;gt;   occ     &amp;amp;gt;&amp;amp;gt;= mRookTbl[sq].shift;&amp;lt;br/&amp;gt;   return      mRookTbl[sq].postmask &amp;amp;amp; aptr[occ];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 attack_table&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;...&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// ~400K Byte for all rook and (shared) bishop attacks&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;struct&lt;/span&gt; SMagic &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; ptr&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;      &lt;span class=&quot;co1&quot;&gt;// pointer to attack_table for each particular square&lt;/span&gt;
   U64 magic&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;     &lt;span class=&quot;co1&quot;&gt;// magic 64-bit factor&lt;/span&gt;
   U64 premask&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;co1&quot;&gt;// to mask relevant squares of both lines (no outer squares)&lt;/span&gt;
   U64 postmask&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// attacks on the otherwise empty board&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; shift&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;     &lt;span class=&quot;co1&quot;&gt;// shift right&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
SMagic mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
SMagic mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
U64 bishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; aptr &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;ptr&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ      &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;premask&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ      &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;magic&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ     &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt;      mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;postmask&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; aptr&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occ&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
U64 rookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; aptr &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;ptr&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ      &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;premask&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ      &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;magic&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ     &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt;      mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;postmask&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; aptr&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occ&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:11 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:218:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@IncorporatingtheShift&amp;quot; title=&amp;quot;Anchor: IncorporatingtheShift&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;IncorporatingtheShift&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:218 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:143:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc12&quot;&gt;&lt;a name=&quot;Implementations-Incorporating the Shift&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:143 --&gt;Incorporating the Shift&lt;/h2&gt;
 Another possible improvement was introduced by &lt;a class=&quot;wiki_link&quot; href=&quot;/Grant%20Osborne&quot;&gt;Grant Osborne&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:100:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;amp;p=196157&amp;amp;amp;t=21329&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Incorporating the shift into the magic number&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Grant%20Osborne&amp;quot;&amp;gt;Grant Osborne&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, June 18, 2008&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-21&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-21&quot;&gt;[21]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:100 --&gt; - to don&#039;t store the variable right shift inside an own array or structure element, but to use the almost redundant upper six bit of the magic factor instead - incorporating the shift into the magic number. While using a structure for pre-, postmask, magic and pointer, it&#039;s size is 4*8 = 32-byte or - if properly aligned - the half of one cache line. The additional effort for the right shift 58 to extract the variable shift is likely hidden by the latency of the independent multiplication, improving ipc.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:12:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 attack_table[...]; // ~400K Byte for all rook and (shared) bishop attacks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;struct SMagic {&amp;lt;br/&amp;gt;   U64* ptr;      // pointer to attack_table for each particular square&amp;lt;br/&amp;gt;   U64 magic;     // magic 64-bit factor, including upper six bits as shift amount&amp;lt;br/&amp;gt;   U64 premask;   // to mask relevant squares of both lines (no outer squares)&amp;lt;br/&amp;gt;   U64 postmask;  // attacks on the otherwise empty board&amp;lt;br/&amp;gt;}; // 32 Byte with 64-bit pointer!&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;SMagic mBishopTbl[64];&amp;lt;br/&amp;gt;SMagic mRookTbl[64];&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 bishopAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   U64* aptr = mBishopTbl[sq].ptr;&amp;lt;br/&amp;gt;   int shift = mBishopTbl[sq].magic &amp;amp;gt;&amp;amp;gt; 58;&amp;lt;br/&amp;gt;   occ      &amp;amp;amp;= mBishopTbl[sq].premask;&amp;lt;br/&amp;gt;   occ      *= mBishopTbl[sq].magic;&amp;lt;br/&amp;gt;   return      mBishopTbl[sq].postmask &amp;amp;amp; aptr[occ &amp;amp;gt;&amp;amp;gt; shift];&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 rookAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   U64* aptr = mRookTbl[sq].ptr;&amp;lt;br/&amp;gt;   int shift = mRookTbl[sq].magic &amp;amp;gt;&amp;amp;gt; 58;&amp;lt;br/&amp;gt;   occ      &amp;amp;amp;= mRookTbl[sq].premask;&amp;lt;br/&amp;gt;   occ      *= mRookTbl[sq].magic;&amp;lt;br/&amp;gt;   return      mRookTbl[sq].postmask &amp;amp;amp; aptr[occ &amp;amp;gt;&amp;amp;gt; shift];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 attack_table&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;...&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// ~400K Byte for all rook and (shared) bishop attacks&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;struct&lt;/span&gt; SMagic &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; ptr&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;      &lt;span class=&quot;co1&quot;&gt;// pointer to attack_table for each particular square&lt;/span&gt;
   U64 magic&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;     &lt;span class=&quot;co1&quot;&gt;// magic 64-bit factor, including upper six bits as shift amount&lt;/span&gt;
   U64 premask&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;co1&quot;&gt;// to mask relevant squares of both lines (no outer squares)&lt;/span&gt;
   U64 postmask&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// attacks on the otherwise empty board&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 32 Byte with 64-bit pointer!&lt;/span&gt;
&amp;nbsp;
SMagic mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
SMagic mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
U64 bishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; aptr &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;ptr&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; shift &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;magic&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;58&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ      &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;premask&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ      &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;magic&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt;      mBishopTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;postmask&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; aptr&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; shift&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
U64 rookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; aptr &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;ptr&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; shift &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;magic&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;58&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ      &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;premask&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ      &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;magic&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt;      mRookTbl&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;postmask&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; aptr&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; shift&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:12 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:219:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@IncorporatingOffset&amp;quot; title=&amp;quot;Anchor: IncorporatingOffset&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;IncorporatingOffset&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:219 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:145:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc13&quot;&gt;&lt;a name=&quot;Implementations-Incorporating Offset&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:145 --&gt;Incorporating Offset&lt;/h2&gt;
 A similar idea as in &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards#IncorporatingtheShift&quot;&gt;Incorporating the Shift&lt;/a&gt; in the domain &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards#FixedShiftFancy&quot;&gt;fixed shift magics&lt;/a&gt; was proposed by &lt;a class=&quot;wiki_link&quot; href=&quot;/Eugene%20Kotlov&quot;&gt;Eugene Kotlov&lt;/a&gt; concerning the indirection to the stored attack array, using the 16 lower bits of the magic factor as offset &lt;!-- ws:start:WikiTextRefRule:104:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=66538&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;magic number comprising offset&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Eugene%20Kotlov&amp;quot;&amp;gt;Eugene Kotlov&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, February 07, 2018&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-22&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-22&quot;&gt;[22]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:104 --&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:147:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc14&quot;&gt;&lt;a name=&quot;Implementations-Initalization&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:147 --&gt;Initalization&lt;/h2&gt;
 &lt;!-- ws:start:WikiTextHeadingRule:149:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc15&quot;&gt;&lt;a name=&quot;Implementations-Initalization-Looking for Magics&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:149 --&gt;Looking for Magics&lt;/h3&gt;
 The main issue is to find 64 magic factors for each rook and bishop square, to ensure they are free of collisions.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Looking%20for%20Magics&quot;&gt;Looking for Magics&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:151:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc16&quot;&gt;&lt;a name=&quot;Implementations-Initalization-Magic Records&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:151 --&gt;Magic Records&lt;/h3&gt;
 You may try to find your own magics - to possibly contribute to the record table for most dense fancy or plain tables. So far, there were no magics found for the expensive rook squares a1 and h1 (0, 7) with less than 12 bits, which would allow to half the plain table size. Is there any prove they don&#039;t exist - even with &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards#BlackMagics&quot;&gt;Black Magic&lt;/a&gt;?&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Best%20Magics%20so%20far&quot;&gt;Best Magics so far&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:153:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc17&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:153 --&gt;See also&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/BMI2#PEXTBitboards&quot;&gt;BMI2 - PEXT Bitboards&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Kindergarten%20Bitboards&quot;&gt;Kindergarten Bitboards&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:155:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc18&quot;&gt;&lt;a name=&quot;Publications&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:155 --&gt;Publications&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Pradu%20Kannan&quot;&gt;Pradu Kannan&lt;/a&gt; (&lt;strong&gt;2007&lt;/strong&gt;). &lt;em&gt;Magic Move-Bitboard Generation in Computer Chess&lt;/em&gt;, as &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.pradu.us/old/Nov27_2008/Buzz/research/magic/Bitboards.pdf&quot; rel=&quot;nofollow&quot;&gt;pdf&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Fritz%20Reul&quot;&gt;Fritz Reul&lt;/a&gt; (&lt;strong&gt;2009&lt;/strong&gt;). &lt;em&gt;New Architectures in Computer Chess&lt;/em&gt;, Ph.D. Thesis, Chapter 3, Magic Hash Functions for Bitboards, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://pure.uvt.nl/ws/files/1098572/Proefschrift_Fritz_Reul_170609.pdf&quot; rel=&quot;nofollow&quot;&gt;pdf&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Maurizio%20Monge&quot;&gt;Maurizio Monge&lt;/a&gt; (&lt;strong&gt;2011&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://scholar.google.com/citations?view_op=view_citation&amp;amp;hl=en&amp;amp;user=gpgb4LgAAAAJ&amp;amp;citation_for_view=gpgb4LgAAAAJ:UeHWp8X0CEIC&quot; rel=&quot;nofollow&quot;&gt;On perfect hashing of numbers with sparse digit representation via multiplication by a constant&lt;/a&gt;&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.sciencedirect.com/science/article/pii/S0166218X11000837&quot; rel=&quot;nofollow&quot;&gt;Discrete Applied Mathematics, Vol. 159, No. 11&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:157:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc19&quot;&gt;&lt;a name=&quot;Forum Posts&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:157 --&gt;Forum Posts&lt;/h1&gt;
&lt;!-- ws:start:WikiTextHeadingRule:159:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc20&quot;&gt;&lt;a name=&quot;Forum Posts-2006&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:159 --&gt;2006&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?t=5015&quot; rel=&quot;nofollow&quot;&gt;Fast(er) bitboard move generator&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Lasse%20Hansen&quot;&gt;Lasse Hansen&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, June 14, &lt;a class=&quot;wiki_link&quot; href=&quot;/Timeline#2006&quot;&gt;2006&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?t=5441&quot; rel=&quot;nofollow&quot;&gt;List of magics for bitboard move generation&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Pradu%20Kannan&quot;&gt;Pradu Kannan&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, August 23, 2006&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;t=5452&quot; rel=&quot;nofollow&quot;&gt;Fastest Magic Move Bitboard Generator ready to use&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Pradu%20Kannan&quot;&gt;Pradu Kannan&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, August 25, 2006&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?t=5997&quot; rel=&quot;nofollow&quot;&gt;A Faster Magic Move Bitboard Generator?&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Grant%20Osborne&quot;&gt;Grant Osborne&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, December 15, 2006&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:161:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc21&quot;&gt;&lt;a name=&quot;Forum Posts-2007&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:161 --&gt;2007&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?t=6104&quot; rel=&quot;nofollow&quot;&gt;SEE with magic bitboards&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Pradu%20Kannan&quot;&gt;Pradu Kannan&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, January 24, 2007 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Static%20Exchange%20Evaluation&quot;&gt;Static Exchange Evaluation&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=15896&quot; rel=&quot;nofollow&quot;&gt;Magic bitboards, Java&lt;/a&gt; by Sargon, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 19, 2007 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=16002&quot; rel=&quot;nofollow&quot;&gt;BitBoard Tests Magic v Non-Rotated 32 Bits v 64 Bits&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Brian%20Richardson&quot;&gt;Brian Richardson&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 24, 2007 &lt;!-- ws:start:WikiTextRefRule:108:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.stmintz.com/ccc/index.php?id=107485&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Movegen Re: Bitmap Type Re: Tinker 81 secs Re: Testing speed&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Brian%20Richardson&amp;quot;&amp;gt;Brian Richardson&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, April 24, 2000&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-23&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-23&quot;&gt;[23]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:108 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;t=6823&quot; rel=&quot;nofollow&quot;&gt;Magic and precomputation&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Onno%20Garms&quot;&gt;Onno Garms&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, September 23, 2007&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:163:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc22&quot;&gt;&lt;a name=&quot;Forum Posts-2008&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:163 --&gt;2008&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;p=175544&amp;amp;t=19699&quot; rel=&quot;nofollow&quot;&gt;Magic Move Generation&lt;/a&gt; by Colin, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, February 18, 2008&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=21329&quot; rel=&quot;nofollow&quot;&gt;How to reduce the &amp;quot;bits&amp;quot; used in a magic number&lt;/a&gt; by Charlie Brune, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, May 24, 2008&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=21543&quot; rel=&quot;nofollow&quot;&gt;magic move - bitboard orientation&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Frank%20Phillips&quot;&gt;Frank Phillips&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, June 01, 2008&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;p=196157&amp;amp;t=21329&quot; rel=&quot;nofollow&quot;&gt;Incorporating the shift into the magic number&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Grant%20Osborne&quot;&gt;Grant Osborne&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, June 18, 2008&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:165:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc23&quot;&gt;&lt;a name=&quot;Forum Posts-2009&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:165 --&gt;2009&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=25810&quot; rel=&quot;nofollow&quot;&gt;Magics revisited&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Richard%20Pijl&quot;&gt;Richard Pijl&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, January 04, 2009&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;t=50043&quot; rel=&quot;nofollow&quot;&gt;Magic with fixed shift&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Onno%20Garms&quot;&gt;Onno Garms&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, March 18, 2009&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=30612&quot; rel=&quot;nofollow&quot;&gt;Paradigm shifts&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gian-Carlo%20Pascutto&quot;&gt;Gian-Carlo Pascutto&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, November 14, 2009&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;t=50616&amp;amp;p=192200&quot; rel=&quot;nofollow&quot;&gt;32-bit Magic experiments&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Andrew%20Fan&quot;&gt;Andrew Fan&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, December 03, 2009 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Kindergarten%20Bitboards&quot;&gt;Kindergarten Bitboards&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:167:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc24&quot;&gt;&lt;a name=&quot;Forum Posts-2010 ...&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:167 --&gt;2010 ...&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=35858&quot; rel=&quot;nofollow&quot;&gt;Plain and fancy magic on modern hardware&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Robert%20Purves&quot;&gt;Robert Purves&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 22, 2010&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;t=51162&quot; rel=&quot;nofollow&quot;&gt;Fixed shift magics with 800KB lookup table&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Volker%20Annuss&quot;&gt;Volker Annuss&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, September, 05, 2010&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=39298&quot; rel=&quot;nofollow&quot;&gt;Build magics on the fly&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Marco%20Costalba&quot;&gt;Marco Costalba&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, June 07, 2011&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=46745&quot; rel=&quot;nofollow&quot;&gt;Magic Multiplier Fundamentals&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Cheney%20Nattress&quot;&gt;Cheney Nattress&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, January 03, 2013&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-chess.org/viewtopic.php?f=5&amp;amp;t=2240&quot; rel=&quot;nofollow&quot;&gt;Occupancy Variations&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Christian%20Daley&quot;&gt;CDaley11&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;OpenChess Forum&lt;/a&gt;, January 25, 2013&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=47576&quot; rel=&quot;nofollow&quot;&gt;Magic bitboards: Cache issues and state of the art?&lt;/a&gt; by Samuel Siltanen, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, March 22, 2013&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;t=52783&quot; rel=&quot;nofollow&quot;&gt;Understanding Magic Bitboards&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Jaco%20van%20Niekerk&quot;&gt;Jaco van Niekerk&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, April 03, 2013&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:169:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc25&quot;&gt;&lt;a name=&quot;Forum Posts-2015 ...&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:169 --&gt;2015 ...&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=55712&quot; rel=&quot;nofollow&quot;&gt;question about magic keys generation time&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Fermin%20Serrano&quot;&gt;Fermin Serrano&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, March 19, 2015 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Looking%20for%20Magics&quot;&gt;Looking for Magics&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=57722&quot; rel=&quot;nofollow&quot;&gt;Fancy magic bitboards question&lt;/a&gt; by Eric VanderHelm, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, September 22, 2015&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=60007&quot; rel=&quot;nofollow&quot;&gt;M42 - A C++ library for Bitboard attack mask generation&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Syed%20Fahad&quot;&gt;Syed Fahad&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, April 30, 2016 &lt;!-- ws:start:WikiTextRefRule:111:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://sites.google.com/site/sydfhd/projects/m42&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;M42&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Syed%20Fahad&amp;quot;&amp;gt;Syed Fahad&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-24&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-24&quot;&gt;[24]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:111 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=60065&quot; rel=&quot;nofollow&quot;&gt;understanding fixed shift fancy magic bitboard generation&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Kalyankumar%20Ramaseshan&quot;&gt;Kalyankumar Ramaseshan&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, May 05, 2016&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=60065&amp;amp;start=14&quot; rel=&quot;nofollow&quot;&gt;Re: understanding fixed shift fancy magic bitboard generation&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Volker%20Annuss&quot;&gt;Volker Annuss&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, May 06, 2016&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=62561&quot; rel=&quot;nofollow&quot;&gt;Why should magic bitboards be sparse?&lt;/a&gt; by Alessandro Power, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, December 21, 2016&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=64578&quot; rel=&quot;nofollow&quot;&gt;Looking for dense magics&lt;/a&gt; by Lucas Braesch, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, July 11, 2017&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=64790&quot; rel=&quot;nofollow&quot;&gt;Black magic bitboards&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Volker%20Annuss&quot;&gt;Volker Annuss&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 03, 2017 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards#BlackMagics&quot;&gt;Black Magic Bitboards&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=65187&quot; rel=&quot;nofollow&quot;&gt;Disproving the existence of some magics&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Niklas%20Fiekas&quot;&gt;Niklas Fiekas&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, September 16, 2017 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Looking%20for%20Magics&quot;&gt;Looking for Magics&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=66538&quot; rel=&quot;nofollow&quot;&gt;magic number comprising offset&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Eugene%20Kotlov&quot;&gt;Eugene Kotlov&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, February 07, 2018&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=67051&quot; rel=&quot;nofollow&quot;&gt;No bishop magics with fixed shift 8&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Niklas%20Fiekas&quot;&gt;Niklas Fiekas&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, April 09, 2018 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Looking%20for%20Magics&quot;&gt;Looking for Magics&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:171:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc26&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:171 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.pradu.us/old/Nov27_2008/Buzz/&quot; rel=&quot;nofollow&quot;&gt;Buzz - A Winboard Chess Playing Program by Pradu Kannan&lt;/a&gt; - Source of &lt;a class=&quot;wiki_link&quot; href=&quot;/Pradu%20Kannan&quot;&gt;Pradu Kannan&#039;s&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards&quot;&gt;magic&lt;/a&gt; Move Generator&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.rivalchess.com/magic-bitboards/&quot; rel=&quot;nofollow&quot;&gt;Rival Chess Engine - Magic Bitboards&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Russell%20Newman&quot;&gt;Russell Newman&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Chris%20Moreton&quot;&gt;Chris Moreton&lt;/a&gt; » &lt;a class=&quot;wiki_link&quot; href=&quot;/Rival&quot;&gt;Rival&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.chessprogramming.net/generating-magic-multipliers/&quot; rel=&quot;nofollow&quot;&gt;Chess Programming | Generating Magic Multipliers&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Steve%20Maughan&quot;&gt;Steve Maughan&lt;/a&gt; » &lt;a class=&quot;wiki_link&quot; href=&quot;/Looking%20for%20Magics&quot;&gt;Looking for Magics&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://stackoverflow.com/questions/16925204/sliding-move-generation-using-magic-bitboard&quot; rel=&quot;nofollow&quot;&gt;chess - Sliding move generation using magic bitboard&lt;/a&gt; - &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Stack_Overflow&quot; rel=&quot;nofollow&quot;&gt;Stack Overflow&lt;/a&gt;, June 4, 2013&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://sites.google.com/site/sydfhd/projects/m42&quot; rel=&quot;nofollow&quot;&gt;M42&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Syed%20Fahad&quot;&gt;Syed Fahad&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:115:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=60007&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;M42 - A C++ library for Bitboard attack mask generation&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Syed%20Fahad&amp;quot;&amp;gt;Syed Fahad&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, April 30, 2016&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-25&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-25&quot;&gt;[25]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:115 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://github.com/goutham/magic-bits&quot; rel=&quot;nofollow&quot;&gt;GitHub - goutham/magic-bits: Magic-bitboards for Chess&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Goutham%20Bhat&quot;&gt;Goutham Bhat&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:173:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc27&quot;&gt;&lt;a name=&quot;Other Magic Stuff&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:173 --&gt;Other Magic Stuff&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Magic&quot; rel=&quot;nofollow&quot;&gt;Magic from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Magic_%28illusion%29&quot; rel=&quot;nofollow&quot;&gt;Magic (illusion) from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Magic_%28paranormal%29&quot; rel=&quot;nofollow&quot;&gt;Magic (paranormal) from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Magic_%28cryptography%29&quot; rel=&quot;nofollow&quot;&gt;Magic (cryptography) from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Magic_number_%28programming%29&quot; rel=&quot;nofollow&quot;&gt;Magic number from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Magic_constant&quot; rel=&quot;nofollow&quot;&gt;Magic constant from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Magic_square&quot; rel=&quot;nofollow&quot;&gt;Magic square from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Magic_hypercube&quot; rel=&quot;nofollow&quot;&gt;Magic hypercube from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Five Senses - Magic Constant, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.kalevatravel.ee/index.aw/tallinn2011_culture_capital_europe&quot; rel=&quot;nofollow&quot;&gt;Christmas Jazz Festival&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Tallinn&quot; rel=&quot;nofollow&quot;&gt;Tallinn&lt;/a&gt;, December 10, 2011, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/YouTube&quot; rel=&quot;nofollow&quot;&gt;YouTube&lt;/a&gt; Video&lt;br /&gt;
line-up: &lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#NguyenLe&quot;&gt;Nguyên Lê&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://de.wikipedia.org/wiki/Claudio_Puntin&quot; rel=&quot;nofollow&quot;&gt;Claudio Puntin&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://de.wikipedia.org/wiki/Steffen_Schorn&quot; rel=&quot;nofollow&quot;&gt;Steffen Schorn&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://de.wikipedia.org/wiki/Kristjan_Randalu&quot; rel=&quot;nofollow&quot;&gt;Kristjan Randalu&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.bodekjanke.de/english/home.php&quot; rel=&quot;nofollow&quot;&gt;Bodek Janke&lt;/a&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextMediaRule:116:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/youtube/oUDnf2fSIRQ?h=315&amp;amp;w=560&amp;quot; class=&amp;quot;WikiMedia WikiMediaYoutube&amp;quot; id=&amp;quot;wikitext@@media@@type=&amp;amp;quot;youtube&amp;amp;quot; key=&amp;amp;quot;oUDnf2fSIRQ&amp;amp;quot; width=&amp;amp;quot;560&amp;amp;quot;&amp;quot; title=&amp;quot;YouTube Video&amp;quot;height=&amp;quot;315&amp;quot; width=&amp;quot;560&amp;quot;/&amp;gt; --&gt;&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/oUDnf2fSIRQ&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;!-- ws:end:WikiTextMediaRule:116 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#YounSunNah&quot;&gt;Youn Sun Nah&lt;/a&gt; - &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.allaboutjazz.com/lento-youn-sun-nah-act-music-review-by-ian-patterson.php&quot; rel=&quot;nofollow&quot;&gt;Momento Magico&lt;/a&gt; (2013), &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/YouTube&quot; rel=&quot;nofollow&quot;&gt;YouTube&lt;/a&gt; Video&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#YounSunNah&quot;&gt;Youn Sun Nah&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#UlfWakenius&quot;&gt;Ulf Wakenius&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#LarsDanielsson&quot;&gt;Lars Danielsson&lt;/a&gt;,  &lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#VincentPeirani&quot;&gt;Vincent Peirani&lt;/a&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextMediaRule:117:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/youtube/bOvB6gUpsuk?h=315&amp;amp;w=560&amp;quot; class=&amp;quot;WikiMedia WikiMediaYoutube&amp;quot; id=&amp;quot;wikitext@@media@@type=&amp;amp;quot;youtube&amp;amp;quot; key=&amp;amp;quot;bOvB6gUpsuk&amp;amp;quot;&amp;quot; title=&amp;quot;YouTube Video&amp;quot;height=&amp;quot;315&amp;quot; width=&amp;quot;560&amp;quot;/&amp;gt; --&gt;&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/bOvB6gUpsuk&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;!-- ws:end:WikiTextMediaRule:117 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:175:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc28&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:175 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:1148:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;p=140141&amp;amp;t=16002&quot; rel=&quot;nofollow&quot;&gt;Re: BitBoard Tests Magic v Non-Rotated 32 Bits v 64 Bits&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Robert%20Hyatt&quot;&gt;Robert Hyatt&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 25, 2007&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.arasanchess.org/blogs/aug08.html&quot; rel=&quot;nofollow&quot;&gt;Arasan Blog - Aug 26, 2008&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Jon%20Dart&quot;&gt;Jon Dart&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-3&quot;&gt;&lt;a href=&quot;#cite_ref-3&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.puckergallery.com/artists/bak_major/bak_major_all.html&quot; rel=&quot;nofollow&quot;&gt;Major Works&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.puckergallery.com/artists/bak_index/bak_publications.html&quot; rel=&quot;nofollow&quot;&gt;Samuel Bak - represented by Pucker Gallery since 1969&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-4&quot;&gt;&lt;a href=&quot;#cite_ref-4&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=489834&quot; rel=&quot;nofollow&quot;&gt;rotated bitboards obsolete?&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, February 26, 2006&lt;/li&gt;
&lt;li id=&quot;cite_note-5&quot;&gt;&lt;a href=&quot;#cite_ref-5&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?t=5015&quot; rel=&quot;nofollow&quot;&gt;Fast(er) bitboard move generator&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Lasse%20Hansen&quot;&gt;Lasse Hansen&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, June 14, &lt;a class=&quot;wiki_link&quot; href=&quot;/Timeline#2006&quot;&gt;2006&lt;/a&gt;, Initial idea&lt;/li&gt;
&lt;li id=&quot;cite_note-6&quot;&gt;&lt;a href=&quot;#cite_ref-6&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Pradu%20Kannan&quot;&gt;Pradu Kannan&lt;/a&gt; (&lt;strong&gt;2007&lt;/strong&gt;). &lt;em&gt;Magic Move-Bitboard Generation in Computer Chess&lt;/em&gt;, as &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.pradu.us/old/Nov27_2008/Buzz/research/magic/Bitboards.pdf&quot; rel=&quot;nofollow&quot;&gt;pdf&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-7&quot;&gt;&lt;a href=&quot;#cite_ref-7&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?t=5441&quot; rel=&quot;nofollow&quot;&gt;List of magics for bitboard move generation&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Pradu%20Kannan&quot;&gt;Pradu Kannan&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, August 23, &lt;a class=&quot;wiki_link&quot; href=&quot;/Timeline#2006&quot;&gt;2006&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-8&quot;&gt;&lt;a href=&quot;#cite_ref-8&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=35858&quot; rel=&quot;nofollow&quot;&gt;Plain and fancy magic on modern hardware&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Robert%20Purves&quot;&gt;Robert Purves&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 22, 2010&lt;/li&gt;
&lt;li id=&quot;cite_note-9&quot;&gt;&lt;a href=&quot;#cite_ref-9&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.pradu.us/old/Nov27_2008/Buzz/&quot; rel=&quot;nofollow&quot;&gt;Buzz - A Winboard Chess Playing Program by Pradu Kannan&lt;/a&gt; - Source of &lt;a class=&quot;wiki_link&quot; href=&quot;/Pradu%20Kannan&quot;&gt;Pradu Kannan&#039;s&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards&quot;&gt;magic&lt;/a&gt; Move Generator, PERFECT_MAGIC_HASH&lt;/li&gt;
&lt;li id=&quot;cite_note-10&quot;&gt;&lt;a href=&quot;#cite_ref-10&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.pradu.us/old/Nov27_2008/Buzz/&quot; rel=&quot;nofollow&quot;&gt;Buzz - A Winboard Chess Playing Program by Pradu Kannan&lt;/a&gt; - Source of &lt;a class=&quot;wiki_link&quot; href=&quot;/Pradu%20Kannan&quot;&gt;Pradu Kannan&#039;s&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards&quot;&gt;magic&lt;/a&gt; Move Generator, MINIMIZE_MAGIC&lt;/li&gt;
&lt;li id=&quot;cite_note-11&quot;&gt;&lt;a href=&quot;#cite_ref-11&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;t=50043&quot; rel=&quot;nofollow&quot;&gt;Magic with fixed shift&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Onno%20Garms&quot;&gt;Onno Garms&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, March 18, 2009&lt;/li&gt;
&lt;li id=&quot;cite_note-12&quot;&gt;&lt;a href=&quot;#cite_ref-12&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;t=51162&quot; rel=&quot;nofollow&quot;&gt;Fixed shift magics with 800KB lookup table&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Volker%20Annuss&quot;&gt;Volker Annuss&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, September, 05, 2010&lt;/li&gt;
&lt;li id=&quot;cite_note-13&quot;&gt;&lt;a href=&quot;#cite_ref-13&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=60065&amp;amp;start=14&quot; rel=&quot;nofollow&quot;&gt;Re: understanding fixed shift fancy magic bitboard generation&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Volker%20Annuss&quot;&gt;Volker Annuss&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, May 06, 2016&lt;/li&gt;
&lt;li id=&quot;cite_note-14&quot;&gt;&lt;a href=&quot;#cite_ref-14&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=64790&quot; rel=&quot;nofollow&quot;&gt;Black magic bitboards&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Volker%20Annuss&quot;&gt;Volker Annuss&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 03, 2017&lt;/li&gt;
&lt;li id=&quot;cite_note-15&quot;&gt;&lt;a href=&quot;#cite_ref-15&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=64790&amp;amp;start=11&quot; rel=&quot;nofollow&quot;&gt;Re: Black magic bitboards&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Volker%20Annuss&quot;&gt;Volker Annuss&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 04, 2017&lt;/li&gt;
&lt;li id=&quot;cite_note-16&quot;&gt;&lt;a href=&quot;#cite_ref-16&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=64790&amp;amp;start=14&quot; rel=&quot;nofollow&quot;&gt;Re: Black magic bitboards&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Volker%20Annuss&quot;&gt;Volker Annuss&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 04, 2017&lt;/li&gt;
&lt;li id=&quot;cite_note-17&quot;&gt;&lt;a href=&quot;#cite_ref-17&quot;&gt;^&lt;/a&gt; source code according to the &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards#FixedShiftFancy&quot;&gt;fixed shift fancy&lt;/a&gt; sample - array size from Volker&#039;s posting, also containing black magics and arrayoffsets, see &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=64790&quot; rel=&quot;nofollow&quot;&gt;Black magic bitboards&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Volker%20Annuss&quot;&gt;Volker Annuss&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 03, 2017&lt;/li&gt;
&lt;li id=&quot;cite_note-18&quot;&gt;&lt;a href=&quot;#cite_ref-18&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;p=368026&amp;amp;t=35858&quot; rel=&quot;nofollow&quot;&gt;Re: Plain and fancy magic on modern hardware&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Robert%20Houdart&quot;&gt;Robert Houdart&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 26, 2010&lt;/li&gt;
&lt;li id=&quot;cite_note-19&quot;&gt;&lt;a href=&quot;#cite_ref-19&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?t=5997&quot; rel=&quot;nofollow&quot;&gt;A Faster Magic Move Bitboard Generator?&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Grant%20Osborne&quot;&gt;Grant Osborne&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, December 15, 2006&lt;/li&gt;
&lt;li id=&quot;cite_note-20&quot;&gt;&lt;a href=&quot;#cite_ref-20&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Lasse%20Hansen&quot;&gt;Lasse Hansen&#039;s&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?topic_view=threads&amp;amp;p=185506&amp;amp;t=5441&quot; rel=&quot;nofollow&quot;&gt;postmask trick&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, May 09, 2008&lt;/li&gt;
&lt;li id=&quot;cite_note-21&quot;&gt;&lt;a href=&quot;#cite_ref-21&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;p=196157&amp;amp;t=21329&quot; rel=&quot;nofollow&quot;&gt;Incorporating the shift into the magic number&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Grant%20Osborne&quot;&gt;Grant Osborne&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, June 18, 2008&lt;/li&gt;
&lt;li id=&quot;cite_note-22&quot;&gt;&lt;a href=&quot;#cite_ref-22&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=66538&quot; rel=&quot;nofollow&quot;&gt;magic number comprising offset&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Eugene%20Kotlov&quot;&gt;Eugene Kotlov&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, February 07, 2018&lt;/li&gt;
&lt;li id=&quot;cite_note-23&quot;&gt;&lt;a href=&quot;#cite_ref-23&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=107485&quot; rel=&quot;nofollow&quot;&gt;Movegen Re: Bitmap Type Re: Tinker 81 secs Re: Testing speed&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Brian%20Richardson&quot;&gt;Brian Richardson&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, April 24, 2000&lt;/li&gt;
&lt;li id=&quot;cite_note-24&quot;&gt;&lt;a href=&quot;#cite_ref-24&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://sites.google.com/site/sydfhd/projects/m42&quot; rel=&quot;nofollow&quot;&gt;M42&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Syed%20Fahad&quot;&gt;Syed Fahad&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-25&quot;&gt;&lt;a href=&quot;#cite_ref-25&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=60007&quot; rel=&quot;nofollow&quot;&gt;M42 - A C++ library for Bitboard attack mask generation&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Syed%20Fahad&quot;&gt;Syed Fahad&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, April 30, 2016&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:1148 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:177:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc29&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:177 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:013:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Magic Bitboards&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;200&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Magic Bitboards&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;200&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Magic_Bitboards includeBody-Magic%20Bitboards includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Abbess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Abbess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Abulafia&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Abulafia&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 4, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Alberto+Sanjuan&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Alberto Sanjuan&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 3, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AMD&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AMD&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 9, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Andreas+Guettinger&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Andreas Guettinger&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 14, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Andrew+Fan&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Andrew Fan&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 30, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Andscacs&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Andscacs&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 16, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Arasan&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Arasan&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 8, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Arminius&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Arminius&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 5, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Array&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Array&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 1, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Atlas+%28ESP%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Atlas (ESP)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 28, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Backtracking&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Backtracking&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Barbarossa&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Barbarossa&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 20, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BBChess+%28SI%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BBChess (SI)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 12, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Best+Magics+so+far&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Best Magics so far&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 13, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitboard+Serialization&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitboard Serialization&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 24, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 14, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BMI2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BMI2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bobcat&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bobcat&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Brutus+NL&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Brutus NL&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 22, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Buzz&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Buzz&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 22, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Carballo&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Carballo&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 2, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Cheese&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Cheese&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 17, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Cheng&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Cheng&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 30, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/chess22k&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;chess22k&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 23, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/chess4j&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;chess4j&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 1, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Chiron&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Chiron&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Clarabit&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Clarabit&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 3, 2011&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Congruent+Modulo+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Congruent Modulo Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 26, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Counter&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Counter&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 13, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Crafty&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Crafty&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 28, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/CuckooChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;CuckooChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 17, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Defenchess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Defenchess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 18, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Demolito&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Demolito&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 1, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/DiscoCheck&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;DiscoCheck&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 23, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Djinn&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Djinn&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 8, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Don+Dailey&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Don Dailey&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Donna&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Donna&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 17, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Edsel+Apostol&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Edsel Apostol&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 2, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Efficient+Generation+of+Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Efficient Generation of Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Eric+Marath%C3%A9e&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Eric Marathée&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 27, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Ethereal&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Ethereal&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 20, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Exacto&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Exacto&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 3, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Fire&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Fire&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 12, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Firefly&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Firefly&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 23, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Fridolin&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Fridolin&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Galjoen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Galjoen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 19, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Garbochess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Garbochess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 23, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gerd+Isenberg&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gerd Isenberg&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 4, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gibbon&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gibbon&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 23, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Ginkgo&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Ginkgo&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 13, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Giraffe&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Giraffe&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 8, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Glaurung&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Glaurung&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 14, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Godot&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Godot&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 28, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gogobello&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gogobello&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 30, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/GopherCheck&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;GopherCheck&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 3, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Grant+Osborne&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Grant Osborne&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 2, 2011&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Greko&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Greko&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 27, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/GullChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;GullChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hakkapeliitta&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hakkapeliitta&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 26, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hash+Table&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hash Table&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 1, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hashing+Dictionaries&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hashing Dictionaries&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 1, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hedgehog&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hedgehog&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 18, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hermann&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hermann&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hiding+the+Implementation&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hiding the Implementation&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 3, 2011&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Home&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Home&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 2, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Houdini&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Houdini&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 14, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/iCE&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;iCE&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 4, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Ifrit&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Ifrit&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Java&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Java&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/JFresh&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;JFresh&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 2, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kholin&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kholin&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 3, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kindergarten+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kindergarten Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 1, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Laser&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Laser&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Lasse+Hansen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Lasse Hansen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 1, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Looking+for+Magics&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Looking for Magics&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 13, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Loop+%28Program%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Loop (Program)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 14, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Magic+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Magic Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 13, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Marco+Costalba&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Marco Costalba&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 28, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mark+Levene&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mark Levene&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 2, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Marvin&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Marvin&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 10, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Maurizio+Monge&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Maurizio Monge&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 27, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Maverick&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Maverick&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/MinkoChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;MinkoChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 5, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Move+Generation&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Move Generation&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 29, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Murka&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Murka&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Napoleon&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Napoleon&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Nemorino&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Nemorino&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 21, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/NoraGrace&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;NoraGrace&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 23, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Occupancy&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Occupancy&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 19, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Octochess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Octochess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 15, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Onno&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Onno&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 19, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Onno+Garms&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Onno Garms&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 19, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Orion&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Orion&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 15, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Paladin&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Paladin&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 29, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pawn+Hash+Table&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pawn Hash Table&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 1, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pawny&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pawny&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 17, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pedone&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pedone&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 16, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pradu+Kannan&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pradu Kannan&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 3, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Prophet&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Prophet&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 30, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Protector&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Protector&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 12, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/RedQueen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;RedQueen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 13, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rhetoric&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rhetoric&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 15, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rival&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rival&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 30, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Robert+Houdart&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Robert Houdart&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Robert+Hyatt&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Robert Hyatt&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Robert+Pope&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Robert Pope&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Robocide&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Robocide&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rodent&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rodent&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 11, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rodin&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rodin&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/RuyDos&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;RuyDos&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 17, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rybka&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rybka&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Schooner&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Schooner&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 2, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Scorpio&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Scorpio&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 28, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Searcher&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Searcher&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 26, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SEE+-+The+Swap+Algorithm&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SEE - The Swap Algorithm&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Senpai&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Senpai&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Shield&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Shield&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 17, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sloppy&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sloppy&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 17, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SmarThink&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SmarThink&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 2, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SnailChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SnailChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 26, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Space-Time+Tradeoff&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Space-Time Tradeoff&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 17, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Static+Exchange+Evaluation&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Static Exchange Evaluation&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 14, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Stockfish&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Stockfish&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 7, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Syed+Fahad&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Syed Fahad&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 1, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Takuya+Obata&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Takuya Obata&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Texel&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Texel&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 9, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Tim+Kosse&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Tim Kosse&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 23, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Tinker&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Tinker&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Titboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Titboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 20, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Tornado&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Tornado&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 14, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Traversing+Subsets+of+a+Set&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Traversing Subsets of a Set&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 14, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Trevor+Fenner&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Trevor Fenner&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 2, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Trial+and+Error&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Trial and Error&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 11, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Tucano&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Tucano&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Tunguska&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Tunguska&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Vadim+Demichev&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Vadim Demichev&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 26, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Vajolet&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Vajolet&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Volker+Annuss&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Volker Annuss&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 3, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Wing&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Wing&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 26, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Winglet&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Winglet&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 26, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Winter&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Winter&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 23, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/WyldChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;WyldChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 10, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Xiphos&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Xiphos&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 22, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Zevra&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Zevra&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 12, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Ziggurat&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Ziggurat&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 9, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Zurichess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Zurichess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 12, 2018&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:013 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Obstruction Difference</title>
      <link>https://chessprogramming.wikispaces.com/Obstruction+Difference</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Obstruction+Difference</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Obstruction+Difference</comments>
      <pubDate>Fri, 27 May 2016 12:50:52 GMT</pubDate>
      <description>&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Board%20Representation&quot;&gt;Board Representation&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Bitboards&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Sliding Piece Attacks&lt;/a&gt; * Obstruction Difference&lt;/strong&gt;&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:60:&amp;lt;a href=&amp;quot;http://www.imj.org.il/imagine/collections/item.asp?itemNum=194569&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/Obstruction.jpg/157882347/357x209/Obstruction.jpg&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; style=&amp;quot;height: 209px; width: 357px;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;http://www.imj.org.il/imagine/collections/item.asp?itemNum=194569&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/Obstruction.jpg/157882347/357x209/Obstruction.jpg&quot; alt=&quot;Obstruction.jpg&quot; title=&quot;Obstruction.jpg&quot; style=&quot;height: 209px; width: 357px;&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:60 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td rowspan=&quot;2&quot;&gt;&lt;strong&gt;Obstruction Difference&lt;/strong&gt; is another subtraction approach, proposed by &lt;a class=&quot;wiki_link&quot; href=&quot;/Michael%20Hoffmann&quot;&gt;Michael Hoffmann&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:8:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=29087&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;DIRECT BITBOARD MOVEGENERATION&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Michael%20Hoffmann&amp;quot;&amp;gt;Michael Hoffmann&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, July 23, 2009&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:8 --&gt;. The idea is to get disjoint &lt;a class=&quot;wiki_link&quot; href=&quot;/On%20an%20empty%20Board#PositiveRays&quot;&gt;positive&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/On%20an%20empty%20Board#NegativeRays&quot;&gt;negative ray masks&lt;/a&gt; of the &lt;a class=&quot;wiki_link&quot; href=&quot;/Occupancy&quot;&gt;occupancy&lt;/a&gt;, and to subtract the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheMostSignificantOneBitMS1B&quot;&gt;most significant one bit&lt;/a&gt; of the negative ray from the doubled &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheLeastSignificantOneBitLS1B&quot;&gt;least siginificat one bit&lt;/a&gt; (LS1B) of the positive ray. The difference is finally intersected with the linemask, excluding the &lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Pieces&quot;&gt;sliding piece&lt;/a&gt; itself from the attack set.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Arts#Ray&quot;&gt;Man Ray&lt;/a&gt;, Obstruction, 1947 &lt;!-- ws:start:WikiTextRefRule:10:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.imj.org.il/imagine/collections/viewDataE5.asp?case=Modern%20Art&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;IMAGINE - The Israel Museum&#039;s searchable collections database&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:10 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextTocRule:29:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:29 --&gt;&lt;!-- ws:start:WikiTextTocRule:30: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Empty Sets&quot;&gt;Empty Sets&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:30 --&gt;&lt;!-- ws:start:WikiTextTocRule:31: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Isolation&quot;&gt;Isolation&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:31 --&gt;&lt;!-- ws:start:WikiTextTocRule:32: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#C Code&quot;&gt;C Code&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:32 --&gt;&lt;!-- ws:start:WikiTextTocRule:33: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Java&quot;&gt;Java&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:33 --&gt;&lt;!-- ws:start:WikiTextTocRule:34: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#How it works&quot;&gt;How it works&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:34 --&gt;&lt;!-- ws:start:WikiTextTocRule:35: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:35 --&gt;&lt;!-- ws:start:WikiTextTocRule:36: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:36 --&gt;&lt;!-- ws:start:WikiTextTocRule:37: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:37 --&gt;&lt;!-- ws:start:WikiTextTocRule:38: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:38 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:13:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Empty Sets&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:13 --&gt;Empty Sets&lt;/h1&gt;
 If there is no obstruction inside the positive ray, we simply subtract from zero, aka borrow from the hidden 2^64 bit, same if doubling results in an empty set. If there is no obstruction inside the negative ray, we need at least to subtract one. With neither blocker available, the difference is the universal set -1 (~0), and we end up with the linemask, excluding the sliding piece, which are all &lt;a class=&quot;wiki_link&quot; href=&quot;/On%20an%20empty%20Board&quot;&gt;attacks on the otherwise empty board&lt;/a&gt;. Therefor, to subtract at least &#039;1&#039;, oring &#039;1&#039; is required if the negative ray occupancy is empty. Since setting the least significant bit does not affect any MS1B extraction, it can be done unconditionally on the negative ray.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:15:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Isolation&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:15 --&gt;Isolation&lt;/h1&gt;
 While &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#LS1BIsolation&quot;&gt;isolation of the LS1B&lt;/a&gt; is the intersection of a bitboard with its &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheTwosComplement&quot;&gt;two&#039;s complement&lt;/a&gt;, the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheMostSignificantOneBitMS1B&quot;&gt;MS1B&lt;/a&gt; is not that simple to extract, and requires a fast 64-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#Bitscanreverse&quot;&gt;BitScanReverse&lt;/a&gt;, f.i. &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64#gpinstructions&quot;&gt;bsr&lt;/a&gt; with throughput in the &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#x86Timing&quot;&gt;one cycle range&lt;/a&gt;, as with &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&#039;s&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Intel_Core_2&quot; rel=&quot;nofollow&quot;&gt;Core 2&lt;/a&gt; or &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Nehalem_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;Nehalem architecture&lt;/a&gt;, or &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#LeadingZeroCount&quot;&gt;Leading Zero Count&lt;/a&gt;, f.i. &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64#gpinstructions&quot;&gt;lzcnt&lt;/a&gt; on &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/AMD_K10&quot; rel=&quot;nofollow&quot;&gt;K10&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&lt;/a&gt; Nehalem CPUs.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:17:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;C Code&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:17 --&gt;C Code&lt;/h1&gt;
 The routine works for all lines, &lt;a class=&quot;wiki_link&quot; href=&quot;/Ranks&quot;&gt;ranks&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Files&quot;&gt;files&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Diagonals&quot;&gt;diagonals&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Anti-Diagonals&quot;&gt;anti-diagonals&lt;/a&gt; by applying appropriate line-masks, and could therefor used as a generalized routine with a line-direction parameter, or in &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt; even passing a pointer to a structure with three (or multiples for several lines in parallel) bitboards per square and line, upper- and lower rays and the union of both.&lt;br /&gt;
&lt;!-- ws:start:WikiTextIncludeRule:05:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/page?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;MappingHint&amp;amp;quot;&amp;quot; title=&amp;quot;Include page: page=&amp;amp;quot;MappingHint&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;

&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a href=&quot;/Square%20Mapping%20Considerations&quot;&gt;&lt;img src=&quot;/file/view/mapping.JPG/93134172/mapping.JPG&quot; alt=&quot;mapping.JPG&quot; title=&quot;mapping.JPG&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;em&gt;Code samples and bitboard diagrams rely on &lt;a class=&quot;wiki_link&quot; href=&quot;/Square%20Mapping%20Considerations#LittleEndianRankFileMapping&quot;&gt;Little endian file and rank mapping&lt;/a&gt;&lt;/em&gt;.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:end:WikiTextIncludeRule:05 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/*&amp;lt;br/&amp;gt; * @author Michael Hoffmann, Gerd Isenberg&amp;lt;br/&amp;gt; * @param  U64 occ occupancy of the board&amp;lt;br/&amp;gt; * @param  SMasks* a mask structure by square and line&amp;lt;br/&amp;gt; * @return line attacks from that square&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;U64 lineAttacks(U64 occ, const SMasks *pMask) {&amp;lt;br/&amp;gt;   U64 lower, upper, mMS1B, ls1b, odiff;&amp;lt;br/&amp;gt;   lower = pMask-&amp;amp;gt;lower &amp;amp;amp; occ;&amp;lt;br/&amp;gt;   upper = pMask-&amp;amp;gt;upper &amp;amp;amp; occ;&amp;lt;br/&amp;gt;   mMS1B = -C64(1) &amp;amp;lt;&amp;amp;lt; bsr64(lower | 1); // ms1b of lower (at least bit zero)&amp;lt;br/&amp;gt;   ls1b  = upper &amp;amp;amp; -upper;&amp;lt;br/&amp;gt;   odiff = 2 * ls1b + mMS1B; // x86 lea option due to add -ms1b&amp;lt;br/&amp;gt;   return pMask-&amp;amp;gt;lineEx &amp;amp;amp; odiff; // (pMask-&amp;amp;gt;lower | pMask-&amp;amp;gt;upper) &amp;amp;amp; odiff;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/*
 * @author Michael Hoffmann, Gerd Isenberg
 * @param  U64 occ occupancy of the board
 * @param  SMasks* a mask structure by square and line
 * @return line attacks from that square
 */&lt;/span&gt;
U64 lineAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; SMasks &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;pMask&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64 lower, upper, mMS1B, ls1b, odiff&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   lower &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; pMask&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;lower &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; occ&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   upper &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; pMask&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;upper &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; occ&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   mMS1B &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; bsr64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lower &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// ms1b of lower (at least bit zero)&lt;/span&gt;
   ls1b  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; upper &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;upper&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   odiff &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; ls1b &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; mMS1B&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// x86 lea option due to add -ms1b&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; pMask&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;lineEx &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; odiff&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// (pMask-&amp;gt;lower | pMask-&amp;gt;upper) &amp;amp; odiff;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;To use it that way:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;struct SMasks&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;   U64 lower;&amp;lt;br/&amp;gt;   U64 upper;&amp;lt;br/&amp;gt;   U64 lineEx; // lower | upper&amp;lt;br/&amp;gt;} masks[64][4]; // 6 (4) KByte, needs initialization&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 rookAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   return lineAttacks(occ, masks[sq] + 0) | lineAttacks(occ, masks[sq] + 1);&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;U64 bishopAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   return lineAttacks(occ, masks[sq] + 2) | lineAttacks(occ, masks[sq] + 3);&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;struct&lt;/span&gt; SMasks
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64 lower&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   U64 upper&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   U64 lineEx&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// lower | upper&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; masks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 6 (4) KByte, needs initialization&lt;/span&gt;
&amp;nbsp;
U64 rookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; lineAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ, masks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; lineAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ, masks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 bishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; lineAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ, masks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; lineAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ, masks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;Since with two&#039;s complement i &amp;lt;&amp;lt; x == - (-i &amp;lt;&amp;lt; x), 2*high-low is done by add for the option to use &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.cs.virginia.edu/%7Eevans/cs216/guides/x86.html&quot; rel=&quot;nofollow&quot;&gt;x86 lea-instruction&lt;/a&gt;. The routine looks competitive for CPUs with fast &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64#gpinstructions&quot;&gt;bsr&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64#gpinstructions&quot;&gt;lzcnt&lt;/a&gt; but has problems on processors with slow bitScan or 32-bit processors. Register usage is moderate and should suffice all x88-64 scratch registers for two lines, even for &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Visual_C%2B%2B&quot; rel=&quot;nofollow&quot;&gt;Visual C++&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:19:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Java&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:19 --&gt;Java&lt;/h1&gt;
 &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt; programmers may rely on &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Long.html#numberOfLeadingZeros%28long%29&quot; rel=&quot;nofollow&quot;&gt;Long.numberOfLeadingZeros&lt;/a&gt;, where the 64-bit &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Java_virtual_machine&quot; rel=&quot;nofollow&quot;&gt;JVM&lt;/a&gt; may use appropriate machine instructions.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;java5&amp;quot;&amp;gt;/*&amp;lt;br/&amp;gt; * @author Michael Hoffmann, Gerd Isenberg&amp;lt;br/&amp;gt; * @param  long occ occupancy of the board&amp;lt;br/&amp;gt; * @param  int sq  0..63&amp;lt;br/&amp;gt; * @param  int line  0..3 for rank, file, dia, antidia&amp;lt;br/&amp;gt; * @return line attacks from that square&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;long lineAttacks(long occ, int sq, int line) {&amp;lt;br/&amp;gt;   long lower = longMasks[sq][line][0] &amp;amp;amp; occ;&amp;lt;br/&amp;gt;   long upper = longMasks[sq][line][1] &amp;amp;amp; occ;&amp;lt;br/&amp;gt;   long mMs1b = 0x8000000000000000 &amp;amp;gt;&amp;amp;gt; Long.numberOfLeadingZeros (lower | 1);&amp;lt;br/&amp;gt;   long ls1b  = upper &amp;amp;amp; -upper;&amp;lt;br/&amp;gt;   long odiff = 2*ls1b + mMs1b;&amp;lt;br/&amp;gt;   return longMasks[sq][line][2] &amp;amp;amp; odiff;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.java5  {font-family:monospace;}
.java5 .imp {font-weight: bold; color: red;}
.java5 .kw1 {color: #000000;  font-weight: bold;}
.java5 .kw2 {color: #000000; font-weight: bold;}
.java5 .kw3 {color: #006600; font-weight: bold;}
.java5 .kw4 {color: #006600; font-weight: bold;}
.java5 .kw5 {color: #003399; font-weight: bold;}
.java5 .kw6 {color: #003399; font-weight: bold;}
.java5 .kw7 {color: #003399; font-weight: bold;}
.java5 .kw8 {color: #003399; font-weight: bold;}
.java5 .kw9 {color: #003399; font-weight: bold;}
.java5 .kw10 {color: #003399; font-weight: bold;}
.java5 .kw11 {color: #003399; font-weight: bold;}
.java5 .kw12 {color: #003399; font-weight: bold;}
.java5 .kw13 {color: #003399; font-weight: bold;}
.java5 .kw14 {color: #003399; font-weight: bold;}
.java5 .kw15 {color: #003399; font-weight: bold;}
.java5 .kw16 {color: #003399; font-weight: bold;}
.java5 .kw17 {color: #003399; font-weight: bold;}
.java5 .kw18 {color: #003399; font-weight: bold;}
.java5 .kw19 {color: #003399; font-weight: bold;}
.java5 .kw20 {color: #003399; font-weight: bold;}
.java5 .kw21 {color: #003399; font-weight: bold;}
.java5 .kw22 {color: #003399; font-weight: bold;}
.java5 .kw23 {color: #003399; font-weight: bold;}
.java5 .kw24 {color: #003399; font-weight: bold;}
.java5 .kw25 {color: #003399; font-weight: bold;}
.java5 .kw26 {color: #003399; font-weight: bold;}
.java5 .kw27 {color: #003399; font-weight: bold;}
.java5 .kw28 {color: #003399; font-weight: bold;}
.java5 .kw29 {color: #003399; font-weight: bold;}
.java5 .kw30 {color: #003399; font-weight: bold;}
.java5 .kw31 {color: #003399; font-weight: bold;}
.java5 .kw32 {color: #003399; font-weight: bold;}
.java5 .kw33 {color: #003399; font-weight: bold;}
.java5 .kw34 {color: #003399; font-weight: bold;}
.java5 .kw35 {color: #003399; font-weight: bold;}
.java5 .kw36 {color: #003399; font-weight: bold;}
.java5 .kw37 {color: #003399; font-weight: bold;}
.java5 .kw38 {color: #003399; font-weight: bold;}
.java5 .kw39 {color: #003399; font-weight: bold;}
.java5 .kw40 {color: #003399; font-weight: bold;}
.java5 .kw41 {color: #003399; font-weight: bold;}
.java5 .kw42 {color: #003399; font-weight: bold;}
.java5 .kw43 {color: #003399; font-weight: bold;}
.java5 .kw44 {color: #003399; font-weight: bold;}
.java5 .kw45 {color: #003399; font-weight: bold;}
.java5 .kw46 {color: #003399; font-weight: bold;}
.java5 .kw47 {color: #003399; font-weight: bold;}
.java5 .kw48 {color: #003399; font-weight: bold;}
.java5 .kw49 {color: #003399; font-weight: bold;}
.java5 .kw50 {color: #003399; font-weight: bold;}
.java5 .kw51 {color: #003399; font-weight: bold;}
.java5 .kw52 {color: #003399; font-weight: bold;}
.java5 .kw53 {color: #003399; font-weight: bold;}
.java5 .kw54 {color: #003399; font-weight: bold;}
.java5 .kw55 {color: #003399; font-weight: bold;}
.java5 .kw56 {color: #003399; font-weight: bold;}
.java5 .kw57 {color: #003399; font-weight: bold;}
.java5 .kw58 {color: #003399; font-weight: bold;}
.java5 .kw59 {color: #003399; font-weight: bold;}
.java5 .kw60 {color: #003399; font-weight: bold;}
.java5 .kw61 {color: #003399; font-weight: bold;}
.java5 .kw62 {color: #003399; font-weight: bold;}
.java5 .kw63 {color: #003399; font-weight: bold;}
.java5 .kw64 {color: #003399; font-weight: bold;}
.java5 .kw65 {color: #003399; font-weight: bold;}
.java5 .kw66 {color: #003399; font-weight: bold;}
.java5 .kw67 {color: #003399; font-weight: bold;}
.java5 .kw68 {color: #003399; font-weight: bold;}
.java5 .kw69 {color: #003399; font-weight: bold;}
.java5 .kw70 {color: #003399; font-weight: bold;}
.java5 .kw71 {color: #003399; font-weight: bold;}
.java5 .kw72 {color: #003399; font-weight: bold;}
.java5 .kw73 {color: #003399; font-weight: bold;}
.java5 .kw74 {color: #003399; font-weight: bold;}
.java5 .kw75 {color: #003399; font-weight: bold;}
.java5 .kw76 {color: #003399; font-weight: bold;}
.java5 .kw77 {color: #003399; font-weight: bold;}
.java5 .kw78 {color: #003399; font-weight: bold;}
.java5 .kw79 {color: #003399; font-weight: bold;}
.java5 .kw80 {color: #003399; font-weight: bold;}
.java5 .kw81 {color: #003399; font-weight: bold;}
.java5 .kw82 {color: #003399; font-weight: bold;}
.java5 .kw83 {color: #003399; font-weight: bold;}
.java5 .kw84 {color: #003399; font-weight: bold;}
.java5 .kw85 {color: #003399; font-weight: bold;}
.java5 .kw86 {color: #003399; font-weight: bold;}
.java5 .kw87 {color: #003399; font-weight: bold;}
.java5 .kw88 {color: #003399; font-weight: bold;}
.java5 .kw89 {color: #003399; font-weight: bold;}
.java5 .kw90 {color: #003399; font-weight: bold;}
.java5 .kw91 {color: #003399; font-weight: bold;}
.java5 .kw92 {color: #003399; font-weight: bold;}
.java5 .kw93 {color: #003399; font-weight: bold;}
.java5 .kw94 {color: #003399; font-weight: bold;}
.java5 .kw95 {color: #003399; font-weight: bold;}
.java5 .kw96 {color: #003399; font-weight: bold;}
.java5 .kw97 {color: #003399; font-weight: bold;}
.java5 .kw98 {color: #003399; font-weight: bold;}
.java5 .kw99 {color: #003399; font-weight: bold;}
.java5 .kw100 {color: #003399; font-weight: bold;}
.java5 .kw101 {color: #003399; font-weight: bold;}
.java5 .kw102 {color: #003399; font-weight: bold;}
.java5 .kw103 {color: #003399; font-weight: bold;}
.java5 .kw104 {color: #003399; font-weight: bold;}
.java5 .kw105 {color: #003399; font-weight: bold;}
.java5 .kw106 {color: #003399; font-weight: bold;}
.java5 .kw107 {color: #003399; font-weight: bold;}
.java5 .kw108 {color: #003399; font-weight: bold;}
.java5 .kw109 {color: #003399; font-weight: bold;}
.java5 .kw110 {color: #003399; font-weight: bold;}
.java5 .kw111 {color: #003399; font-weight: bold;}
.java5 .kw112 {color: #003399; font-weight: bold;}
.java5 .kw113 {color: #003399; font-weight: bold;}
.java5 .kw114 {color: #003399; font-weight: bold;}
.java5 .kw115 {color: #003399; font-weight: bold;}
.java5 .kw116 {color: #003399; font-weight: bold;}
.java5 .kw117 {color: #003399; font-weight: bold;}
.java5 .kw118 {color: #003399; font-weight: bold;}
.java5 .kw119 {color: #003399; font-weight: bold;}
.java5 .kw120 {color: #003399; font-weight: bold;}
.java5 .kw121 {color: #003399; font-weight: bold;}
.java5 .kw122 {color: #003399; font-weight: bold;}
.java5 .kw123 {color: #003399; font-weight: bold;}
.java5 .kw124 {color: #003399; font-weight: bold;}
.java5 .kw125 {color: #003399; font-weight: bold;}
.java5 .kw126 {color: #003399; font-weight: bold;}
.java5 .kw127 {color: #003399; font-weight: bold;}
.java5 .kw128 {color: #003399; font-weight: bold;}
.java5 .kw129 {color: #003399; font-weight: bold;}
.java5 .kw130 {color: #003399; font-weight: bold;}
.java5 .kw131 {color: #003399; font-weight: bold;}
.java5 .kw132 {color: #003399; font-weight: bold;}
.java5 .kw133 {color: #003399; font-weight: bold;}
.java5 .kw134 {color: #003399; font-weight: bold;}
.java5 .kw135 {color: #003399; font-weight: bold;}
.java5 .kw136 {color: #003399; font-weight: bold;}
.java5 .kw137 {color: #003399; font-weight: bold;}
.java5 .kw138 {color: #003399; font-weight: bold;}
.java5 .kw139 {color: #003399; font-weight: bold;}
.java5 .kw140 {color: #003399; font-weight: bold;}
.java5 .kw141 {color: #003399; font-weight: bold;}
.java5 .kw142 {color: #003399; font-weight: bold;}
.java5 .kw143 {color: #003399; font-weight: bold;}
.java5 .kw144 {color: #003399; font-weight: bold;}
.java5 .kw145 {color: #003399; font-weight: bold;}
.java5 .kw146 {color: #003399; font-weight: bold;}
.java5 .kw147 {color: #003399; font-weight: bold;}
.java5 .kw148 {color: #003399; font-weight: bold;}
.java5 .kw149 {color: #003399; font-weight: bold;}
.java5 .kw150 {color: #003399; font-weight: bold;}
.java5 .kw151 {color: #003399; font-weight: bold;}
.java5 .kw152 {color: #003399; font-weight: bold;}
.java5 .kw153 {color: #003399; font-weight: bold;}
.java5 .kw154 {color: #003399; font-weight: bold;}
.java5 .kw155 {color: #003399; font-weight: bold;}
.java5 .kw156 {color: #003399; font-weight: bold;}
.java5 .kw157 {color: #003399; font-weight: bold;}
.java5 .kw158 {color: #003399; font-weight: bold;}
.java5 .kw159 {color: #003399; font-weight: bold;}
.java5 .kw160 {color: #003399; font-weight: bold;}
.java5 .kw161 {color: #003399; font-weight: bold;}
.java5 .kw162 {color: #003399; font-weight: bold;}
.java5 .kw163 {color: #003399; font-weight: bold;}
.java5 .kw164 {color: #003399; font-weight: bold;}
.java5 .kw165 {color: #003399; font-weight: bold;}
.java5 .kw166 {color: #003399; font-weight: bold;}
.java5 .co1 {color: #666666; font-style: italic;}
.java5 .co2 {color: #006699;}
.java5 .co3 {color: #008000; font-style: italic; font-weight: bold;}
.java5 .coMULTI {color: #666666; font-style: italic;}
.java5 .es0 {color: #000099; font-weight: bold;}
.java5 .br0 {color: #009900;}
.java5 .sy0 {color: #339933;}
.java5 .st0 {color: #0000ff;}
.java5 .nu0 {color: #cc66cc;}
.java5 .me1 {color: #006633;}
.java5 .me2 {color: #006633;}
.java5 span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;java5&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/*
 * @author Michael Hoffmann, Gerd Isenberg
 * @param  long occ occupancy of the board
 * @param  int sq  0..63
 * @param  int line  0..3 for rank, file, dia, antidia
 * @return line attacks from that square
 */&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;long&lt;/span&gt; lineAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;long&lt;/span&gt; occ, &lt;span class=&quot;kw3&quot;&gt;int&lt;/span&gt; sq, &lt;span class=&quot;kw3&quot;&gt;int&lt;/span&gt; line&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;long&lt;/span&gt; lower = longMasks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;line&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&lt;/span&gt; occ&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;long&lt;/span&gt; upper = longMasks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;line&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&lt;/span&gt; occ&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;long&lt;/span&gt; mMs1b = 0x8000000000000000 &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;a href=&quot;http://java.sun.com/j2se/1%2E5%2E0/docs/api/java/lang/Long.html&quot;&gt;&lt;span class=&quot;kw21&quot;&gt;Long&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;numberOfLeadingZeros&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lower | &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;long&lt;/span&gt; ls1b  = upper &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&lt;/span&gt; -upper&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;long&lt;/span&gt; odiff = &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;ls1b + mMs1b&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw2&quot;&gt;return&lt;/span&gt; longMasks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;line&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&lt;/span&gt; odiff&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;One may also use unsigned shift right, to subtract the MS1B.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;java5&amp;quot;&amp;gt;   long ms1b  = 0x8000000000000000 &amp;amp;gt;&amp;amp;gt;&amp;amp;gt; Long.numberOfLeadingZeros (lower | 1);&amp;lt;br/&amp;gt;   long ls1b  = upper &amp;amp;amp; -upper;&amp;lt;br/&amp;gt;   long odiff = 2*ls1b - ms1b;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.java5  {font-family:monospace;}
.java5 .imp {font-weight: bold; color: red;}
.java5 .kw1 {color: #000000;  font-weight: bold;}
.java5 .kw2 {color: #000000; font-weight: bold;}
.java5 .kw3 {color: #006600; font-weight: bold;}
.java5 .kw4 {color: #006600; font-weight: bold;}
.java5 .kw5 {color: #003399; font-weight: bold;}
.java5 .kw6 {color: #003399; font-weight: bold;}
.java5 .kw7 {color: #003399; font-weight: bold;}
.java5 .kw8 {color: #003399; font-weight: bold;}
.java5 .kw9 {color: #003399; font-weight: bold;}
.java5 .kw10 {color: #003399; font-weight: bold;}
.java5 .kw11 {color: #003399; font-weight: bold;}
.java5 .kw12 {color: #003399; font-weight: bold;}
.java5 .kw13 {color: #003399; font-weight: bold;}
.java5 .kw14 {color: #003399; font-weight: bold;}
.java5 .kw15 {color: #003399; font-weight: bold;}
.java5 .kw16 {color: #003399; font-weight: bold;}
.java5 .kw17 {color: #003399; font-weight: bold;}
.java5 .kw18 {color: #003399; font-weight: bold;}
.java5 .kw19 {color: #003399; font-weight: bold;}
.java5 .kw20 {color: #003399; font-weight: bold;}
.java5 .kw21 {color: #003399; font-weight: bold;}
.java5 .kw22 {color: #003399; font-weight: bold;}
.java5 .kw23 {color: #003399; font-weight: bold;}
.java5 .kw24 {color: #003399; font-weight: bold;}
.java5 .kw25 {color: #003399; font-weight: bold;}
.java5 .kw26 {color: #003399; font-weight: bold;}
.java5 .kw27 {color: #003399; font-weight: bold;}
.java5 .kw28 {color: #003399; font-weight: bold;}
.java5 .kw29 {color: #003399; font-weight: bold;}
.java5 .kw30 {color: #003399; font-weight: bold;}
.java5 .kw31 {color: #003399; font-weight: bold;}
.java5 .kw32 {color: #003399; font-weight: bold;}
.java5 .kw33 {color: #003399; font-weight: bold;}
.java5 .kw34 {color: #003399; font-weight: bold;}
.java5 .kw35 {color: #003399; font-weight: bold;}
.java5 .kw36 {color: #003399; font-weight: bold;}
.java5 .kw37 {color: #003399; font-weight: bold;}
.java5 .kw38 {color: #003399; font-weight: bold;}
.java5 .kw39 {color: #003399; font-weight: bold;}
.java5 .kw40 {color: #003399; font-weight: bold;}
.java5 .kw41 {color: #003399; font-weight: bold;}
.java5 .kw42 {color: #003399; font-weight: bold;}
.java5 .kw43 {color: #003399; font-weight: bold;}
.java5 .kw44 {color: #003399; font-weight: bold;}
.java5 .kw45 {color: #003399; font-weight: bold;}
.java5 .kw46 {color: #003399; font-weight: bold;}
.java5 .kw47 {color: #003399; font-weight: bold;}
.java5 .kw48 {color: #003399; font-weight: bold;}
.java5 .kw49 {color: #003399; font-weight: bold;}
.java5 .kw50 {color: #003399; font-weight: bold;}
.java5 .kw51 {color: #003399; font-weight: bold;}
.java5 .kw52 {color: #003399; font-weight: bold;}
.java5 .kw53 {color: #003399; font-weight: bold;}
.java5 .kw54 {color: #003399; font-weight: bold;}
.java5 .kw55 {color: #003399; font-weight: bold;}
.java5 .kw56 {color: #003399; font-weight: bold;}
.java5 .kw57 {color: #003399; font-weight: bold;}
.java5 .kw58 {color: #003399; font-weight: bold;}
.java5 .kw59 {color: #003399; font-weight: bold;}
.java5 .kw60 {color: #003399; font-weight: bold;}
.java5 .kw61 {color: #003399; font-weight: bold;}
.java5 .kw62 {color: #003399; font-weight: bold;}
.java5 .kw63 {color: #003399; font-weight: bold;}
.java5 .kw64 {color: #003399; font-weight: bold;}
.java5 .kw65 {color: #003399; font-weight: bold;}
.java5 .kw66 {color: #003399; font-weight: bold;}
.java5 .kw67 {color: #003399; font-weight: bold;}
.java5 .kw68 {color: #003399; font-weight: bold;}
.java5 .kw69 {color: #003399; font-weight: bold;}
.java5 .kw70 {color: #003399; font-weight: bold;}
.java5 .kw71 {color: #003399; font-weight: bold;}
.java5 .kw72 {color: #003399; font-weight: bold;}
.java5 .kw73 {color: #003399; font-weight: bold;}
.java5 .kw74 {color: #003399; font-weight: bold;}
.java5 .kw75 {color: #003399; font-weight: bold;}
.java5 .kw76 {color: #003399; font-weight: bold;}
.java5 .kw77 {color: #003399; font-weight: bold;}
.java5 .kw78 {color: #003399; font-weight: bold;}
.java5 .kw79 {color: #003399; font-weight: bold;}
.java5 .kw80 {color: #003399; font-weight: bold;}
.java5 .kw81 {color: #003399; font-weight: bold;}
.java5 .kw82 {color: #003399; font-weight: bold;}
.java5 .kw83 {color: #003399; font-weight: bold;}
.java5 .kw84 {color: #003399; font-weight: bold;}
.java5 .kw85 {color: #003399; font-weight: bold;}
.java5 .kw86 {color: #003399; font-weight: bold;}
.java5 .kw87 {color: #003399; font-weight: bold;}
.java5 .kw88 {color: #003399; font-weight: bold;}
.java5 .kw89 {color: #003399; font-weight: bold;}
.java5 .kw90 {color: #003399; font-weight: bold;}
.java5 .kw91 {color: #003399; font-weight: bold;}
.java5 .kw92 {color: #003399; font-weight: bold;}
.java5 .kw93 {color: #003399; font-weight: bold;}
.java5 .kw94 {color: #003399; font-weight: bold;}
.java5 .kw95 {color: #003399; font-weight: bold;}
.java5 .kw96 {color: #003399; font-weight: bold;}
.java5 .kw97 {color: #003399; font-weight: bold;}
.java5 .kw98 {color: #003399; font-weight: bold;}
.java5 .kw99 {color: #003399; font-weight: bold;}
.java5 .kw100 {color: #003399; font-weight: bold;}
.java5 .kw101 {color: #003399; font-weight: bold;}
.java5 .kw102 {color: #003399; font-weight: bold;}
.java5 .kw103 {color: #003399; font-weight: bold;}
.java5 .kw104 {color: #003399; font-weight: bold;}
.java5 .kw105 {color: #003399; font-weight: bold;}
.java5 .kw106 {color: #003399; font-weight: bold;}
.java5 .kw107 {color: #003399; font-weight: bold;}
.java5 .kw108 {color: #003399; font-weight: bold;}
.java5 .kw109 {color: #003399; font-weight: bold;}
.java5 .kw110 {color: #003399; font-weight: bold;}
.java5 .kw111 {color: #003399; font-weight: bold;}
.java5 .kw112 {color: #003399; font-weight: bold;}
.java5 .kw113 {color: #003399; font-weight: bold;}
.java5 .kw114 {color: #003399; font-weight: bold;}
.java5 .kw115 {color: #003399; font-weight: bold;}
.java5 .kw116 {color: #003399; font-weight: bold;}
.java5 .kw117 {color: #003399; font-weight: bold;}
.java5 .kw118 {color: #003399; font-weight: bold;}
.java5 .kw119 {color: #003399; font-weight: bold;}
.java5 .kw120 {color: #003399; font-weight: bold;}
.java5 .kw121 {color: #003399; font-weight: bold;}
.java5 .kw122 {color: #003399; font-weight: bold;}
.java5 .kw123 {color: #003399; font-weight: bold;}
.java5 .kw124 {color: #003399; font-weight: bold;}
.java5 .kw125 {color: #003399; font-weight: bold;}
.java5 .kw126 {color: #003399; font-weight: bold;}
.java5 .kw127 {color: #003399; font-weight: bold;}
.java5 .kw128 {color: #003399; font-weight: bold;}
.java5 .kw129 {color: #003399; font-weight: bold;}
.java5 .kw130 {color: #003399; font-weight: bold;}
.java5 .kw131 {color: #003399; font-weight: bold;}
.java5 .kw132 {color: #003399; font-weight: bold;}
.java5 .kw133 {color: #003399; font-weight: bold;}
.java5 .kw134 {color: #003399; font-weight: bold;}
.java5 .kw135 {color: #003399; font-weight: bold;}
.java5 .kw136 {color: #003399; font-weight: bold;}
.java5 .kw137 {color: #003399; font-weight: bold;}
.java5 .kw138 {color: #003399; font-weight: bold;}
.java5 .kw139 {color: #003399; font-weight: bold;}
.java5 .kw140 {color: #003399; font-weight: bold;}
.java5 .kw141 {color: #003399; font-weight: bold;}
.java5 .kw142 {color: #003399; font-weight: bold;}
.java5 .kw143 {color: #003399; font-weight: bold;}
.java5 .kw144 {color: #003399; font-weight: bold;}
.java5 .kw145 {color: #003399; font-weight: bold;}
.java5 .kw146 {color: #003399; font-weight: bold;}
.java5 .kw147 {color: #003399; font-weight: bold;}
.java5 .kw148 {color: #003399; font-weight: bold;}
.java5 .kw149 {color: #003399; font-weight: bold;}
.java5 .kw150 {color: #003399; font-weight: bold;}
.java5 .kw151 {color: #003399; font-weight: bold;}
.java5 .kw152 {color: #003399; font-weight: bold;}
.java5 .kw153 {color: #003399; font-weight: bold;}
.java5 .kw154 {color: #003399; font-weight: bold;}
.java5 .kw155 {color: #003399; font-weight: bold;}
.java5 .kw156 {color: #003399; font-weight: bold;}
.java5 .kw157 {color: #003399; font-weight: bold;}
.java5 .kw158 {color: #003399; font-weight: bold;}
.java5 .kw159 {color: #003399; font-weight: bold;}
.java5 .kw160 {color: #003399; font-weight: bold;}
.java5 .kw161 {color: #003399; font-weight: bold;}
.java5 .kw162 {color: #003399; font-weight: bold;}
.java5 .kw163 {color: #003399; font-weight: bold;}
.java5 .kw164 {color: #003399; font-weight: bold;}
.java5 .kw165 {color: #003399; font-weight: bold;}
.java5 .kw166 {color: #003399; font-weight: bold;}
.java5 .co1 {color: #666666; font-style: italic;}
.java5 .co2 {color: #006699;}
.java5 .co3 {color: #008000; font-style: italic; font-weight: bold;}
.java5 .coMULTI {color: #666666; font-style: italic;}
.java5 .es0 {color: #000099; font-weight: bold;}
.java5 .br0 {color: #009900;}
.java5 .sy0 {color: #339933;}
.java5 .st0 {color: #0000ff;}
.java5 .nu0 {color: #cc66cc;}
.java5 .me1 {color: #006633;}
.java5 .me2 {color: #006633;}
.java5 span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;java5&quot;&gt;   &lt;span class=&quot;kw3&quot;&gt;long&lt;/span&gt; ms1b  = 0x8000000000000000 &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;a href=&quot;http://java.sun.com/j2se/1%2E5%2E0/docs/api/java/lang/Long.html&quot;&gt;&lt;span class=&quot;kw21&quot;&gt;Long&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;numberOfLeadingZeros&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lower | &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;long&lt;/span&gt; ls1b  = upper &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&lt;/span&gt; -upper&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;long&lt;/span&gt; odiff = &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;ls1b - ms1b&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:21:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;How it works&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:21 --&gt;How it works&lt;/h1&gt;
 Following bitboard diagrams demonstrate how it works with &lt;a class=&quot;wiki_link&quot; href=&quot;/Square%20Mapping%20Considerations#LittleEndianRankFileMapping&quot;&gt;Little-Endian Rank-File Mapping&lt;/a&gt;, file attacks rook on d4 (27):&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;occupancy              fileMaskEx(d4)           occupancy d-file&amp;lt;br/&amp;gt; . . . 1 . 1 . .       . . . 1 . . . .          . . . 1 . . . .&amp;lt;br/&amp;gt; 1 . 1 . . 1 1 .       . . . 1 . . . .          . . . . . . . .&amp;lt;br/&amp;gt; . 1 . 1 . . . 1       . . . 1 . . . .          . . . 1 . . . .&amp;lt;br/&amp;gt; . . . . . 1 . .       . . . 1 . . . .          . . . . . . . .&amp;lt;br/&amp;gt; . 1 . 1 . . . .   &amp;amp;amp;   . . . . . . . .    =     . . . R . . . .&amp;lt;br/&amp;gt; . . . . . . 1 .       . . . 1 . . . .          . . . . . . . .&amp;lt;br/&amp;gt; 1 1 . 1 . 1 . 1       . . . 1 . . . .          . . . 1 . . . .&amp;lt;br/&amp;gt; . . . 1 1 . 1 .       . . . 1 . . . .          . . . 1 . . . .&amp;lt;br/&amp;gt;______________________________________&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;occupancy upper        occupancy lower&amp;lt;br/&amp;gt; . . . 1 . . . .       . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .       . . . . . . . .&amp;lt;br/&amp;gt; . . . 1 . . . .       . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .       . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .       . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .       . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .       . . . 1 . . . .&amp;lt;br/&amp;gt; . . . . . . . .       . . . 1 . . . .&amp;lt;br/&amp;gt;                   |&amp;lt;br/&amp;gt;LS1B upper         v   lower | 1&amp;lt;br/&amp;gt; . . . . . . . .       . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .       . . . . . . . .&amp;lt;br/&amp;gt; . . . 1 . . . .       . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .       . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .       . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .       . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .       . . . 1 . . . .&amp;lt;br/&amp;gt; . . . . . . . .       1 . . 1 . . . .&amp;lt;br/&amp;gt;______________________________________&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;2* LS1B upper      -   MS1B (lower | 1)   =    2*LS1Bhigh-MS1Blow&amp;lt;br/&amp;gt; . . . . . . . .       . . . . . . . .         . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .       . . . . . . . .         . . . . . . . .&amp;lt;br/&amp;gt; . . . . 1 . . .       . . . . . . . .         1 1 1 1 . . . .&amp;lt;br/&amp;gt; . . . . . . . .       . . . . . . . .         1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt; . . . . . . . .   -   . . . . . . . .    =    1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt; . . . . . . . .       . . . . . . . .         1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt; . . . . . . . .       . . . 1 . . . .         . . . 1 1 1 1 1&amp;lt;br/&amp;gt; . . . . . . . .       . . . . . . . .         . . . . . . . .&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;2*LS1Bhigh-MS1Blow     fileMaskEx         =    fileAttacks&amp;lt;br/&amp;gt; . . . . . . . .       . . . 1 . . . .         . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .       . . . 1 . . . .         . . . . . . . .&amp;lt;br/&amp;gt; 1 1 1 1 . . . .       . . . 1 . . . .         . . . 1 . . . .&amp;lt;br/&amp;gt; 1 1 1 1 1 1 1 1       . . . 1 . . . .         . . . 1 . . . .&amp;lt;br/&amp;gt; 1 1 1 1 1 1 1 1   &amp;amp;amp;   . . . . . . . .    =    . . . . . . . .&amp;lt;br/&amp;gt; 1 1 1 1 1 1 1 1       . . . 1 . . . .         . . . 1 . . . .&amp;lt;br/&amp;gt; . . . 1 1 1 1 1       . . . 1 . . . .         . . . 1 . . . .&amp;lt;br/&amp;gt; . . . . . . . .       . . . 1 . . . .         . . . . . . . .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;occupancy              fileMaskEx&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;d4&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;           occupancy d&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;file
 . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .       . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .          . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .
 &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .       . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .          . . . . . . . .
 . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;       . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .          . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .
 . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .       . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .          . . . . . . . .
 . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .   &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;   . . . . . . . .    &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;     . . . &lt;span class=&quot;me1&quot;&gt;R&lt;/span&gt; . . . .
 . . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .       . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .          . . . . . . . .
 &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;       . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .          . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .
 . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .       . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .          . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .
______________________________________
&amp;nbsp;
occupancy upper        occupancy lower
 . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .       . . . . . . . .
 . . . . . . . .       . . . . . . . .
 . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .       . . . . . . . .
 . . . . . . . .       . . . . . . . .
 . . . . . . . .       . . . . . . . .
 . . . . . . . .       . . . . . . . .
 . . . . . . . .       . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .
 . . . . . . . .       . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .
                   &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;
LS1B upper         v   lower &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 . . . . . . . .       . . . . . . . .
 . . . . . . . .       . . . . . . . .
 . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .       . . . . . . . .
 . . . . . . . .       . . . . . . . .
 . . . . . . . .       . . . . . . . .
 . . . . . . . .       . . . . . . . .
 . . . . . . . .       . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .
 . . . . . . . .       &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .
______________________________________
&amp;nbsp;
&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; LS1B upper      &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;   MS1B &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lower &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;   &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;    &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;LS1Bhigh&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;MS1Blow
 . . . . . . . .       . . . . . . . .         . . . . . . . .
 . . . . . . . .       . . . . . . . .         . . . . . . . .
 . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .       . . . . . . . .         &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .
 . . . . . . . .       . . . . . . . .         &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 . . . . . . . .   &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;   . . . . . . . .    &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;    &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 . . . . . . . .       . . . . . . . .         &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 . . . . . . . .       . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .         . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 . . . . . . . .       . . . . . . . .         . . . . . . . .
&amp;nbsp;
&amp;nbsp;
&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;LS1Bhigh&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;MS1Blow     fileMaskEx         &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;    fileAttacks
 . . . . . . . .       . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .         . . . . . . . .
 . . . . . . . .       . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .         . . . . . . . .
 &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .       . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .         . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .
 &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;       . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .         . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .
 &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;   &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;   . . . . . . . .    &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;    . . . . . . . .
 &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;       . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .         . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .
 . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;       . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .         . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .
 . . . . . . . .       . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .         . . . . . . . .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:23:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc5&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:23 --&gt;See also&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SBAMG&quot;&gt;SBAMG&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:25:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc6&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:25 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:134:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=29087&quot; rel=&quot;nofollow&quot;&gt;DIRECT BITBOARD MOVEGENERATION&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Michael%20Hoffmann&quot;&gt;Michael Hoffmann&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, July 23, 2009&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.imj.org.il/imagine/collections/viewDataE5.asp?case=Modern%20Art&quot; rel=&quot;nofollow&quot;&gt;IMAGINE - The Israel Museum&#039;s searchable collections database&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:134 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:27:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc7&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:27 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:06:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Obstruction Difference&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;20&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Obstruction Difference&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;20&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Obstruction_Difference includeBody-Obstruction%20Difference includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Classical+Approach&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Classical Approach&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 28, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hiding+the+Implementation&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hiding the Implementation&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 3, 2011&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hyperbola+Quintessence&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hyperbola Quintessence&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Michael+Hoffmann&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Michael Hoffmann&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 9, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Nemo&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Nemo&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 24, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Obstruction+Difference&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Obstruction Difference&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Occupancy&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Occupancy&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 19, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SBAMG&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SBAMG&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 4, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Subtracting+a+Rook+from+a+Blocking+Piece&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Subtracting a Rook from a Blocking Piece&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 2, 2016&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:06 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>On an empty Board</title>
      <link>https://chessprogramming.wikispaces.com/On+an+empty+Board</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/On+an+empty+Board</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/On+an+empty+Board</comments>
      <pubDate>Tue, 18 Mar 2014 21:05:25 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:54:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:54 --&gt;&lt;!-- ws:start:WikiTextTocRule:55: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Ray Attacks&quot;&gt;Ray Attacks&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:55 --&gt;&lt;!-- ws:start:WikiTextTocRule:56: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Ray Attacks-Rays by Line&quot;&gt;Rays by Line&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:56 --&gt;&lt;!-- ws:start:WikiTextTocRule:57: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Ray Attacks-Positive Rays&quot;&gt;Positive Rays&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:57 --&gt;&lt;!-- ws:start:WikiTextTocRule:58: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Ray Attacks-Positive Rays-By Lookup&quot;&gt;By Lookup&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:58 --&gt;&lt;!-- ws:start:WikiTextTocRule:59: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Ray Attacks-Positive Rays-Initialization&quot;&gt;Initialization&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:59 --&gt;&lt;!-- ws:start:WikiTextTocRule:60: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Ray Attacks-Positive Rays-By Calculation&quot;&gt;By Calculation&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:60 --&gt;&lt;!-- ws:start:WikiTextTocRule:61: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Ray Attacks-Negative Rays&quot;&gt;Negative Rays&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:61 --&gt;&lt;!-- ws:start:WikiTextTocRule:62: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Ray Attacks-Negative Rays-By Lookup&quot;&gt;By Lookup&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:62 --&gt;&lt;!-- ws:start:WikiTextTocRule:63: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Ray Attacks-Negative Rays-Initialization&quot;&gt;Initialization&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:63 --&gt;&lt;!-- ws:start:WikiTextTocRule:64: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Ray Attacks-Negative Rays-By Calculation&quot;&gt;By Calculation&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:64 --&gt;&lt;!-- ws:start:WikiTextTocRule:65: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Line Attacks&quot;&gt;Line Attacks&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:65 --&gt;&lt;!-- ws:start:WikiTextTocRule:66: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Line Attacks--By Lookup&quot;&gt;By Lookup&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:66 --&gt;&lt;!-- ws:start:WikiTextTocRule:67: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Line Attacks--By Calculation&quot;&gt;By Calculation&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:67 --&gt;&lt;!-- ws:start:WikiTextTocRule:68: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Piece Attacks&quot;&gt;Piece Attacks&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:68 --&gt;&lt;!-- ws:start:WikiTextTocRule:69: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Piece Attacks--By Lookup&quot;&gt;By Lookup&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:69 --&gt;&lt;!-- ws:start:WikiTextTocRule:70: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Piece Attacks--By Calculation&quot;&gt;By Calculation&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:70 --&gt;&lt;!-- ws:start:WikiTextTocRule:71: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:71 --&gt;&lt;!-- ws:start:WikiTextTocRule:72: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:72 --&gt;&lt;!-- ws:start:WikiTextTocRule:73: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:73 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Board%20Representation&quot;&gt;Board Representation&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Bitboards&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Sliding Piece Attacks&lt;/a&gt; * On an empty Board&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Single sliding piece attacks&lt;/strong&gt; on the &lt;strong&gt;otherwise empty board&lt;/strong&gt; or their disjoint subsets on lines or &lt;a class=&quot;wiki_link&quot; href=&quot;/Rays&quot;&gt;rays&lt;/a&gt; are that simple than none sliding pieces. We simply use pre-calculated tables for each &lt;a class=&quot;wiki_link&quot; href=&quot;/Pieces&quot;&gt;piece-type&lt;/a&gt;, line or ray, indexed by square-index. To initialize those tables, one may use a &lt;a class=&quot;wiki_link&quot; href=&quot;/Kogge-Stone%20Algorithm#Fillonanemptyboard&quot;&gt;fill approach&lt;/a&gt; with single populated from-sets, if availably anyway since used elsewhere. While the proposed line-routines here are quite small and cheap, incremental update during an initialization loop has some merits.&lt;br /&gt;
&lt;br /&gt;
The various ray-,line- and piece sets are foundation of further attack calculation considering blocking pieces, for instance to mask the &lt;a class=&quot;wiki_link&quot; href=&quot;/Occupancy&quot;&gt;occupancy&lt;/a&gt; of relevant rays. Of course the piece attacks are union-sets of the disjoint line attacks, while the line attacks are unions of the disjoint ray attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:74:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@RayAttacks&amp;quot; title=&amp;quot;Anchor: RayAttacks&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;RayAttacks&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:74 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:18:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Ray Attacks&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:18 --&gt;Ray Attacks&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;  northwest    north   northeast&amp;lt;br/&amp;gt;  noWe         nort         noEa&amp;lt;br/&amp;gt;          +7    +8    +9&amp;lt;br/&amp;gt;              \  |  /&amp;lt;br/&amp;gt;  west    -1 &amp;amp;lt;-  0 -&amp;amp;gt; +1    east&amp;lt;br/&amp;gt;              /  |  \&amp;lt;br/&amp;gt;          -9    -8    -7&amp;lt;br/&amp;gt;  soWe         sout         soEa&amp;lt;br/&amp;gt;  southwest    south   southeast&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;  northwest    north   northeast
  noWe         nort         noEa
          +7    +8    +9
              \  |  /
  west    -1 &amp;lt;-  0 -&amp;gt; +1    east
              /  |  \
          -9    -8    -7
  soWe         sout         soEa
  southwest    south   southeast&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:75:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@SplitRaysFromLine&amp;quot; title=&amp;quot;Anchor: SplitRaysFromLine&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;SplitRaysFromLine&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:75 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:20:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Ray Attacks-Rays by Line&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:20 --&gt;Rays by Line&lt;/h2&gt;
 Ray-Attacks may be conducted from Line-Attacks by intersection with &amp;quot;positive&amp;quot; and &amp;quot;negative&amp;quot; squares:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt; positiveRay[sq] = lineAttacks[sq] &amp;amp;amp; (0 - 2*singleBit[sq]);&amp;lt;br/&amp;gt; negativeRay[sq] = lineAttacks[sq] &amp;amp;amp; (singleBit[sq] - 1);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt; positiveRay&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; lineAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;singleBit&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
 negativeRay&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; lineAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;singleBit&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;or with shifts instead of lookups&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt; positiveRay[sq] = lineAttacks[sq] &amp;amp;amp; (C64(-2) &amp;amp;lt;&amp;amp;lt; sq);&amp;lt;br/&amp;gt; negativeRay[sq] = lineAttacks[sq] &amp;amp;amp; ((C64(1) &amp;amp;lt;&amp;amp;lt; sq) - 1);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt; positiveRay&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; lineAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
 negativeRay&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; lineAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:76:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@PositiveRays&amp;quot; title=&amp;quot;Anchor: PositiveRays&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;PositiveRays&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:76 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:22:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Ray Attacks-Positive Rays&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:22 --&gt;Positive Rays&lt;/h2&gt;
 &lt;em&gt;Remember &lt;a class=&quot;wiki_link&quot; href=&quot;/Square%20Mapping%20Considerations&quot;&gt;Square Mapping Considerations&lt;/a&gt;.&lt;/em&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:24:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Ray Attacks-Positive Rays-By Lookup&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:24 --&gt;By Lookup&lt;/h3&gt;
 &lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;East (+1)           Nort (+8)            NoEa (+9)           NoWe (+7)&amp;lt;br/&amp;gt;. . . . . . . .     . . . 1 . . . .      . . . . . . . 1     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . 1 . . . .      . . . . . . 1 .     1 . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . 1 . . . .      . . . . . 1 . .     . 1 . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . 1 . . . .      . . . . 1 . . .     . . 1 . . . . .&amp;lt;br/&amp;gt;. . . R 1 1 1 1     . . . R . . . .      . . . B . . . .     . . . B . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .      . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .      . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .      . . . . . . . .     . . . . . . . .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;East &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;           Nort &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;            NoEa &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;           NoWe &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
. . . . . . . .     . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .      . . . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . . . . . . .
. . . . . . . .     . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .      . . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . . .
. . . . . . . .     . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .      . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . .
. . . . . . . .     . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .      . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . .
. . . &lt;span class=&quot;me1&quot;&gt;R&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . . &lt;span class=&quot;me1&quot;&gt;R&lt;/span&gt; . . . .      . . . &lt;span class=&quot;me1&quot;&gt;B&lt;/span&gt; . . . .     . . . &lt;span class=&quot;me1&quot;&gt;B&lt;/span&gt; . . . .
. . . . . . . .     . . . . . . . .      . . . . . . . .     . . . . . . . .
. . . . . . . .     . . . . . . . .      . . . . . . . .     . . . . . . . .
. . . . . . . .     . . . . . . . .      . . . . . . . .     . . . . . . . .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:26:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Ray Attacks-Positive Rays-Initialization&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:26 --&gt;Initialization&lt;/h3&gt;
 North attacks are simple to initialize inside a loop, starting from a1, shifting left:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 nort = C64(0x0101010101010100);&amp;lt;br/&amp;gt;for (int sq=0; sq &amp;amp;lt; 64; sq++, nort &amp;amp;lt;&amp;amp;lt;= 1)&amp;lt;br/&amp;gt;   rayAttacks[sq][Nort] = nort;&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 nort &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0101010101010100&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;, nort &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
   rayAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;Nort&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; nort&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;Similar, but tad trickier for &lt;a class=&quot;wiki_link&quot; href=&quot;/ranks&quot;&gt;ranks&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/diagonals&quot;&gt;diagonals&lt;/a&gt;, due to the wraps. For instance the north-east &lt;a class=&quot;wiki_link&quot; href=&quot;/Direction&quot;&gt;direction&lt;/a&gt;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 noea = C64(0x8040201008040200);&amp;lt;br/&amp;gt;for (int f=0; f &amp;amp;lt; 8; f++, noea = eastOne(noea) {&amp;lt;br/&amp;gt;   U64 ne = noea;&amp;lt;br/&amp;gt;   for (int r8 = 0; r8 &amp;amp;lt; 8*8; r8 += 8, ne &amp;amp;lt;&amp;amp;lt;= 8)&amp;lt;br/&amp;gt;      rayAttacks[r8+f][NoEa] = ne;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 noea &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x8040201008040200&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; f&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; f &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; f&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;, noea &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; eastOne&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;noea&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64 ne &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; noea&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; r8 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; r8 &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; r8 &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;, ne &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      rayAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;r8&lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;f&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;NoEa&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; ne&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:28:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Ray Attacks-Positive Rays-By Calculation&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:28 --&gt;By Calculation&lt;/h3&gt;
 Orthogonal positive rays are quite cheap to calculate on the fly. For diagonal rays split the lines as &lt;a class=&quot;wiki_link&quot; href=&quot;/On%20an%20empty%20Board#SplitRaysFromLine&quot;&gt;mentioned&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 eastMaskEx(int sq) {&amp;lt;br/&amp;gt;   const U64 one = 1;&amp;lt;br/&amp;gt;   return 2*( (one &amp;amp;lt;&amp;amp;lt; (sq|7)) - (one &amp;amp;lt;&amp;amp;lt; sq) );&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 nortMaskEx(int sq) {&amp;lt;br/&amp;gt;   return C64(0x0101010101010100) &amp;amp;lt;&amp;amp;lt; sq;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 eastMaskEx&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 one &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;one &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;one &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
U64 nortMaskEx&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0101010101010100&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; sq&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:77:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@NegativeRays&amp;quot; title=&amp;quot;Anchor: NegativeRays&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;NegativeRays&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:77 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:30:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc6&quot;&gt;&lt;a name=&quot;Ray Attacks-Negative Rays&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:30 --&gt;Negative Rays&lt;/h2&gt;
 Remember &lt;a class=&quot;wiki_link&quot; href=&quot;/Square%20Mapping%20Considerations&quot;&gt;Square Mapping Considerations&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:32:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc7&quot;&gt;&lt;a name=&quot;Ray Attacks-Negative Rays-By Lookup&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:32 --&gt;By Lookup&lt;/h3&gt;
 &lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;West (-1)           Sout (-8)            SoWe (-9)           SoEa (-7)&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .      . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .      . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .      . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .      . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;1 1 1 R . . . .     . . . R . . . .      . . . B . . . .     . . . B . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . 1 . . . .      . . 1 . . . . .     . . . . 1 . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . 1 . . . .      . 1 . . . . . .     . . . . . 1 . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . 1 . . . .      1 . . . . . . .     . . . . . . 1 .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;West &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;           Sout &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;            SoWe &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;           SoEa &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
. . . . . . . .     . . . . . . . .      . . . . . . . .     . . . . . . . .
. . . . . . . .     . . . . . . . .      . . . . . . . .     . . . . . . . .
. . . . . . . .     . . . . . . . .      . . . . . . . .     . . . . . . . .
. . . . . . . .     . . . . . . . .      . . . . . . . .     . . . . . . . .
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; R . . . .     . . . &lt;span class=&quot;me1&quot;&gt;R&lt;/span&gt; . . . .      . . . &lt;span class=&quot;me1&quot;&gt;B&lt;/span&gt; . . . .     . . . &lt;span class=&quot;me1&quot;&gt;B&lt;/span&gt; . . . .
. . . . . . . .     . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .      . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . .     . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .
. . . . . . . .     . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .      . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . .     . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .
. . . . . . . .     . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .      &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . . .     . . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:34:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc8&quot;&gt;&lt;a name=&quot;Ray Attacks-Negative Rays-Initialization&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:34 --&gt;Initialization&lt;/h3&gt;
 South attacks are simple to initialize inside a loop, starting from h8, shifting right:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 sout = C64(0x0080808080808080);&amp;lt;br/&amp;gt;for (int sq=63; sq &amp;amp;gt;= 0; sq&amp;amp;#45;-, sout &amp;amp;gt;&amp;amp;gt;= 1)&amp;lt;br/&amp;gt;   rayAttacks[sq][Sout] = sout;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 sout &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0080808080808080&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;63&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq&lt;span class=&quot;sy2&quot;&gt;--&lt;/span&gt;, sout &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
   rayAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;Sout&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sout&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;Similar, but tad trickier for &lt;a class=&quot;wiki_link&quot; href=&quot;/ranks&quot;&gt;ranks&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/diagonals&quot;&gt;diagonals&lt;/a&gt;, due to the wraps.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:36:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc9&quot;&gt;&lt;a name=&quot;Ray Attacks-Negative Rays-By Calculation&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:36 --&gt;By Calculation&lt;/h3&gt;
 Orthogonal negative rays are quite cheap to calculate on the fly. For diagonal rays split the lines as &lt;a class=&quot;wiki_link&quot; href=&quot;/On%20an%20empty%20Board#SplitRaysFromLine&quot;&gt;mentioned&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:9:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 westMaskEx(int sq) {&amp;lt;br/&amp;gt;   const U64 one = 1;&amp;lt;br/&amp;gt;   return (one &amp;amp;lt;&amp;amp;lt; sq) - (one &amp;amp;lt;&amp;amp;lt; (sq&amp;amp;amp;56));&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 soutMaskEx(int sq) {&amp;lt;br/&amp;gt;   return C64(0x0080808080808080) &amp;amp;gt;&amp;amp;gt; (sq ^ 63);&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 westMaskEx&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 one &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;one &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;one &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;56&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
U64 soutMaskEx&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0080808080808080&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;63&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:9 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:78:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@LineAttacks&amp;quot; title=&amp;quot;Anchor: LineAttacks&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;LineAttacks&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:78 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:38:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc10&quot;&gt;&lt;a name=&quot;Line Attacks&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:38 --&gt;Line Attacks&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextCodeRule:10:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt; RankAttacks[sq]         = EastAttacks[sq] | WestAttacks[sq];&amp;lt;br/&amp;gt; FileAttacks[sq]         = NortAttacks[sq] | SoutAttacks[sq];&amp;lt;br/&amp;gt; DiagonalAttacks[sq]     = NoEaAttacks[sq] | SoWeAttacks[sq];&amp;lt;br/&amp;gt; AntiDiagonalAttacks[sq] = NoWeAttacks[sq] | SoEaAttacks[sq];&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt; RankAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;         &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; EastAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; WestAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
 FileAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;         &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; NortAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; SoutAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
 DiagonalAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;     &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; NoEaAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; SoWeAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
 AntiDiagonalAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; NoWeAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; SoEaAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:10 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:40:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc11&quot;&gt;&lt;a name=&quot;Line Attacks--By Lookup&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:40 --&gt;By Lookup&lt;/h3&gt;
 &lt;!-- ws:start:WikiTextCodeRule:11:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;Rank                File                 Diagonal            Anti-Diagonal&amp;lt;br/&amp;gt;. . . . . . . .     . . . 1 . . . .      . . . . . . . 1     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . 1 . . . .      . . . . . . 1 .     1 . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . 1 . . . .      . . . . . 1 . .     . 1 . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . 1 . . . .      . . . . 1 . . .     . . 1 . . . . .&amp;lt;br/&amp;gt;1 1 1 R 1 1 1 1     . . . R . . . .      . . . B . . . .     . . . B . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . 1 . . . .      . . 1 . . . . .     . . . . 1 . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . 1 . . . .      . 1 . . . . . .     . . . . . 1 . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . 1 . . . .      1 . . . . . . .     . . . . . . 1 .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;Rank                File                 Diagonal            Anti&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;Diagonal
. . . . . . . .     . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .      . . . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . . . . . . .
. . . . . . . .     . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .      . . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . . .
. . . . . . . .     . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .      . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . .
. . . . . . . .     . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .      . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . .
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; R &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . . &lt;span class=&quot;me1&quot;&gt;R&lt;/span&gt; . . . .      . . . &lt;span class=&quot;me1&quot;&gt;B&lt;/span&gt; . . . .     . . . &lt;span class=&quot;me1&quot;&gt;B&lt;/span&gt; . . . .
. . . . . . . .     . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .      . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . .     . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .
. . . . . . . .     . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .      . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . .     . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .
. . . . . . . .     . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .      &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . . .     . . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:11 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:42:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc12&quot;&gt;&lt;a name=&quot;Line Attacks--By Calculation&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:42 --&gt;By Calculation&lt;/h3&gt;
 To calculate them on the fly, including...&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:12:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 rankMask(int sq) {return  C64(0xff) &amp;amp;lt;&amp;amp;lt; (sq &amp;amp;amp; 56);}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 fileMask(int sq) {return C64(0x0101010101010101) &amp;amp;lt;&amp;amp;lt; (sq &amp;amp;amp; 7);}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 diagonalMask(int sq) {&amp;lt;br/&amp;gt;   const U64 maindia = C64(0x8040201008040201);&amp;lt;br/&amp;gt;   int diag =8*(sq &amp;amp;amp; 7) - (sq &amp;amp;amp; 56);&amp;lt;br/&amp;gt;   int nort = -diag &amp;amp;amp; ( diag &amp;amp;gt;&amp;amp;gt; 31);&amp;lt;br/&amp;gt;   int sout =  diag &amp;amp;amp; (-diag &amp;amp;gt;&amp;amp;gt; 31);&amp;lt;br/&amp;gt;   return (maindia &amp;amp;gt;&amp;amp;gt; sout) &amp;amp;lt;&amp;amp;lt; nort;&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 antiDiagMask(int sq) {&amp;lt;br/&amp;gt;   const U64 maindia = C64(0x0102040810204080);&amp;lt;br/&amp;gt;   int diag =56- 8*(sq&amp;amp;amp;7) - (sq&amp;amp;amp;56);&amp;lt;br/&amp;gt;   int nort = -diag &amp;amp;amp; ( diag &amp;amp;gt;&amp;amp;gt; 31);&amp;lt;br/&amp;gt;   int sout =  diag &amp;amp;amp; (-diag &amp;amp;gt;&amp;amp;gt; 31);&amp;lt;br/&amp;gt;   return (maindia &amp;amp;gt;&amp;amp;gt; sout) &amp;amp;lt;&amp;amp;lt; nort;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 rankMask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt;  C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0xff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;56&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
U64 fileMask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0101010101010101&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
U64 diagonalMask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 maindia &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x8040201008040201&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; diag &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;56&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; nort &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;diag &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; diag &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;31&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sout &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  diag &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;diag &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;31&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;maindia &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; sout&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; nort&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
U64 antiDiagMask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 maindia &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0102040810204080&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; diag &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;56&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;56&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; nort &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;diag &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; diag &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;31&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sout &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  diag &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;diag &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;31&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;maindia &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; sout&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; nort&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:12 --&gt;... or excluding the square bit:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:13:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 rankMaskEx    (int sq) {return (C64(1) &amp;amp;lt;&amp;amp;lt; sq) ^ rankMask(sq);}&amp;lt;br/&amp;gt;U64 fileMaskEx    (int sq) {return (C64(1) &amp;amp;lt;&amp;amp;lt; sq) ^ fileMask(sq);}&amp;lt;br/&amp;gt;U64 diagonalMaskEx(int sq) {return (C64(1) &amp;amp;lt;&amp;amp;lt; sq) ^ diagonalMask(sq);}&amp;lt;br/&amp;gt;U64 antiDiagMaskEx(int sq) {return (C64(1) &amp;amp;lt;&amp;amp;lt; sq) ^ antiDiagMask(sq);}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 rankMaskEx    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; rankMask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 fileMaskEx    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; fileMask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 diagonalMaskEx&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; diagonalMask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 antiDiagMaskEx&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; antiDiagMask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:13 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:79:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@PieceAttacks&amp;quot; title=&amp;quot;Anchor: PieceAttacks&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;PieceAttacks&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:79 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:44:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc13&quot;&gt;&lt;a name=&quot;Piece Attacks&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:44 --&gt;Piece Attacks&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextCodeRule:14:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;RookAttacks[sq]   = RankAttacks[sq]     | FileAttacks[sq];&amp;lt;br/&amp;gt;BishopAttacks[sq] = DiagonalAttacks[sq] | AntiDiagonalAttacks[sq];&amp;lt;br/&amp;gt;QueenAttacks[sq]  = RookAttacks[sq] | BishopAttacks[sq];&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;RookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;   &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; RankAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;     &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; FileAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
BishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; DiagonalAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; AntiDiagonalAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
QueenAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; RookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; BishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:14 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:46:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc14&quot;&gt;&lt;a name=&quot;Piece Attacks--By Lookup&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:46 --&gt;By Lookup&lt;/h3&gt;
 &lt;!-- ws:start:WikiTextCodeRule:15:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;                                   Queen&amp;lt;br/&amp;gt;                               . . . 1 . . . 1&amp;lt;br/&amp;gt;                               1 . . 1 . . 1 .&amp;lt;br/&amp;gt;                               . 1 . 1 . 1 . .&amp;lt;br/&amp;gt;               Rook            . . 1 1 1 . . .         Bishop&amp;lt;br/&amp;gt;           . . . 1 . . . .     1 1 1 Q 1 1 1 1     . . . . . . . 1&amp;lt;br/&amp;gt;           . . . 1 . . . .     . . 1 1 1 . . .     1 . . . . . 1 .&amp;lt;br/&amp;gt;           . . . 1 . . . .     . 1 . 1 . 1 . .     . 1 . . . 1 . .&amp;lt;br/&amp;gt;           . . . 1 . . . .     1 . . 1 . . 1 .     . . 1 . 1 . . .&amp;lt;br/&amp;gt;           1 1 1 R 1 1 1 1                         . . . B . . . .&amp;lt;br/&amp;gt;           . . . 1 . . . .                         . . 1 . 1 . . .&amp;lt;br/&amp;gt;           . . . 1 . . . .                         . 1 . . . 1 . .&amp;lt;br/&amp;gt;           . . . 1 . . . .                         1 . . . . . 1 .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;                                   Queen
                               . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
                               &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .
                               . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .
               &lt;span class=&quot;me1&quot;&gt;Rook&lt;/span&gt;            . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .         &lt;span class=&quot;me1&quot;&gt;Bishop&lt;/span&gt;
           . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; Q &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
           . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .
           . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .
           . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .
           &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; R &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;                         . . . &lt;span class=&quot;me1&quot;&gt;B&lt;/span&gt; . . . .
           . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .                         . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .
           . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .                         . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .
           . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .                         &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:15 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:48:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc15&quot;&gt;&lt;a name=&quot;Piece Attacks--By Calculation&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:48 --&gt;By Calculation&lt;/h3&gt;
 &lt;!-- ws:start:WikiTextCodeRule:16:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 rookMask    (int sq) {return rankMask(sq)     | fileMask(sq);}&amp;lt;br/&amp;gt;U64 bishopMask  (int sq) {return diagonalMask(sq) | antiDiagMask(sq);}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 rookMaskEx  (int sq) {return rankMask(sq)     ^ fileMask(sq);}&amp;lt;br/&amp;gt;U64 bishopMaskEx(int sq) {return diagonalMask(sq) ^ antiDiagMask(sq);}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 queenMask   (int sq) {return rookMask(sq)     | bishopMask(sq);}&amp;lt;br/&amp;gt;U64 queenMaskEx (int sq) {return rookMask(sq)     ^ bishopMask(sq);}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 rookMask    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; rankMask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;     &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; fileMask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 bishopMask  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; diagonalMask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; antiDiagMask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
U64 rookMaskEx  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; rankMask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;     &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; fileMask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 bishopMaskEx&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; diagonalMask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; antiDiagMask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
U64 queenMask   &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; rookMask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;     &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; bishopMask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 queenMaskEx &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; rookMask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;     &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; bishopMask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:16 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:50:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc16&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:50 --&gt;See also&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Blockers%20and%20Beyond&quot;&gt;Blockers and Beyond&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Kogge-Stone%20Algorithm#Fillonanemptyboard&quot;&gt;Fill on an empty Board&lt;/a&gt; with &lt;a class=&quot;wiki_link&quot; href=&quot;/Kogge-Stone%20Algorithm&quot;&gt;Kogge-Stone Algorithm&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:52:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc17&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:52 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:017:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;On an empty Board&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;80&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;On an empty Board&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;80&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-On_an_empty_Board includeBody-On%20an%20empty%20Board includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Aleks+Peshkov&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Aleks Peshkov&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 13, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Backtracking&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Backtracking&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitfoot&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitfoot&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 8, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Blockers+and+Beyond&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Blockers and Beyond&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 21, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Classical+Approach&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Classical Approach&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 28, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Direction&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Direction&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 6, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Efficient+Generation+of+Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Efficient Generation of Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gerd+Isenberg&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gerd Isenberg&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 4, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hyperbola+Quintessence&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hyperbola Quintessence&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Joker+IT&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Joker IT&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kindergarten+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kindergarten Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 1, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kogge-Stone+Algorithm&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kogge-Stone Algorithm&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 17, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Magic+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Magic Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 13, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Obstruction+Difference&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Obstruction Difference&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/On+an+empty+Board&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;On an empty Board&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 18, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pieces+versus+Directions&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pieces versus Directions&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 6, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Praetorian&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Praetorian&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 21, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rays&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rays&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 20, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Reverse+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Reverse Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Ryan+Mack&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Ryan Mack&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 18, 2011&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SBAMG&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SBAMG&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 4, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Shifted+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Shifted Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 9, 2011&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Squares&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Squares&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 15, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Subtracting+a+Rook+from+a+Blocking+Piece&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Subtracting a Rook from a Blocking Piece&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 2, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Thor%27s+Hammer&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Thor&amp;#039;s Hammer&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 23, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Tinker&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Tinker&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:017 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Outposts</title>
      <link>https://chessprogramming.wikispaces.com/Outposts</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Outposts</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Outposts</comments>
      <pubDate>Mon, 24 Apr 2017 09:19:34 GMT</pubDate>
      <description>&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Evaluation&quot;&gt;Evaluation&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Evaluation%20Patterns&quot;&gt;Patterns&lt;/a&gt; * Outposts&lt;/strong&gt;&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextRemoteImageRule:66:&amp;lt;img src=&amp;quot;http://webchess.freehostia.com/diag/chessdiag.php?fen=r4rk1/ppp2ppp/3p2n1/8/4P3/2N5/PPP2PPP/2KRR3%20w%20-%20-&amp;amp;size=large&amp;amp;coord=yes&amp;amp;cap=no&amp;amp;stm=yes&amp;amp;fb=no&amp;amp;theme=classic&amp;amp;color1=E3CEAA&amp;amp;color2=635147&amp;amp;color3=000000&amp;quot; alt=&amp;quot;r4rk1/ppp2ppp/3p2n1/8/4P3/2N5/PPP2PPP/2KRR3 w - -&amp;quot; title=&amp;quot;r4rk1/ppp2ppp/3p2n1/8/4P3/2N5/PPP2PPP/2KRR3 w - -&amp;quot; /&amp;gt; --&gt;&lt;table class=&quot;captionBox&quot;&gt;&lt;tr&gt;&lt;td class=&quot;captionedImage&quot;&gt;&lt;img src=&quot;http://webchess.freehostia.com/diag/chessdiag.php?fen=r4rk1/ppp2ppp/3p2n1/8/4P3/2N5/PPP2PPP/2KRR3%20w%20-%20-&amp;amp;size=large&amp;amp;coord=yes&amp;amp;cap=no&amp;amp;stm=yes&amp;amp;fb=no&amp;amp;theme=classic&amp;amp;color1=E3CEAA&amp;amp;color2=635147&amp;amp;color3=000000&quot; alt=&quot;r4rk1/ppp2ppp/3p2n1/8/4P3/2N5/PPP2PPP/2KRR3 w - -&quot; title=&quot;r4rk1/ppp2ppp/3p2n1/8/4P3/2N5/PPP2PPP/2KRR3 w - -&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;imageCaption&quot;&gt;r4rk1/ppp2ppp/3p2n1/8/4P3/2N5/PPP2PPP/2KRR3 w - -&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;!-- ws:end:WikiTextRemoteImageRule:66 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td rowspan=&quot;2&quot;&gt;&lt;strong&gt;Outposts&lt;/strong&gt;,&lt;br /&gt;
a chess term most often related to &lt;a class=&quot;wiki_link&quot; href=&quot;/Knight&quot;&gt;knights&lt;/a&gt; in the center or on the opponent&#039;s half of the board, defended by an own &lt;a class=&quot;wiki_link&quot; href=&quot;/Pawn&quot;&gt;pawn&lt;/a&gt;, and either no longer attackable by opponent pawns at all, or otherwise, provoking to weaken an opponent pawn on a &lt;a class=&quot;wiki_link&quot; href=&quot;/Half-open%20file&quot;&gt;half-open file&lt;/a&gt; no longer &amp;quot;Biting on Granite&amp;quot; &lt;!-- ws:start:WikiTextRefRule:1:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://open-chess.org/blog/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Biting on Granite - On Chess Improvement&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:1 --&gt; .&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;The mighty outpost Nd5! &lt;!-- ws:start:WikiTextRefRule:3:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://open-chess.org/blog/?p=112&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Biting on Granite » Nimzowitsch, My System: Part 1, Chapter 2 – The Open File - The outpost&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:3 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextTocRule:19:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:19 --&gt;&lt;!-- ws:start:WikiTextTocRule:20: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#On a Half-open file&quot;&gt;On a Half-open file&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:20 --&gt;&lt;!-- ws:start:WikiTextTocRule:21: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Occupying Holes&quot;&gt;Occupying Holes&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:21 --&gt;&lt;!-- ws:start:WikiTextTocRule:22: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Factors influencing score&quot;&gt;Factors influencing score&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:22 --&gt;&lt;!-- ws:start:WikiTextTocRule:23: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Forum Posts&quot;&gt;Forum Posts&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:23 --&gt;&lt;!-- ws:start:WikiTextTocRule:24: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:24 --&gt;&lt;!-- ws:start:WikiTextTocRule:25: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:25 --&gt;&lt;!-- ws:start:WikiTextTocRule:26: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:26 --&gt;&lt;!-- ws:start:WikiTextTocRule:27: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:27 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:5:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;On a Half-open file&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:5 --&gt;On a Half-open file&lt;/h1&gt;
 &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Aron_Nimzowitsch&quot; rel=&quot;nofollow&quot;&gt;Nimzowitsch&lt;/a&gt; defined outposts as &lt;a class=&quot;wiki_link&quot; href=&quot;/Squares&quot;&gt;squares&lt;/a&gt; on a &lt;a class=&quot;wiki_link&quot; href=&quot;/Half-open%20file&quot;&gt;half-open file&lt;/a&gt; on the opponent&#039;s half of the board, defended by own pawns. The logic between such a placement was to entice the opponent to attack such a piece by a pawn, thereby weakening the pawn standing on that half-open file. In &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Mein_System&quot; rel=&quot;nofollow&quot;&gt;My System&lt;/a&gt; knight and &lt;a class=&quot;wiki_link&quot; href=&quot;/Rook&quot;&gt;rook&lt;/a&gt; outposts were mentioned - the former occurred in the &lt;a class=&quot;wiki_link&quot; href=&quot;/Center&quot;&gt;center&lt;/a&gt;, the latter - on the wing. One game commentary mentions also &amp;quot;a diagonal outpost&amp;quot;, though this subject is not expanded.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:7:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Occupying Holes&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:7 --&gt;Occupying Holes&lt;/h1&gt;
 Some programmers apply a more common meaning of the word outpost, using this term in regard to a &lt;a class=&quot;wiki_link&quot; href=&quot;/Holes&quot;&gt;strong square&lt;/a&gt; in the center or opponent half of the board, defended by own pawn and no longer attackable by the opponent&#039;s pawn, occupied or about to be occupied by a knight. In this case the half-open file and provocation aspect of the outpost is lost, though the evaluation term is still useful.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:9:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Factors influencing score&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:9 --&gt;Factors influencing score&lt;/h1&gt;
 To give an estimate of a typical outpost score, &lt;a class=&quot;wiki_link&quot; href=&quot;/Toga%20Log#UserManual&quot;&gt;Toga log user manual&lt;/a&gt; advocates a bonus for a knight outpost on a central square as 10 centipawns, but it is possible to see bonuses as large as 16 centipawns. Furthermore, outpost value can be increased if it is defended by two pawns (thus making exchange sacrifice much less profitable) or if opponent has no minors that he can exchange for an outpost piece.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:11:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Forum Posts&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:11 --&gt;Forum Posts&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=384464&quot; rel=&quot;nofollow&quot;&gt;knight outposts&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Jan%20Kaan&quot;&gt;Jan K.&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 26, 2004&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=46372&quot; rel=&quot;nofollow&quot;&gt;Toga Knight Outpost&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Ben%20Tennison&quot;&gt;Ben Tennison&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, December 10, 2012 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Toga&quot;&gt;Toga&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=46918&quot; rel=&quot;nofollow&quot;&gt;The eternal knight&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Lyudmil%20Tsvetkov&quot;&gt;Lyudmil Tsvetkov&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, January 18, 2013&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=60171&quot; rel=&quot;nofollow&quot;&gt;A question about Outpost Knights / Bishops&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Andrew%20Grant&quot;&gt;Andrew Grant&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, May 15, 2016&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:13:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:13 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Outpost_%28chess%29&quot; rel=&quot;nofollow&quot;&gt;Outpost (chess) from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.chess.com/article/view/an-outpost&quot; rel=&quot;nofollow&quot;&gt;An Outpost&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.chess.com/members/view/energia&quot; rel=&quot;nofollow&quot;&gt;Iryna Zenyuk&lt;/a&gt;, July 16, 2009, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.chess.com/&quot; rel=&quot;nofollow&quot;&gt;Chess.com&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Outpost&quot; rel=&quot;nofollow&quot;&gt;Outpost (disambiguation) from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Outpost_%28military%29&quot; rel=&quot;nofollow&quot;&gt;Outpost (military) from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Outpost_Islands&quot; rel=&quot;nofollow&quot;&gt;Outpost Islands from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:15:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc5&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:15 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:125:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://open-chess.org/blog/&quot; rel=&quot;nofollow&quot;&gt;Biting on Granite - On Chess Improvement&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://open-chess.org/blog/?p=112&quot; rel=&quot;nofollow&quot;&gt;Biting on Granite » Nimzowitsch, My System: Part 1, Chapter 2 – The Open File - The outpost&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:125 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:17:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc6&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:17 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:00:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Outposts&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Outposts&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Outposts includeBody-Outposts includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AI+Chess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AI Chess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Alarm&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Alarm&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Amundsen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Amundsen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Amyan&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Amyan&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 10, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Andrew+Grant&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Andrew Grant&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 13, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bismark&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bismark&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 22, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Cheese&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Cheese&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 17, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/chess22k&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;chess22k&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 23, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Chunking&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Chunking&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 12, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Coiled&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Coiled&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 12, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dartmouth+CP&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dartmouth CP&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 19, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Design+Principles&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Design Principles&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 17, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dragon+FR&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dragon FR&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 9, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Ethereal&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Ethereal&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 20, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Evaluation+of+Pieces&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Evaluation of Pieces&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 8, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Evaluation+Patterns&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Evaluation Patterns&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 24, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gaviota&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gaviota&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 21, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gibbon&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gibbon&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 23, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gogobello&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gogobello&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 30, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Half-open+file&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Half-open file&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 11, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Holes&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Holes&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kaissa&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kaissa&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 9, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Lyudmil+Tsvetkov&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Lyudmil Tsvetkov&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 28, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Outposts&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Outposts&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pattern+Recognition&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pattern Recognition&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pawn+Structure&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pawn Structure&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 2, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/RuyDos&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;RuyDos&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 17, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Scorpio&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Scorpio&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 28, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Shield&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Shield&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 17, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sloppy&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sloppy&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 17, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Snitch&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Snitch&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Spike&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Spike&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Stockfish&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Stockfish&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 7, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Strategic+Test+Suite&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Strategic Test Suite&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 19, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Toga&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Toga&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 28, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/TRACE&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;TRACE&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 14, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Wasp&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Wasp&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/WyldChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;WyldChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 10, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Xpdnt&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Xpdnt&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 13, 2015&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:00 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Evaluation%20Patterns&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Rook</title>
      <link>https://chessprogramming.wikispaces.com/Rook</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Rook</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Rook</comments>
      <pubDate>Fri, 05 Nov 2010 17:08:07 GMT</pubDate>
      <description>&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Chess&quot;&gt;Chess&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Pieces&quot;&gt;Pieces&lt;/a&gt; * Rook&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextRemoteImageRule:9:&amp;lt;a href=&amp;quot;http://en.wikipedia.org/wiki/Rook_(chess)&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://upload.wikimedia.org/wikipedia/commons/thumb/7/79/StauntonRook2.jpg/120px-StauntonRook2.jpg&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Rook_(chess)&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/7/79/StauntonRook2.jpg/120px-StauntonRook2.jpg&quot; alt=&quot;external image 120px-StauntonRook2.jpg&quot; title=&quot;external image 120px-StauntonRook2.jpg&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextRemoteImageRule:9 --&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://chessprogramming.wikispaces.com/space/pagelist&quot; rel=&quot;nofollow&quot;&gt;CPW Pages&lt;/a&gt; with the &lt;a class=&quot;wiki_link&quot; href=&quot;/Guidance%20for%20Creating%20New%20Pages#Tags&quot;&gt;tag&lt;/a&gt; &amp;quot;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://chessprogramming.wikispaces.com/tag/view/rook&quot; rel=&quot;nofollow&quot;&gt;rook&lt;/a&gt;&amp;quot;&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextIncludeRule:00:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/pageList?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@component=&amp;amp;quot;pageList&amp;amp;quot; hideInternal=&amp;amp;quot;true&amp;amp;quot; tag=&amp;amp;quot;rook&amp;amp;quot; limit=&amp;amp;quot;200&amp;amp;quot;&amp;quot; title=&amp;quot;Include pageList: component=&amp;amp;quot;pageList&amp;amp;quot; hideInternal=&amp;amp;quot;true&amp;amp;quot; tag=&amp;amp;quot;rook&amp;amp;quot; limit=&amp;amp;quot;200&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody&quot;&gt;&lt;ol class=&quot;includePageList&quot;&gt;
              &lt;li class=&quot;includePageListPage&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/Butterfly+Boards&quot; class=&quot;includePageListPageUrl&quot;&gt;Butterfly Boards&lt;/a&gt;&lt;/li&gt;
                  &lt;li class=&quot;includePageListPage&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/Combinatorial+Logic&quot; class=&quot;includePageListPageUrl&quot;&gt;Combinatorial Logic&lt;/a&gt;&lt;/li&gt;
                  &lt;li class=&quot;includePageListPage&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/Congruent+Modulo+Bitboards&quot; class=&quot;includePageListPageUrl&quot;&gt;Congruent Modulo Bitboards&lt;/a&gt;&lt;/li&gt;
                  &lt;li class=&quot;includePageListPage&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/Evaluation+of+Pieces&quot; class=&quot;includePageListPageUrl&quot;&gt;Evaluation of Pieces&lt;/a&gt;&lt;/li&gt;
                  &lt;li class=&quot;includePageListPage&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/Exploding+Bitboards&quot; class=&quot;includePageListPageUrl&quot;&gt;Exploding Bitboards&lt;/a&gt;&lt;/li&gt;
                  &lt;li class=&quot;includePageListPage&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/First+Rank+Attacks&quot; class=&quot;includePageListPageUrl&quot;&gt;First Rank Attacks&lt;/a&gt;&lt;/li&gt;
                  &lt;li class=&quot;includePageListPage&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/Half-open+file&quot; class=&quot;includePageListPageUrl&quot;&gt;Half-open file&lt;/a&gt;&lt;/li&gt;
                  &lt;li class=&quot;includePageListPage&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/Hashing+Dictionaries&quot; class=&quot;includePageListPageUrl&quot;&gt;Hashing Dictionaries&lt;/a&gt;&lt;/li&gt;
                  &lt;li class=&quot;includePageListPage&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/Kindergarten+Bitboards&quot; class=&quot;includePageListPageUrl&quot;&gt;Kindergarten Bitboards&lt;/a&gt;&lt;/li&gt;
                  &lt;li class=&quot;includePageListPage&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/Magic+Bitboards&quot; class=&quot;includePageListPageUrl&quot;&gt;Magic Bitboards&lt;/a&gt;&lt;/li&gt;
                  &lt;li class=&quot;includePageListPage&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/Obstruction+Difference&quot; class=&quot;includePageListPageUrl&quot;&gt;Obstruction Difference&lt;/a&gt;&lt;/li&gt;
                  &lt;li class=&quot;includePageListPage&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/On+an+empty+Board&quot; class=&quot;includePageListPageUrl&quot;&gt;On an empty Board&lt;/a&gt;&lt;/li&gt;
                  &lt;li class=&quot;includePageListPage&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/Outposts&quot; class=&quot;includePageListPageUrl&quot;&gt;Outposts&lt;/a&gt;&lt;/li&gt;
                  &lt;li class=&quot;includePageListPage&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/Rook&quot; class=&quot;includePageListPageUrl&quot;&gt;Rook&lt;/a&gt;&lt;/li&gt;
                  &lt;li class=&quot;includePageListPage&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/Rook+on+Open+File&quot; class=&quot;includePageListPageUrl&quot;&gt;Rook on Open File&lt;/a&gt;&lt;/li&gt;
                  &lt;li class=&quot;includePageListPage&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/Rook+On+Seventh&quot; class=&quot;includePageListPageUrl&quot;&gt;Rook On Seventh&lt;/a&gt;&lt;/li&gt;
                  &lt;li class=&quot;includePageListPage&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/Rotated+Indices&quot; class=&quot;includePageListPageUrl&quot;&gt;Rotated Indices&lt;/a&gt;&lt;/li&gt;
                  &lt;li class=&quot;includePageListPage&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/SBAMG&quot; class=&quot;includePageListPageUrl&quot;&gt;SBAMG&lt;/a&gt;&lt;/li&gt;
                  &lt;li class=&quot;includePageListPage&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/Sequential+Logic&quot; class=&quot;includePageListPageUrl&quot;&gt;Sequential Logic&lt;/a&gt;&lt;/li&gt;
                  &lt;li class=&quot;includePageListPage&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/Sherwin+Bitboards&quot; class=&quot;includePageListPageUrl&quot;&gt;Sherwin Bitboards&lt;/a&gt;&lt;/li&gt;
                  &lt;li class=&quot;includePageListPage&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/Tarrasch+Rule&quot; class=&quot;includePageListPageUrl&quot;&gt;Tarrasch Rule&lt;/a&gt;&lt;/li&gt;
      &lt;/ol&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:00 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:2:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:2 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:01:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Rook&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Rook&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Rook includeBody-Rook includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tfoot class=&quot;includeBacklinksFooter&quot;&gt;
    &lt;tr&gt;
      &lt;td colspan=&quot;5&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/page/links/Rook&quot;&gt;More Links&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tfoot&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Algebraic+Chess+Notation&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Algebraic Chess Notation&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Alice&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Alice&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 20, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Arimaa&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Arimaa&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 4, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Backward+Pawn&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Backward Pawn&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 5, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Battery&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Battery&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 29, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Blockade+of+Stop&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Blockade of Stop&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Castling&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Castling&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 5, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Denis+Onneweer&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Denis Onneweer&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 3, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Efficient+Generation+of+Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Efficient Generation of Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Elephant&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Elephant&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 19, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Fill+Algorithms&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Fill Algorithms&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 6, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/First+Rank+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;First Rank Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 28, 2010&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gambit+Fruit&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gambit Fruit&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 29, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Halfmove+Clock&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Halfmove Clock&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 9, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hash+Table&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hash Table&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 1, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Influence+Quantity+of+Pieces&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Influence Quantity of Pieces&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 21, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Initial+Position&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Initial Position&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 14, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Irreversible+Moves&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Irreversible Moves&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Joanna&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Joanna&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 9, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/King&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;King&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 26, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/KRK&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;KRK&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 26, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Legal+Move&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Legal Move&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/MicroChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;MicroChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 14, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mobility&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mobility&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 17, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mop-up+Evaluation&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mop-up Evaluation&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 26, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/MVV-LVA&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;MVV-LVA&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 26, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Najib+Nakad&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Najib Nakad&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 22, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Outposts&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Outposts&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pawn+Spans&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pawn Spans&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 22, 2010&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pawns+and+Files+%28Bitboards%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pawns and Files (Bitboards)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 16, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pieces&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pieces&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 19, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pin&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pin&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Point+Value&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Point Value&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 31, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Promotions&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Promotions&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 6, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Reversible+Moves&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Reversible Moves&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 13, 2010&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rook&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rook&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 5, 2010&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rook+%28Program%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rook (Program)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 8, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rook+Endgame&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rook Endgame&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 18, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Scidlet&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Scidlet&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 31, 2014&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:01 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Pieces&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Rook on Open File</title>
      <link>https://chessprogramming.wikispaces.com/Rook+on+Open+File</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Rook+on+Open+File</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Rook+on+Open+File</comments>
      <pubDate>Mon, 24 Apr 2017 09:20:48 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:11:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:11 --&gt;&lt;!-- ws:start:WikiTextTocRule:12: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:12 --&gt;&lt;!-- ws:start:WikiTextTocRule:13: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Forum Posts&quot;&gt;Forum Posts&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:13 --&gt;&lt;!-- ws:start:WikiTextTocRule:14: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:14 --&gt;&lt;!-- ws:start:WikiTextTocRule:15: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:15 --&gt;&lt;!-- ws:start:WikiTextTocRule:16: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:16 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Evaluation&quot;&gt;Evaluation&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Evaluation%20of%20Pieces&quot;&gt;of Pieces&lt;/a&gt; * Rooks on (semi) open files&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
An &lt;a class=&quot;wiki_link&quot; href=&quot;/Open%20file&quot;&gt;open file&lt;/a&gt; is usually defined as a file with no pawns on it; a &lt;a class=&quot;wiki_link&quot; href=&quot;/Half-open%20file&quot;&gt;semi-open file&lt;/a&gt; as containing only the enemy pawns. In both cases a rook occupying such a &lt;a class=&quot;wiki_link&quot; href=&quot;/Files&quot;&gt;file&lt;/a&gt; gets greater vertical &lt;a class=&quot;wiki_link&quot; href=&quot;/Mobility&quot;&gt;mobility&lt;/a&gt; as well as a chance to penetrate the enemy camp, positioning itself on the &lt;a class=&quot;wiki_link&quot; href=&quot;/Rook%20on%20Seventh&quot;&gt;7th rank&lt;/a&gt;. &lt;br /&gt;
&lt;br /&gt;
Early versions of &lt;a class=&quot;wiki_link&quot; href=&quot;/Fruit&quot;&gt;Fruit&lt;/a&gt; omitted this evaluation term altogether. Some programs, like &lt;a class=&quot;wiki_link&quot; href=&quot;/Rebel&quot;&gt;Rebel&lt;/a&gt;, have an additional bonus for doubling rooks on an open file. Some increase the bonus if the file has a bearing against the &lt;a class=&quot;wiki_link&quot; href=&quot;/King%20Safety&quot;&gt;enemy king&lt;/a&gt; , some make the bonus dependent on the number of own pawns. It is worth noting that &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Aron_Nimzowitsch&quot; rel=&quot;nofollow&quot;&gt;Nimzowitsch&lt;/a&gt; in &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Mein_System&quot; rel=&quot;nofollow&quot;&gt;My System&lt;/a&gt; used the term &amp;quot;(semi) open file&amp;quot; even for the rooks standing in front of the &lt;a class=&quot;wiki_link&quot; href=&quot;/Pawn%20chain&quot;&gt;pawn chain&lt;/a&gt;. The same has been said about &lt;a class=&quot;wiki_link&quot; href=&quot;/Rybka&quot;&gt;Rybka&lt;/a&gt;. Bonuses applied to a rook on an open file vary from &lt;strong&gt;8&lt;/strong&gt; to &lt;strong&gt;20&lt;/strong&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Centipawns&quot;&gt;centipawns&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:1:&amp;amp;lt;ref&amp;amp;gt;20 cp comes from &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Toga%20Log#UserManual&amp;quot;&amp;gt;Toga log user manual&amp;lt;/a&amp;gt;, after adding actual bonus and penalty for a rook on a closed file&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:1 --&gt;. Typical bonus for a semi-open file is half of that for a fully open file.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:3:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:3 --&gt;See also&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Half-open%20file&quot;&gt;Half-open file&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/King%20Safety&quot;&gt;King Safety&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Open%20file&quot;&gt;Open file&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Pawns%20and%20Files%20%28Bitboards%29&quot;&gt;Pawns and Files (Bitboards)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Rook%20on%20Seventh&quot;&gt;Rook on Seventh&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:5:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Forum Posts&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:5 --&gt;Forum Posts&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=55324&quot; rel=&quot;nofollow&quot;&gt;So same, so different&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Lyudmil%20Tsvetkov&quot;&gt;Lyudmil Tsvetkov&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;,  February 12, 2015&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:7:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:7 --&gt;References&lt;/h1&gt;
&lt;!-- ws:start:WikiTextReferencesRule:76:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; 20 cp comes from &lt;a class=&quot;wiki_link&quot; href=&quot;/Toga%20Log#UserManual&quot;&gt;Toga log user manual&lt;/a&gt;, after adding actual bonus and penalty for a rook on a closed file&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:76 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:9:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:9 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:00:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Rook On Open File&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Rook On Open File&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Rook_on_Open_File includeBody-Rook%20on%20Open%20File includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tfoot class=&quot;includeBacklinksFooter&quot;&gt;
    &lt;tr&gt;
      &lt;td colspan=&quot;5&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/page/links/Rook+On+Open+File&quot;&gt;More Links&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tfoot&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Amundsen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Amundsen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Amyan&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Amyan&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 10, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Battery&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Battery&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 29, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BigLion&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BigLion&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 28, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bismark&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bismark&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 22, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Cheese&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Cheese&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 17, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/chess22k&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;chess22k&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 23, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/ChessBrainVB&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;ChessBrainVB&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Coiled&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Coiled&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 12, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Defenchess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Defenchess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 18, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Diablo&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Diablo&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 17, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dorpsgek&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dorpsgek&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 2, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Ethereal&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Ethereal&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 20, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Evaluation+of+Pieces&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Evaluation of Pieces&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 8, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Exacto&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Exacto&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 3, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Garbochess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Garbochess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 23, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/HeavyChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;HeavyChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 14, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/ISA&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;ISA&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 2, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kaissa&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kaissa&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 9, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kholin&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kholin&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 3, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Lyudmil+Tsvetkov&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Lyudmil Tsvetkov&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 28, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Marvin&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Marvin&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 10, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Minority+Attack&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Minority Attack&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 6, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Murka&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Murka&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Nebula&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Nebula&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 7, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Open+file&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Open file&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 15, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pawn+Structure&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pawn Structure&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 2, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Planning&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Planning&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 12, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/PolarChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;PolarChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 15, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/RattateChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;RattateChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 2, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Robocide&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Robocide&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rook+on+Open+File&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rook on Open File&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sayuri&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sayuri&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 1, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Scorpio&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Scorpio&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 28, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SCP&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SCP&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 16, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Shield&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Shield&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 17, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sloppy&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sloppy&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 17, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Spike&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Spike&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Stockfish&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Stockfish&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 7, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Strategic+Test+Suite&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Strategic Test Suite&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 19, 2016&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:00 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Evaluation%20of%20Pieces&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Rook On Seventh</title>
      <link>https://chessprogramming.wikispaces.com/Rook+On+Seventh</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Rook+On+Seventh</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Rook+On+Seventh</comments>
      <pubDate>Sun, 24 May 2009 11:36:56 GMT</pubDate>
      <description>&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Evaluation&quot;&gt;Evaluation&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Evaluation%20of%20Pieces&quot;&gt;of Pieces&lt;/a&gt; * Rook on Seventh&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
This is a common evaluation term. In chess, having &lt;strong&gt;a rook on the seventh&lt;/strong&gt; &lt;strong&gt;rank&lt;/strong&gt; is quite powerful, since it can both attack opponent pawns on their baseline and trap a king on the 8th (1st) rank. Especially the situation termed &lt;em&gt;the absolute control of the seventh rank&lt;/em&gt; - having two unopposed major pieces on it with the king trapped on the 8th rank - can have a devastating effect.&lt;br /&gt;
&lt;br /&gt;
More elaborate programs only give a bonus for rook on the seventh rank if there are opponent pawns on the 7th rank, or the opponent&#039;s king is on the eighth rank. Simple engines, on the other hand, might incorporate this bonus in the &lt;a class=&quot;wiki_link&quot; href=&quot;/piece-square%20tables&quot;&gt;piece-square tables&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Whereas this evaluation term is generally acclaimed as useful, there is a debate whether to assign a smaller bonus for placing a rook on the eighth (first) rank.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:1:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:1 --&gt;What links here?&lt;/h1&gt;
&lt;!-- ws:start:WikiTextIncludeRule:00:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Rook On Seventh&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Rook On Seventh&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Rook_On_Seventh includeBody-Rook%20On%20Seventh includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Alarm&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Alarm&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Amundsen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Amundsen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Amyan&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Amyan&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 10, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Battery&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Battery&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 29, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BigLion&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BigLion&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 28, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Cheese&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Cheese&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 17, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Chess+0.5&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Chess 0.5&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 20, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Coiled&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Coiled&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 12, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dartmouth+CP&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dartmouth CP&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 19, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Diablo&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Diablo&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 17, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Djinn&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Djinn&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 8, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Ethereal&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Ethereal&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 20, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Evaluation+of+Pieces&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Evaluation of Pieces&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 8, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Evaluation+Overlap&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Evaluation Overlap&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 19, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Exacto&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Exacto&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 3, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/HeavyChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;HeavyChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 14, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/ISA&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;ISA&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 2, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kaissa&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kaissa&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 9, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Marvin&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Marvin&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 10, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Nebula&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Nebula&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 7, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Planning&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Planning&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 12, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Quantifying+Evaluation+features&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Quantifying Evaluation features&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 6, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/RattateChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;RattateChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 2, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Robocide&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Robocide&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rook+on+Open+File&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rook on Open File&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rook+On+Seventh&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rook On Seventh&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 24, 2009&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Scorpio&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Scorpio&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 28, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Shield&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Shield&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 17, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sloppy&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sloppy&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 17, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Spike&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Spike&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Strategic+Test+Suite&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Strategic Test Suite&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 19, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SuperChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SuperChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Teki&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Teki&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 29, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Wasp&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Wasp&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/WyldChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;WyldChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 10, 2018&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:00 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Evaluation%20of%20Pieces&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Rotated Indices</title>
      <link>https://chessprogramming.wikispaces.com/Rotated+Indices</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Rotated+Indices</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Rotated+Indices</comments>
      <pubDate>Mon, 09 Oct 2017 08:04:39 GMT</pubDate>
      <description>&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Board%20Representation&quot;&gt;Board Representation&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Bitboards&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Sliding Piece Attacks&lt;/a&gt; * Rotated Indices&lt;/strong&gt;&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:55:&amp;lt;a href=&amp;quot;http://www.barbaramittman.com/Site/Yellow_Cherries.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/Yellow_Cherries.jpg/157881701/Yellow_Cherries.jpg&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;http://www.barbaramittman.com/Site/Yellow_Cherries.html&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/Yellow_Cherries.jpg/157881701/Yellow_Cherries.jpg&quot; alt=&quot;Yellow_Cherries.jpg&quot; title=&quot;Yellow_Cherries.jpg&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:55 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td rowspan=&quot;2&quot;&gt;&lt;strong&gt;Rotated indices&lt;/strong&gt;,&lt;br /&gt;
a deconcentrated version of &lt;a class=&quot;wiki_link&quot; href=&quot;/Rotated%20Bitboards&quot;&gt;rotated bitboards&lt;/a&gt;, proposed by &lt;a class=&quot;wiki_link&quot; href=&quot;/Alessandro%20Damiani&quot;&gt;Alessandro Damiani&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:3:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://groups.google.com/group/rec.games.chess.computer/msg/5c1c40a08c7176f8&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: Rotated bitboards&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Alessandro%20Damiani&amp;quot;&amp;gt;Alessandro Damiani&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;rgcc&amp;lt;/a&amp;gt;, October 31, 1997&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:3 --&gt; as used in his engine &lt;a class=&quot;wiki_link&quot; href=&quot;/Fortress%20%28Engine%29&quot;&gt;Fortress&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Instead of using rotated bitboards with packed 15 &lt;a class=&quot;wiki_link&quot; href=&quot;/Diagonals&quot;&gt;diagonals&lt;/a&gt; and 15 &lt;a class=&quot;wiki_link&quot; href=&quot;/Anti-Diagonals&quot;&gt;anti-diagonals&lt;/a&gt; each, Alessandro applies an &lt;a class=&quot;wiki_link&quot; href=&quot;/Array&quot;&gt;array&lt;/a&gt; of 16 + 30 rotated indices for all 16 orthogonal and 30 diagonal lines on the board. Those indices are &lt;a class=&quot;wiki_link&quot; href=&quot;/Incremental%20Updates&quot;&gt;incrementally updated&lt;/a&gt; during &lt;a class=&quot;wiki_link&quot; href=&quot;/Make%20Move&quot;&gt;make&lt;/a&gt;/&lt;a class=&quot;wiki_link&quot; href=&quot;/Unmake%20Move&quot;&gt;unmake&lt;/a&gt;, which takes a tad more effort - but once updated, the rotated indices pay off, the more often they are used inside a &lt;a class=&quot;wiki_link&quot; href=&quot;/Node&quot;&gt;node&lt;/a&gt; of the &lt;a class=&quot;wiki_link&quot; href=&quot;/Search&quot;&gt;search&lt;/a&gt;. No further computation is required to look up attacks, pure indexed memory accesses.&lt;br /&gt;
&lt;br /&gt;
The possible disadvantage - rotated indices, similar or slightly worse than rotated bitboards, are not as versatile as techniques relying on one occupancy bitboard only - if it is about a temporary change of the occupancy on the fly for &lt;a class=&quot;wiki_link&quot; href=&quot;/X-ray%20Attacks%20%28Bitboards%29&quot;&gt;x-rays&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Pin&quot;&gt;pinned pieces&lt;/a&gt; etc..&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Arts#Mittman&quot;&gt;Barbara Mittman&lt;/a&gt;, Yellow Cherries &lt;!-- ws:start:WikiTextRefRule:6:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.barbaramittman.com/Site/Still_Lifes.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Still Lifes&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Arts#Mittman&amp;quot;&amp;gt;Barbara Mittman&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:6 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextTocRule:16:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:16 --&gt;&lt;!-- ws:start:WikiTextTocRule:17: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:17 --&gt;&lt;!-- ws:start:WikiTextTocRule:18: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Forum Posts&quot;&gt;Forum Posts&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:18 --&gt;&lt;!-- ws:start:WikiTextTocRule:19: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:19 --&gt;&lt;!-- ws:start:WikiTextTocRule:20: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:20 --&gt;&lt;!-- ws:start:WikiTextTocRule:21: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:21 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:8:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:8 --&gt;See also&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Flipping%20Mirroring%20and%20Rotating&quot;&gt;Flipping Mirroring and Rotating&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Fortress%20%28Engine%29&quot;&gt;Fortress&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Rotated%20Bitboards&quot;&gt;Rotated Bitboards&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Gk#SlidingAttacks&quot;&gt;Rotated Indices in Gk&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:10:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Forum Posts&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:10 --&gt;Forum Posts&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://groups.google.com/group/rec.games.chess.computer/msg/5c1c40a08c7176f8&quot; rel=&quot;nofollow&quot;&gt;Re: Rotated bitboards&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Alessandro%20Damiani&quot;&gt;Alessandro Damiani&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;rgcc&lt;/a&gt;, October 31, 1997&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=342812&quot; rel=&quot;nofollow&quot;&gt;Re: Resources about rotated bitboards&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Alessandro%20Damiani&quot;&gt;Alessandro Damiani&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, January 16, 2004&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:12:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:12 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:106:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://groups.google.com/group/rec.games.chess.computer/msg/5c1c40a08c7176f8&quot; rel=&quot;nofollow&quot;&gt;Re: Rotated bitboards&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Alessandro%20Damiani&quot;&gt;Alessandro Damiani&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;rgcc&lt;/a&gt;, October 31, 1997&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.barbaramittman.com/Site/Still_Lifes.html&quot; rel=&quot;nofollow&quot;&gt;Still Lifes&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Arts#Mittman&quot;&gt;Barbara Mittman&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:106 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:14:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:14 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:00:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Rotated Indices&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;10&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Rotated Indices&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;10&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Rotated_Indices includeBody-Rotated%20Indices includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Alessandro+Damiani&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Alessandro Damiani&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 9, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Fortress+%28Engine%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Fortress (Engine)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 19, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gk&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gk&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 9, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rotated+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rotated Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rotated+Indices&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rotated Indices&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 9, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:00 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>SBAMG</title>
      <link>https://chessprogramming.wikispaces.com/SBAMG</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/SBAMG</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/SBAMG</comments>
      <pubDate>Sun, 04 Dec 2016 09:16:26 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:21:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:21 --&gt;&lt;!-- ws:start:WikiTextTocRule:22: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Sample&quot;&gt;Sample&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:22 --&gt;&lt;!-- ws:start:WikiTextTocRule:23: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#C Code&quot;&gt;C Code&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:23 --&gt;&lt;!-- ws:start:WikiTextTocRule:24: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:24 --&gt;&lt;!-- ws:start:WikiTextTocRule:25: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Forum Posts&quot;&gt;Forum Posts&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:25 --&gt;&lt;!-- ws:start:WikiTextTocRule:26: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:26 --&gt;&lt;!-- ws:start:WikiTextTocRule:27: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:27 --&gt;&lt;!-- ws:start:WikiTextTocRule:28: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:28 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Board%20Representation&quot;&gt;Board Representation&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Bitboards&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Sliding Piece Attacks&lt;/a&gt; * SBAMG&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;SBAMG&lt;/strong&gt;, (Subtraction based Attack Mask Generation)&lt;br /&gt;
a subtraction based approach proposed by &lt;a class=&quot;wiki_link&quot; href=&quot;/Syed%20Fahad&quot;&gt;Syed Fahad&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:6:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=59845&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;SBAMG - Completing Hyperbola Quintessence&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Syed%20Fahad&amp;quot;&amp;gt;Syed Fahad&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, April 10, 2016&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:6 --&gt; which combines techniques used in &lt;a class=&quot;wiki_link&quot; href=&quot;/Subtracting%20a%20Rook%20from%20a%20Blocking%20Piece&quot;&gt;Subtracting a Rook from a Blocking Piece&lt;/a&gt; aka o^(o-2r) and &lt;a class=&quot;wiki_link&quot; href=&quot;/Obstruction%20Difference&quot;&gt;Obstruction Difference&lt;/a&gt;. The idea is to subtract three times the closest blocker in &lt;a class=&quot;wiki_link&quot; href=&quot;/On%20an%20empty%20Board#NegativeRays&quot;&gt;negative ray&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Direction&quot;&gt;direction&lt;/a&gt; (&lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheMostSignificantOneBitMS1B&quot;&gt;most significant one bit&lt;/a&gt; of lower ray &lt;a class=&quot;wiki_link&quot; href=&quot;/Occupancy&quot;&gt;occupancy&lt;/a&gt;)  from the line  &lt;a class=&quot;wiki_link&quot; href=&quot;/Occupancy&quot;&gt;occupancy&lt;/a&gt;, to &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ExclusiveOr&quot;&gt;exclusive or&lt;/a&gt; that difference with the line occupancy again: &lt;strong&gt;o^(o-3cbn)&lt;/strong&gt;. Three times is necessary, since we need not only to subtract the next highest neigbouring square of the closest blocker for the borrow propagation, but the blocker square itself. The line occupancy excludes the sliding piece itself, and equivalently the final result is again restricted by the line-mask excluding the square of the attacker. Outer squares of the line occupancy, which don&#039;t affect resulting line attacks, are always set to avoid conditional code.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:9:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Sample&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:9 --&gt;Sample&lt;/h1&gt;
A two &lt;a class=&quot;wiki_link&quot; href=&quot;/Nibble&quot;&gt;nibble&lt;/a&gt; sample calculating the &lt;a class=&quot;wiki_link&quot; href=&quot;/Ranks&quot;&gt;rank&lt;/a&gt; aka &lt;a class=&quot;wiki_link&quot; href=&quot;/Byte&quot;&gt;byte&lt;/a&gt; attacks of a rook illustrates the technique:&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;                   binary     hex  dez&amp;lt;br/&amp;gt;bit-index          7654 3210  &amp;lt;br/&amp;gt;blockers and rook  .b.. r.bb&amp;lt;br/&amp;gt;occ (without rook) 0100 0011  0x43  67&amp;lt;br/&amp;gt;cbn                0000 0010  0x02   2 &amp;lt;br/&amp;gt;occ-3cbn           0011 1101  0x3d  61&amp;lt;br/&amp;gt;occ^(occ-3cbn)     0111 1110  0x7e 126&amp;lt;br/&amp;gt;attacks (/rook)    0111 0110  0x76 118&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;                   binary     hex  dez
bit-index          7654 3210  
blockers and rook  .b.. r.bb
occ (without rook) 0100 0011  0x43  67
cbn                0000 0010  0x02   2 
occ-3cbn           0011 1101  0x3d  61
occ^(occ-3cbn)     0111 1110  0x7e 126
attacks (/rook)    0111 0110  0x76 118&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:11:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;C Code&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:11 --&gt;C Code&lt;/h1&gt;
 The routine works for all lines, &lt;a class=&quot;wiki_link&quot; href=&quot;/Ranks&quot;&gt;ranks&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Files&quot;&gt;files&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Diagonals&quot;&gt;diagonals&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Anti-Diagonals&quot;&gt;anti-diagonals&lt;/a&gt; by applying appropriate line-masks, and could therefor used as a generalized routine with a line-direction parameter. Signature and &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#Bitscanreverse&quot;&gt;BitScanReverse&lt;/a&gt; (bsr64) similar to &lt;a class=&quot;wiki_link&quot; href=&quot;/Obstruction%20Difference&quot;&gt;Obstruction Difference&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextIncludeRule:03:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/page?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;MappingHint&amp;amp;quot;&amp;quot; title=&amp;quot;Include page: page=&amp;amp;quot;MappingHint&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;

&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a href=&quot;/Square%20Mapping%20Considerations&quot;&gt;&lt;img src=&quot;/file/view/mapping.JPG/93134172/mapping.JPG&quot; alt=&quot;mapping.JPG&quot; title=&quot;mapping.JPG&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;em&gt;Code samples and bitboard diagrams rely on &lt;a class=&quot;wiki_link&quot; href=&quot;/Square%20Mapping%20Considerations#LittleEndianRankFileMapping&quot;&gt;Little endian file and rank mapping&lt;/a&gt;&lt;/em&gt;.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:end:WikiTextIncludeRule:03 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/*&amp;lt;br/&amp;gt; * @author Syed Fahad, Gerd Isenberg&amp;lt;br/&amp;gt; * @param  U64 occ occupancy of the board&amp;lt;br/&amp;gt; * @param  SMasks* a mask structure by square and line&amp;lt;br/&amp;gt; * @return line attacks from that square&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;U64 lineAttacks(U64 occ, const SMasks *pMask) {&amp;lt;br/&amp;gt;   occ &amp;amp;amp;= pMask-&amp;amp;gt;lineEx;&amp;lt;br/&amp;gt;   occ |= pMask-&amp;amp;gt;outer;&amp;lt;br/&amp;gt;   int bsq = bsr64(occ &amp;amp;amp; pMask-&amp;amp;gt;lower);&amp;lt;br/&amp;gt;   U64 cbnx3 = C64(3) &amp;amp;lt;&amp;amp;lt; bsq; // or lookup&amp;lt;br/&amp;gt;   occ = occ ^ (occ - cbnx3);&amp;lt;br/&amp;gt;   return occ &amp;amp;amp; pMask-&amp;amp;gt;lineEx;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/*
 * @author Syed Fahad, Gerd Isenberg
 * @param  U64 occ occupancy of the board
 * @param  SMasks* a mask structure by square and line
 * @return line attacks from that square
 */&lt;/span&gt;
U64 lineAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; SMasks &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;pMask&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   occ &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; pMask&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;lineEx&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; pMask&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;outer&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bsq &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bsr64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; pMask&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;lower&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   U64 cbnx3 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; bsq&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// or lookup&lt;/span&gt;
   occ &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; occ &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; cbnx3&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; occ &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; pMask&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;lineEx&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;To use it that way:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;struct SMasks&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;   U64 lower;  // 1 for sq 0, otherwise (1 &amp;amp;lt;&amp;amp;lt; sq) - 1&amp;lt;br/&amp;gt;   U64 lineEx; // excluding (1 &amp;amp;lt;&amp;amp;lt; sq)&amp;lt;br/&amp;gt;   U64 outer;  // outer &amp;amp;amp; 1 must be 1 to avoid calling bsr(0)&amp;lt;br/&amp;gt;} masks[64][4]; // needs initialization&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 rookAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   return lineAttacks(occ, masks[sq] + 0) | lineAttacks(occ, masks[sq] + 1);&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;U64 bishopAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   return lineAttacks(occ, masks[sq] + 2) | lineAttacks(occ, masks[sq] + 3);&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;struct&lt;/span&gt; SMasks
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64 lower&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// 1 for sq 0, otherwise (1 &amp;lt;&amp;lt; sq) - 1&lt;/span&gt;
   U64 lineEx&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// excluding (1 &amp;lt;&amp;lt; sq)&lt;/span&gt;
   U64 outer&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// outer &amp;amp; 1 must be 1 to avoid calling bsr(0)&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; masks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// needs initialization&lt;/span&gt;
&amp;nbsp;
U64 rookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; lineAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ, masks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; lineAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ, masks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 bishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; lineAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ, masks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; lineAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ, masks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:13:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:13 --&gt;See also&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Hyperbola%20Quintessence&quot;&gt;Hyperbola Quintessence&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Obstruction%20Difference&quot;&gt;Obstruction Difference&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Subtracting%20a%20Rook%20from%20a%20Blocking%20Piece&quot;&gt;Subtracting a Rook from a Blocking Piece&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:15:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Forum Posts&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:15 --&gt;Forum Posts&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=56468&quot; rel=&quot;nofollow&quot;&gt;Slider attack mask generation without table lookup&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Syed%20Fahad&quot;&gt;Syed Fahad&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, May 24, 2015&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=59845&quot; rel=&quot;nofollow&quot;&gt;SBAMG - Competing Hyperbola Quintessence&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Syed%20Fahad&quot;&gt;Syed Fahad&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, April 10, 2016 »  &lt;a class=&quot;wiki_link&quot; href=&quot;/Hyperbola%20Quintessence&quot;&gt;Hyperbola Quintessence&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=62159&quot; rel=&quot;nofollow&quot;&gt;Subtraction based Attack Mask Generation&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Syed%20Fahad&quot;&gt;Syed Fahad&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, November 16, 2016&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:17:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:17 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:107:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=59845&quot; rel=&quot;nofollow&quot;&gt;SBAMG - Completing Hyperbola Quintessence&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Syed%20Fahad&quot;&gt;Syed Fahad&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, April 10, 2016&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:107 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:19:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc5&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:19 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:04:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;SBAMG&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;20&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;SBAMG&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;20&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-SBAMG includeBody-SBAMG includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hyperbola+Quintessence&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hyperbola Quintessence&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Obstruction+Difference&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Obstruction Difference&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SBAMG&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SBAMG&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 4, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Subtracting+a+Rook+from+a+Blocking+Piece&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Subtracting a Rook from a Blocking Piece&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 2, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Syed+Fahad&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Syed Fahad&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 1, 2017&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:04 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Sequential Logic</title>
      <link>https://chessprogramming.wikispaces.com/Sequential+Logic</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Sequential+Logic</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Sequential+Logic</comments>
      <pubDate>Wed, 10 May 2017 09:02:48 GMT</pubDate>
      <description>&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Hardware&quot;&gt;Hardware&lt;/a&gt; * Sequential Logic&lt;/strong&gt;&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:82:&amp;lt;a href=&amp;quot;http://web.mit.edu/6.111/www/f2005/tutprobs/sequential.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/sequential04.gif/483098820/sequential04.gif&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;http://web.mit.edu/6.111/www/f2005/tutprobs/sequential.html&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/sequential04.gif/483098820/sequential04.gif&quot; alt=&quot;sequential04.gif&quot; title=&quot;sequential04.gif&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:82 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td rowspan=&quot;2&quot;&gt;A &lt;strong&gt;Sequential Logic&lt;/strong&gt; is a &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Digital_electronics&quot; rel=&quot;nofollow&quot;&gt;digital circuit&lt;/a&gt; where one or more outputs are &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Boolean_function&quot; rel=&quot;nofollow&quot;&gt;boolean functions&lt;/a&gt; of multiple inputs and the history of the outputs. In contrast to &lt;a class=&quot;wiki_link&quot; href=&quot;/Combinatorial%20Logic&quot;&gt;combinatorial logic&lt;/a&gt;, a sequential logic requires &lt;a class=&quot;wiki_link&quot; href=&quot;/Memory&quot;&gt;memory&lt;/a&gt; to somehow feed the history of the outputs back to the inputs. Usually, for deterministic and reliable behavior considering internal &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Latency_%28engineering%29&quot; rel=&quot;nofollow&quot;&gt;latencies&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Propagation_delay&quot; rel=&quot;nofollow&quot;&gt;propagation delays&lt;/a&gt;, a sequential logic is &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Synchronous_logic&quot; rel=&quot;nofollow&quot;&gt;synchronous&lt;/a&gt;, that is the memory only change their content on the edge of a &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Clock_signal&quot; rel=&quot;nofollow&quot;&gt;clock signal&lt;/a&gt;.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;Sequential circuit &lt;!-- ws:start:WikiTextRefRule:2:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://web.mit.edu/6.111/www/f2005/tutprobs/sequential.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Sequential Logic&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:2 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextTocRule:19:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:19 --&gt;&lt;!-- ws:start:WikiTextTocRule:20: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Applications&quot;&gt;Applications&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:20 --&gt;&lt;!-- ws:start:WikiTextTocRule:21: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Sequential Rook Attack&quot;&gt;Sequential Rook Attack&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:21 --&gt;&lt;!-- ws:start:WikiTextTocRule:22: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:22 --&gt;&lt;!-- ws:start:WikiTextTocRule:23: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Publications&quot;&gt;Publications&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:23 --&gt;&lt;!-- ws:start:WikiTextTocRule:24: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:24 --&gt;&lt;!-- ws:start:WikiTextTocRule:25: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:25 --&gt;&lt;!-- ws:start:WikiTextTocRule:26: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:26 --&gt;&lt;!-- ws:start:WikiTextTocRule:27: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:27 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:5:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Applications&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:5 --&gt;Applications&lt;/h1&gt;
 Sequential logic, that is &lt;a class=&quot;wiki_link&quot; href=&quot;/Combinatorial%20Logic&quot;&gt;combinatorial logic&lt;/a&gt; combined with &lt;a class=&quot;wiki_link&quot; href=&quot;/Memory&quot;&gt;memory&lt;/a&gt;, is the base of &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Finite_state_machine&quot; rel=&quot;nofollow&quot;&gt;Finite-state machines&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Turing%20Machine&quot;&gt;Turing machines&lt;/a&gt; as well as digital &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Computer&quot; rel=&quot;nofollow&quot;&gt;computers&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:28:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@SequentialRookAttack&amp;quot; title=&amp;quot;Anchor: SequentialRookAttack&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;SequentialRookAttack&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:28 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:7:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Sequential Rook Attack&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:7 --&gt;Sequential Rook Attack&lt;/h1&gt;
 As an further example, a sequential logic may perform the same task as mentioned in &lt;a class=&quot;wiki_link&quot; href=&quot;/Combinatorial%20Logic#CombinatorialAttackandDefendMap&quot;&gt;Combinatorial Attack and Defend Map&lt;/a&gt;, but with less &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logic_gates&quot; rel=&quot;nofollow&quot;&gt;gates&lt;/a&gt; in up to seven cycles - similar to the &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;bitboard techniques&lt;/a&gt; like &lt;a class=&quot;wiki_link&quot; href=&quot;/Dumb7Fill&quot;&gt;Dumb7Fill&lt;/a&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;                                             +&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+&amp;lt;br/&amp;gt;                                +&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+     |       |&amp;lt;br/&amp;gt; o&amp;amp;#45;-/64/&amp;amp;#45;- empty(square) -/64/&amp;amp;#45;-| 64:1 |&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-&amp;amp;gt;|       |&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o result reliable / otherwise processing after reset&amp;lt;br/&amp;gt;                                +&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+     | Comb. |&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-o A8 is attacked by white rook from south&amp;lt;br/&amp;gt;                                   ^         | Logic |&amp;lt;br/&amp;gt;                                +&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+     |       |&amp;lt;br/&amp;gt; o&amp;amp;#45;-/64/&amp;amp;#45;- wrook(square) -/64/&amp;amp;#45;-| 64:1 |&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-&amp;amp;gt;|       |&amp;amp;#45;-&amp;amp;gt;&amp;amp;#45;-+&amp;lt;br/&amp;gt;                                +&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-.+     |       |     |&amp;lt;br/&amp;gt;                                   ^      o-&amp;amp;gt;|       |     |&amp;lt;br/&amp;gt;                                 /6|      |  +&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+     |&amp;lt;br/&amp;gt;                                   |      |                v&amp;lt;br/&amp;gt;                                +&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+           |&amp;lt;br/&amp;gt;                                |              |           |&amp;lt;br/&amp;gt;                                |    Latch     |&amp;amp;lt;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+&amp;lt;br/&amp;gt;                     reset o&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-|              |&amp;lt;br/&amp;gt;                                +&amp;amp;#45;&amp;amp;#45;-^&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;&amp;amp;#45;-+&amp;lt;br/&amp;gt;                                    |&amp;lt;br/&amp;gt;                                   clk&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;                                             +-------+
                                +------+     |       |
 o--/64/-- empty(square) -/64/--| 64:1 |----&amp;gt;|       |-----o result reliable / otherwise processing after reset
                                +------+     | Comb. |-----o A8 is attacked by white rook from south
                                   ^         | Logic |
                                +------+     |       |
 o--/64/-- wrook(square) -/64/--| 64:1 |----&amp;gt;|       |--&amp;gt;--+
                                +-----.+     |       |     |
                                   ^      o-&amp;gt;|       |     |
                                 /6|      |  +-------+     |
                                   |      |                v
                                +--------------+           |
                                |              |           |
                                |    Latch     |&amp;lt;----------+
                     reset o----|              |
                                +---^----------+
                                    |
                                   clk&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:9:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:9 --&gt;See also&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Belle#Hardware&quot;&gt;Belle | Hardware Move Generation&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Combinatorial%20Logic&quot;&gt;Combinatorial Logic&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/FPGA&quot;&gt;FPGA&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Memory&quot;&gt;Memory&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Pseudorandom%20Number%20Generator&quot;&gt;Pseudorandom Number Generator&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:11:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Publications&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:11 --&gt;Publications&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Alan%20H.%20Bond&quot;&gt;Alan H. Bond&lt;/a&gt; (&lt;strong&gt;1987&lt;/strong&gt;). &lt;em&gt;Broadcasting Arrays - A Highly Parallel Computer Architecture Suitable For Easy Fabrication&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.exso.com/bc.pdf&quot; rel=&quot;nofollow&quot;&gt;pdf&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.scm.tees.ac.uk/users/a.clements/&quot; rel=&quot;nofollow&quot;&gt;Alan Clements&lt;/a&gt; (&lt;strong&gt;2005&lt;/strong&gt;). &lt;em&gt;Sequential Logic&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.oup.com/uk/orc/bin/9780199273133/clements_ch03.pdf&quot; rel=&quot;nofollow&quot;&gt;pdf&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:13:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:13 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Sequential_logic&quot; rel=&quot;nofollow&quot;&gt;Sequential logic from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Counter&quot; rel=&quot;nofollow&quot;&gt;Counter from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Shift_register&quot; rel=&quot;nofollow&quot;&gt;Shift register from Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Linear-feedback_shift_register&quot; rel=&quot;nofollow&quot;&gt;Linear-feedback shift register from Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Cyclic_redundancy_check&quot; rel=&quot;nofollow&quot;&gt;Cyclic redundancy check from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Finite-state_machine&quot; rel=&quot;nofollow&quot;&gt;Finite-state machine from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://web.cecs.pdx.edu/%7Eharry/Relay/index.html&quot; rel=&quot;nofollow&quot;&gt;Harry Porter&#039;s Relay Computer&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#Passport&quot;&gt;Passport&lt;/a&gt; - &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.allmusic.com/album/infinity-machine-mw0000587835&quot; rel=&quot;nofollow&quot;&gt;Infinity Machine&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/YouTube&quot; rel=&quot;nofollow&quot;&gt;YouTube&lt;/a&gt; Video&lt;br /&gt;
1976 lineup: &lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#KlausDoldinger&quot;&gt;Klaus Doldinger&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Curt_Cress&quot; rel=&quot;nofollow&quot;&gt;Curt Cress&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#WolfgangSchmid&quot;&gt;Wolfgang Schmid&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Kristian_Schultze&quot; rel=&quot;nofollow&quot;&gt;Kristian Schultze&lt;/a&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextMediaRule:3:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/custom/24874278?h=0&amp;amp;w=0&amp;quot; class=&amp;quot;WikiMedia WikiMediaCustom&amp;quot; id=&amp;quot;wikitext@@media@@type=&amp;amp;quot;custom&amp;amp;quot; key=&amp;amp;quot;24874278&amp;amp;quot;&amp;quot; title=&amp;quot;Custom Media&amp;quot;/&amp;gt; --&gt;&lt;iframe width=&quot;480&quot; height=&quot;360&quot; src=&quot;//www.youtube.com/embed/_7CKaWqzqSM?rel=0&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;&lt;!-- ws:end:WikiTextMediaRule:3 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:15:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc5&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:15 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:157:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://web.mit.edu/6.111/www/f2005/tutprobs/sequential.html&quot; rel=&quot;nofollow&quot;&gt;Sequential Logic&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:157 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:17:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc6&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:17 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:01:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Sequential Logic&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Sequential Logic&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Sequential_Logic includeBody-Sequential%20Logic includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BCP&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BCP&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 30, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Belle&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Belle&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 18, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/CHEOPS&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;CHEOPS&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 18, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/ChipTest&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;ChipTest&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 19, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Combinatorial+Logic&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Combinatorial Logic&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 6, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Data&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Data&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 26, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Electro-Mechanical&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Electro-Mechanical&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 2, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/FPGA&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;FPGA&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 9, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hardware&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hardware&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 20, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Memory&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Memory&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Process&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Process&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 31, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pseudorandom+number+generator&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pseudorandom number generator&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 11, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Queue&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Queue&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 4, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sequential+Logic&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sequential Logic&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Space-Time+Tradeoff&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Space-Time Tradeoff&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 17, 2015&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:01 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Hardware&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Sherwin Bitboards</title>
      <link>https://chessprogramming.wikispaces.com/Sherwin+Bitboards</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Sherwin+Bitboards</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Sherwin+Bitboards</comments>
      <pubDate>Wed, 20 Mar 2013 12:47:36 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:32:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:32 --&gt;&lt;!-- ws:start:WikiTextTocRule:33: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Bishops&quot;&gt;Bishops&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:33 --&gt;&lt;!-- ws:start:WikiTextTocRule:34: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Rooks&quot;&gt;Rooks&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:34 --&gt;&lt;!-- ws:start:WikiTextTocRule:35: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Results&quot;&gt;Results&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:35 --&gt;&lt;!-- ws:start:WikiTextTocRule:36: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:36 --&gt;&lt;!-- ws:start:WikiTextTocRule:37: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:37 --&gt;&lt;!-- ws:start:WikiTextTocRule:38: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:38 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Board%20Representation&quot;&gt;Board Representation&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Bitboards&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Sliding Piece Attacks&lt;/a&gt; * Sherwin Bitboards&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
The &lt;strong&gt;Sherwin bitboards&lt;/strong&gt; were created by &lt;a class=&quot;wiki_link&quot; href=&quot;/Michael%20Sherwin&quot;&gt;Michael Sherwin&lt;/a&gt; with some help from other people in &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:20:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;amp;t=5587&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;New bitboard move generator&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Michael%20Sherwin&amp;quot;&amp;gt;Michael Sherwin&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;Winboard Forum&amp;lt;/a&amp;gt;, September 14, 2006&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:20 --&gt;. The idea is to generate the attacks of a sliding piece by collecting all occupied squares on its rays for each row. Then use a first lookup table to get an index into a second table that contains the attack bitboards. Most of the hard work is done in the initialization of the tables. Care must be taken with the right order and enumeration of the table indizes. The code below is taken from the chess engine &lt;a class=&quot;wiki_link&quot; href=&quot;/Elephant&quot;&gt;Elephant&lt;/a&gt; and it uses the same &lt;a class=&quot;wiki_link&quot; href=&quot;/Square%20Mapping%20Considerations&quot;&gt;big-endian file-mapping&lt;/a&gt; as the &lt;a class=&quot;wiki_link&quot; href=&quot;/Exploding%20Bitboards&quot;&gt;exploding bitboards&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:22:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Bishops&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:22 --&gt;Bishops&lt;/h1&gt;
 These are the relevant squares for a bishop on d4. We don&#039;t have to look at pieces at the border of the board to decide whether their squares can be attacked or defended.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt; . . . . . . . -&amp;lt;br/&amp;gt; - . . . . . 1 .  giving 1 bit  or 2 different values from row 7&amp;lt;br/&amp;gt; . 1 . . . 1 . .  giving 2 bits or 4 different values from row 6&amp;lt;br/&amp;gt; . . 1 . 1 . . .  giving 2 bits or 4 different values from row 5&amp;lt;br/&amp;gt; . . . B . . . .  giving 0 bits or 0 different values from row 4&amp;lt;br/&amp;gt; . . 1 . 1 . . .  giving 2 bits or 4 different values from row 3&amp;lt;br/&amp;gt; . 1 . . . 1 . .  giving 2 bits or 4 different values from row 2&amp;lt;br/&amp;gt; - . . . . . - .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt; . . . . . . . -
 - . . . . . 1 .  giving 1 bit  or 2 different values from row 7
 . 1 . . . 1 . .  giving 2 bits or 4 different values from row 6
 . . 1 . 1 . . .  giving 2 bits or 4 different values from row 5
 . . . B . . . .  giving 0 bits or 0 different values from row 4
 . . 1 . 1 . . .  giving 2 bits or 4 different values from row 3
 . 1 . . . 1 . .  giving 2 bits or 4 different values from row 2
 - . . . . . - .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;We need an helper array and an initializing function for the rays. This mask covers the inner 6x6 board only.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;Bitboard bishopBits[64];&amp;lt;br/&amp;gt;void initBishopBits()&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    int sq;&amp;lt;br/&amp;gt;    for ( sq = 0; sq &amp;amp;lt; 64; ++sq )&amp;lt;br/&amp;gt;    {&amp;lt;br/&amp;gt;        bishopBits[sq] = 0;&amp;lt;br/&amp;gt;        int i;&amp;lt;br/&amp;gt;        for ( i = sq - 9; i &amp;amp;gt;= 0 &amp;amp;amp;&amp;amp;amp; i % 8 != 7; i -= 9 )&amp;lt;br/&amp;gt;            bishopBits[sq] |= C64(1) &amp;amp;lt;&amp;amp;lt; i;&amp;lt;br/&amp;gt;        for ( i = sq - 7; i &amp;amp;gt;= 0 &amp;amp;amp;&amp;amp;amp; i % 8 != 0; i -= 7 )&amp;lt;br/&amp;gt;            bishopBits[sq] |= C64(1) &amp;amp;lt;&amp;amp;lt; i;&amp;lt;br/&amp;gt;        for ( i = sq + 9; i &amp;amp;lt; 64 &amp;amp;amp;&amp;amp;amp; i % 8 != 0; i += 9 )&amp;lt;br/&amp;gt;            bishopBits[sq] |= C64(1) &amp;amp;lt;&amp;amp;lt; i;&amp;lt;br/&amp;gt;        for ( i = sq + 7; i &amp;amp;lt; 64 &amp;amp;amp;&amp;amp;amp; i % 8 != 7; i += 7 )&amp;lt;br/&amp;gt;            bishopBits[sq] |= C64(1) &amp;amp;lt;&amp;amp;lt; i;&amp;lt;br/&amp;gt;        bishopBits[sq] &amp;amp;amp;= C64(0x007e7e7e7e7e7e00);&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;Bitboard bishopBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; initBishopBits&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;sq &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        bishopBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; i&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            bishopBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            bishopBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            bishopBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            bishopBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        bishopBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x007e7e7e7e7e7e00&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;With the help of a first table we condense the scattered bits to a compact index number. For bits named a to i the value for Bd4 will be:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt; . . . . . . . -&amp;lt;br/&amp;gt; - . . . . . i .  giving 1 bit  or 2 different values from row 7&amp;lt;br/&amp;gt; . g . . . h . .  giving 2 bits or 4 different values from row 6&amp;lt;br/&amp;gt; . . e . f . . .  giving 2 bits or 4 different values from row 5&amp;lt;br/&amp;gt; . . . B . . . .  giving 0 bits or 0 different values from row 4&amp;lt;br/&amp;gt; . . c . d . . .  giving 2 bits or 4 different values from row 3&amp;lt;br/&amp;gt; . a . . . b . .  giving 2 bits or 4 different values from row 2&amp;lt;br/&amp;gt; - . . . . . - .&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;-&amp;amp;gt; 0x0000000ihgfedcba as index. With 2^9 = 512 index values.&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt; . . . . . . . -
 - . . . . . i .  giving 1 bit  or 2 different values from row 7
 . g . . . h . .  giving 2 bits or 4 different values from row 6
 . . e . f . . .  giving 2 bits or 4 different values from row 5
 . . . B . . . .  giving 0 bits or 0 different values from row 4
 . . c . d . . .  giving 2 bits or 4 different values from row 3
 . a . . . b . .  giving 2 bits or 4 different values from row 2
 - . . . . . - .
&amp;nbsp;
-&amp;gt; 0x0000000ihgfedcba as index. With 2^9 = 512 index values.
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;There are 4 squares with 9 bits like Bd4. Other squares need another amount of bits.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;const byte squareBitsB[64] =&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;  6, 5, 5, 5, 5, 5, 5, 6,&amp;lt;br/&amp;gt;  5, 5, 5, 5, 5, 5, 5, 5,&amp;lt;br/&amp;gt;  5, 5, 7, 7, 7, 7, 5, 5,&amp;lt;br/&amp;gt;  5, 5, 7, 9, 9, 7, 5, 5,&amp;lt;br/&amp;gt;  5, 5, 7, 9, 9, 7, 5, 5,&amp;lt;br/&amp;gt;  5, 5, 7, 7, 7, 7, 5, 5,&amp;lt;br/&amp;gt;  5, 5, 5, 5, 5, 5, 5, 5,&amp;lt;br/&amp;gt;  6, 5, 5, 5, 5, 5, 5, 6,&amp;lt;br/&amp;gt;};&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;const byte squareBitsB[64] =
{
  6, 5, 5, 5, 5, 5, 5, 6,
  5, 5, 5, 5, 5, 5, 5, 5,
  5, 5, 7, 7, 7, 7, 5, 5,
  5, 5, 7, 9, 9, 7, 5, 5,
  5, 5, 7, 9, 9, 7, 5, 5,
  5, 5, 7, 7, 7, 7, 5, 5,
  5, 5, 5, 5, 5, 5, 5, 5,
  6, 5, 5, 5, 5, 5, 5, 6,
};&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;Here is how much values of the first table we need. That is also the size of the second table.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt; 4 squares with 9 bits for 512 indices are 2048 indices.&amp;lt;br/&amp;gt;12 squares with 7 bits for 128 indices are 1536 indices.&amp;lt;br/&amp;gt;44 squares with 5 bits for  32 indices are 1408 indices.&amp;lt;br/&amp;gt; 4 squares with 6 bits for  64 indices are  256 indices.&amp;lt;br/&amp;gt;                                     Total 5248 indices.&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt; 4 squares with 9 bits for 512 indices are 2048 indices.
12 squares with 7 bits for 128 indices are 1536 indices.
44 squares with 5 bits for  32 indices are 1408 indices.
 4 squares with 6 bits for  64 indices are  256 indices.
                                     Total 5248 indices.&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;This is the layout of the first big table with index-bits for each square and all rows. The indices are in this order:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;0000999999999 4 times 9 bit&amp;lt;br/&amp;gt;0001999999999&amp;lt;br/&amp;gt;0010999999999&amp;lt;br/&amp;gt;0011999999999&amp;lt;br/&amp;gt;0100007777777 12 times 7 bit&amp;lt;br/&amp;gt;01....7777777&amp;lt;br/&amp;gt;0110117777777&amp;lt;br/&amp;gt;0111000666666 4 times 6 bit&amp;lt;br/&amp;gt;0111001666666&amp;lt;br/&amp;gt;0111010666666&amp;lt;br/&amp;gt;0111011666666&amp;lt;br/&amp;gt;0111100055555 44 times 5 bit&amp;lt;br/&amp;gt;........55555&amp;lt;br/&amp;gt;1010001155555&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;0000999999999 4 times 9 bit
0001999999999
0010999999999
0011999999999
0100007777777 12 times 7 bit
01....7777777
0110117777777
0111000666666 4 times 6 bit
0111001666666
0111010666666
0111011666666
0111100055555 44 times 5 bit
........55555
1010001155555&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;And here is the initializing function.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;short int bishopRows[64][6][64];&amp;lt;br/&amp;gt;void initBishopRows()&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    int baseIndex = 0;&amp;lt;br/&amp;gt;    for ( int bits = 9; bits &amp;amp;gt;= 5; &amp;amp;#45;-bits )&amp;lt;br/&amp;gt;    {&amp;lt;br/&amp;gt;        for ( int sq = 0; sq &amp;amp;lt; 64; ++sq )&amp;lt;br/&amp;gt;        {&amp;lt;br/&amp;gt;            if ( squareBitsB[sq] != bits )&amp;lt;br/&amp;gt;                continue;&amp;lt;br/&amp;gt;            Bitboard bb = bishopBits[sq];&amp;lt;br/&amp;gt;            bb &amp;amp;gt;&amp;amp;gt;= 9;&amp;lt;br/&amp;gt;            int shift = 0;&amp;lt;br/&amp;gt;            for ( int row = 0; row &amp;amp;lt; 6; ++row )&amp;lt;br/&amp;gt;            {&amp;lt;br/&amp;gt;                int p = (bb &amp;amp;gt;&amp;amp;gt; (row * 8)) &amp;amp;amp; 0x3f;&amp;lt;br/&amp;gt;                for ( int pattern = 0; pattern &amp;amp;lt; 64; ++pattern )&amp;lt;br/&amp;gt;                {&amp;lt;br/&amp;gt;                    int index = 0;&amp;lt;br/&amp;gt;                    int s = shift;&amp;lt;br/&amp;gt;                    for ( int i = 0; i &amp;amp;lt; 6; ++i )&amp;lt;br/&amp;gt;                    {&amp;lt;br/&amp;gt;                        if ( p &amp;amp;amp; (1 &amp;amp;lt;&amp;amp;lt; i) )&amp;lt;br/&amp;gt;                        {&amp;lt;br/&amp;gt;                            index |= ( (pattern &amp;amp;amp; (1 &amp;amp;lt;&amp;amp;lt; i)) ? (1 &amp;amp;lt;&amp;amp;lt; s) : 0 );&amp;lt;br/&amp;gt;                            s++;&amp;lt;br/&amp;gt;                            if ( pattern == 63 )&amp;lt;br/&amp;gt;                                shift++;&amp;lt;br/&amp;gt;                        }&amp;lt;br/&amp;gt;                    }&amp;lt;br/&amp;gt;                    bishopRows[sq][row][pattern] = baseIndex + index;&amp;lt;br/&amp;gt;                }&amp;lt;br/&amp;gt;            }&amp;lt;br/&amp;gt;            baseIndex += (1 &amp;amp;lt;&amp;amp;lt; bits);&amp;lt;br/&amp;gt;        }&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;short&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bishopRows&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; initBishopRows&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; baseIndex &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bits &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bits &lt;span class=&quot;sy1&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;--&lt;/span&gt;bits &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;sq &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; squareBitsB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bits &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;continue&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            Bitboard bb &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bishopBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; shift &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; row &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; row &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;row &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; p &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;row &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x3f&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; pattern &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; pattern &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;pattern &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                    &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; index &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                    &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; s &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; shift&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;i &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; p &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                        &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                            index &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;pattern &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                            s&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                            &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; pattern &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;63&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                                shift&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
                    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
                    bishopRows&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;row&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;pattern&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; baseIndex &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; index&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
            baseIndex &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; bits&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;A second table with 5248 entries can hold all bishop attack bitboards. This table must also be initialized.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;Bitboard bishopAttackTable[5248];&amp;lt;br/&amp;gt;void initBishopAttacks()&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    int baseIndex = 0;&amp;lt;br/&amp;gt;    for ( int bits = 9; bits &amp;amp;gt;= 5; &amp;amp;#45;-bits )&amp;lt;br/&amp;gt;    {&amp;lt;br/&amp;gt;        for ( int sq = 0; sq &amp;amp;lt; 64; ++sq )&amp;lt;br/&amp;gt;        {&amp;lt;br/&amp;gt;            if ( squareBitsB[sq] != bits )&amp;lt;br/&amp;gt;                continue;&amp;lt;br/&amp;gt;            Bitboard bb = bishopBits[sq];&amp;lt;br/&amp;gt;            for ( int index = 0; index &amp;amp;lt; (1 &amp;amp;lt;&amp;amp;lt; bits); ++ index )&amp;lt;br/&amp;gt;            {&amp;lt;br/&amp;gt;                Bitboard occ = 0;&amp;lt;br/&amp;gt;                int i = index;&amp;lt;br/&amp;gt;                for ( int rsq = 0; rsq &amp;amp;lt; 64; ++rsq )&amp;lt;br/&amp;gt;                {&amp;lt;br/&amp;gt;                    if ( bb.test_bit( rsq ) )&amp;lt;br/&amp;gt;                    {&amp;lt;br/&amp;gt;                        if ( i &amp;amp;amp; 1 )&amp;lt;br/&amp;gt;                            occ.set_bit( rsq );&amp;lt;br/&amp;gt;                        i &amp;amp;gt;&amp;amp;gt;= 1;&amp;lt;br/&amp;gt;                    }&amp;lt;br/&amp;gt;                }&amp;lt;br/&amp;gt;                Bitboard att = 0;&amp;lt;br/&amp;gt;                int j;&amp;lt;br/&amp;gt;                for ( j = sq + 9; j &amp;amp;lt; 64 &amp;amp;amp;&amp;amp;amp; (j &amp;amp;amp; 7) != 0; j += 9 )&amp;lt;br/&amp;gt;                {&amp;lt;br/&amp;gt;                    att.set_bit( j );&amp;lt;br/&amp;gt;                    if ( occ.test_bit( j ) )&amp;lt;br/&amp;gt;                        break;&amp;lt;br/&amp;gt;                }&amp;lt;br/&amp;gt;                for ( j = sq + 7; j &amp;amp;lt; 64 &amp;amp;amp;&amp;amp;amp; (j &amp;amp;amp; 7) != 7; j += 7 )&amp;lt;br/&amp;gt;                {&amp;lt;br/&amp;gt;                    att.set_bit( j );&amp;lt;br/&amp;gt;                    if ( occ.test_bit( j ) )&amp;lt;br/&amp;gt;                        break;&amp;lt;br/&amp;gt;                }&amp;lt;br/&amp;gt;                for ( j = sq - 9; j &amp;amp;gt;= 0 &amp;amp;amp;&amp;amp;amp; (j &amp;amp;amp; 7) != 7; j -= 9 )&amp;lt;br/&amp;gt;                {&amp;lt;br/&amp;gt;                    att.set_bit( j );&amp;lt;br/&amp;gt;                    if ( occ.test_bit( j ) )&amp;lt;br/&amp;gt;                        break;&amp;lt;br/&amp;gt;                }&amp;lt;br/&amp;gt;                for ( j = sq - 7; j &amp;amp;gt;= 0 &amp;amp;amp;&amp;amp;amp; (j &amp;amp;amp; 7) != 0; j -= 7 )&amp;lt;br/&amp;gt;                {&amp;lt;br/&amp;gt;                    att.set_bit( j );&amp;lt;br/&amp;gt;                    if ( occ.test_bit( j ) )&amp;lt;br/&amp;gt;                        break;&amp;lt;br/&amp;gt;                }&amp;lt;br/&amp;gt;                bishopAttackTable[baseIndex + index] = att;&amp;lt;br/&amp;gt;            }&amp;lt;br/&amp;gt;            baseIndex += (1 &amp;amp;lt;&amp;amp;lt; bits);&amp;lt;br/&amp;gt;        }&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;Bitboard bishopAttackTable&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;5248&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; initBishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; baseIndex &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bits &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bits &lt;span class=&quot;sy1&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;--&lt;/span&gt;bits &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;sq &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; squareBitsB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bits &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;continue&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            Bitboard bb &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bishopBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; index &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; index &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; bits&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt; index &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                Bitboard occ &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; index&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; rsq &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; rsq &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;rsq &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; bb.&lt;span class=&quot;me1&quot;&gt;test_bit&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; rsq &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                            occ.&lt;span class=&quot;me1&quot;&gt;set_bit&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; rsq &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                        i &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
                Bitboard att &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; j&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; j &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;j &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; j &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                    att.&lt;span class=&quot;me1&quot;&gt;set_bit&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; occ.&lt;span class=&quot;me1&quot;&gt;test_bit&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; j &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;j &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; j &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                    att.&lt;span class=&quot;me1&quot;&gt;set_bit&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; occ.&lt;span class=&quot;me1&quot;&gt;test_bit&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; j &lt;span class=&quot;sy1&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;j &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; j &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                    att.&lt;span class=&quot;me1&quot;&gt;set_bit&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; occ.&lt;span class=&quot;me1&quot;&gt;test_bit&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; j &lt;span class=&quot;sy1&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;j &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; j &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                    att.&lt;span class=&quot;me1&quot;&gt;set_bit&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; occ.&lt;span class=&quot;me1&quot;&gt;test_bit&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
                bishopAttackTable&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;baseIndex &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; index&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; att&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
            baseIndex &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; bits&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;Ok, here comes the function to get the bishop attack bitboard for a square and occupied bitboard.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;Bitboard bishopAttacks( int sq, Bitboard occ )&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    // The remaining blocking pieces in the X-rays&amp;lt;br/&amp;gt;    occ  &amp;amp;amp;= bishopBits[sq];&amp;lt;br/&amp;gt;    occ &amp;amp;gt;&amp;amp;gt;= 9;&amp;lt;br/&amp;gt;    // Since every square has its set of row values the six row lookups&amp;lt;br/&amp;gt;    // simply map any blockers to specific bits that when ored together&amp;lt;br/&amp;gt;    // gives an offset in the bishop attack table.&amp;lt;br/&amp;gt;    short int *bRows = &amp;amp;amp;bishopRows[sq][0][0];&amp;lt;br/&amp;gt;    int index = (bRows +   0)[(occ &amp;amp;gt;&amp;amp;gt;  0) &amp;amp;amp; 0x3f]  // row 2&amp;lt;br/&amp;gt;              | (bRows +  64)[(occ &amp;amp;gt;&amp;amp;gt;  8) &amp;amp;amp; 0x3f]  // row 3&amp;lt;br/&amp;gt;              | (bRows + 128)[(occ &amp;amp;gt;&amp;amp;gt; 16) &amp;amp;amp; 0x3f]  // row 4&amp;lt;br/&amp;gt;              | (bRows + 192)[(occ &amp;amp;gt;&amp;amp;gt; 24) &amp;amp;amp; 0x3f]  // row 5&amp;lt;br/&amp;gt;              | (bRows + 256)[(occ &amp;amp;gt;&amp;amp;gt; 32) &amp;amp;amp; 0x3f]  // row 6&amp;lt;br/&amp;gt;              | (bRows + 320)[(occ &amp;amp;gt;&amp;amp;gt; 40) &amp;amp;amp; 0x3f]; // row 7&amp;lt;br/&amp;gt;    return bishopAttackTable[index];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;Bitboard bishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq, Bitboard occ &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// The remaining blocking pieces in the X-rays&lt;/span&gt;
    occ  &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bishopBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// Since every square has its set of row values the six row lookups&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// simply map any blockers to specific bits that when ored together&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// gives an offset in the bishop attack table.&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;short&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;bRows &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;bishopRows&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; index &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;   &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x3f&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 2&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x3f&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 3&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;128&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x3f&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 4&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;192&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;24&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x3f&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 5&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;256&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x3f&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 6&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;320&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x3f&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// row 7&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; bishopAttackTable&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;index&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;Perhaps you should look at this function first to understand the algorithm.&lt;br /&gt;
&lt;br /&gt;
After the creation of the lookup tables which is only done once the often used bishopAttacks() function is rather easy and performant. And it is branchless.&lt;br /&gt;
&lt;br /&gt;
There is a possible modification of this function that uses unions rather than &amp;gt;&amp;gt; and &amp;amp;. Some people believe that is faster. But it depends on big and little endianess.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:9:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;#if BIG_ENDIAN() &amp;amp;amp;&amp;amp;amp; !LITTLE_ENDIAN()&amp;lt;br/&amp;gt;// Big end first means row 8 is first byte with my square encoding.&amp;lt;br/&amp;gt;struct BBBytes&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    unsigned char row8;&amp;lt;br/&amp;gt;    unsigned char row7;&amp;lt;br/&amp;gt;    unsigned char row6;&amp;lt;br/&amp;gt;    unsigned char row5;&amp;lt;br/&amp;gt;    unsigned char row4;&amp;lt;br/&amp;gt;    unsigned char row3;&amp;lt;br/&amp;gt;    unsigned char row2;&amp;lt;br/&amp;gt;    unsigned char row1;&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;#elif LITTLE_ENDIAN() &amp;amp;amp;&amp;amp;amp; !BIG_ENDIAN()&amp;lt;br/&amp;gt;// Little end first means row 1 is first byte with my square encoding.&amp;lt;br/&amp;gt;struct BBBytes&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    unsigned char row1;&amp;lt;br/&amp;gt;    unsigned char row2;&amp;lt;br/&amp;gt;    unsigned char row3;&amp;lt;br/&amp;gt;    unsigned char row4;&amp;lt;br/&amp;gt;    unsigned char row5;&amp;lt;br/&amp;gt;    unsigned char row6;&amp;lt;br/&amp;gt;    unsigned char row7;&amp;lt;br/&amp;gt;    unsigned char row8;&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;#else&amp;lt;br/&amp;gt;    #error big little endian&amp;lt;br/&amp;gt;#endif&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;union BBUnion&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    Bits64   bb;    // typedef uint64 Bits64;&amp;lt;br/&amp;gt;    BBBytes  bbb;&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Bitboard bishopAttacks( int sq, Bitboard occ )&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    // The remaining blocking pieces in the X-rays&amp;lt;br/&amp;gt;    occ  &amp;amp;amp;= bishopBits[sq];&amp;lt;br/&amp;gt;    occ &amp;amp;gt;&amp;amp;gt;= 1;&amp;lt;br/&amp;gt;    BBUnion occu;&amp;lt;br/&amp;gt;    occu.bb = occ;&amp;lt;br/&amp;gt;    // Since every square has its set of row values the six row lookups&amp;lt;br/&amp;gt;    // simply map any blockers to specific bits that when ored together&amp;lt;br/&amp;gt;    // gives an offset in the bishop attack table.&amp;lt;br/&amp;gt;    short int *bRows = &amp;amp;amp;bishopRows[sq][0][0];&amp;lt;br/&amp;gt;    int index = (bRows +   0)[occu.bbb.row2]  // row 2&amp;lt;br/&amp;gt;              | (bRows +  64)[occu.bbb.row3]  // row 3&amp;lt;br/&amp;gt;              | (bRows + 128)[occu.bbb.row4]  // row 4&amp;lt;br/&amp;gt;              | (bRows + 192)[occu.bbb.row5]  // row 5&amp;lt;br/&amp;gt;              | (bRows + 256)[occu.bbb.row6]  // row 6&amp;lt;br/&amp;gt;              | (bRows + 320)[occu.bbb.row7]; // row 7&amp;lt;br/&amp;gt;    return bishopAttackTable[index];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;co2&quot;&gt;#if BIG_ENDIAN() &amp;amp;&amp;amp; !LITTLE_ENDIAN()&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// Big end first means row 8 is first byte with my square encoding.&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;struct&lt;/span&gt; BBBytes
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; row8&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; row7&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; row6&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; row5&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; row4&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; row3&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; row2&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; row1&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;co2&quot;&gt;#elif LITTLE_ENDIAN() &amp;amp;&amp;amp; !BIG_ENDIAN()&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// Little end first means row 1 is first byte with my square encoding.&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;struct&lt;/span&gt; BBBytes
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; row1&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; row2&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; row3&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; row4&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; row5&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; row6&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; row7&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; row8&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;co2&quot;&gt;#else&lt;/span&gt;
    &lt;span class=&quot;co2&quot;&gt;#error big little endian&lt;/span&gt;
&lt;span class=&quot;co2&quot;&gt;#endif&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;union&lt;/span&gt; BBUnion
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    Bits64   bb&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;// typedef uint64 Bits64;&lt;/span&gt;
    BBBytes  bbb&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
Bitboard bishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq, Bitboard occ &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// The remaining blocking pieces in the X-rays&lt;/span&gt;
    occ  &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bishopBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    BBUnion occu&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    occu.&lt;span class=&quot;me1&quot;&gt;bb&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; occ&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// Since every square has its set of row values the six row lookups&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// simply map any blockers to specific bits that when ored together&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// gives an offset in the bishop attack table.&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;short&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;bRows &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;bishopRows&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; index &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;   &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occu.&lt;span class=&quot;me1&quot;&gt;bbb&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;row2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 2&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occu.&lt;span class=&quot;me1&quot;&gt;bbb&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;row3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 3&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;128&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occu.&lt;span class=&quot;me1&quot;&gt;bbb&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;row4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 4&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;192&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occu.&lt;span class=&quot;me1&quot;&gt;bbb&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;row5&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 5&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;256&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occu.&lt;span class=&quot;me1&quot;&gt;bbb&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;row6&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 6&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;320&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occu.&lt;span class=&quot;me1&quot;&gt;bbb&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;row7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// row 7&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; bishopAttackTable&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;index&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:9 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:24:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Rooks&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:24 --&gt;Rooks&lt;/h1&gt;
 Rooks are mostly treated like the bishops. It starts with their rays.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:10:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;Bitboard rookBits[64];&amp;lt;br/&amp;gt;void initRookBits()&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    int sq;&amp;lt;br/&amp;gt;    for ( sq = 0; sq &amp;amp;lt; 64; ++sq )&amp;lt;br/&amp;gt;    {&amp;lt;br/&amp;gt;        rookBits[sq] = 0;&amp;lt;br/&amp;gt;        int i;&amp;lt;br/&amp;gt;        for ( i = sq - 1; i &amp;amp;gt;= 0 &amp;amp;amp;&amp;amp;amp; i % 8 != 7; &amp;amp;#45;-i )&amp;lt;br/&amp;gt;            rookBits[sq] |= C64(1) &amp;amp;lt;&amp;amp;lt; i;&amp;lt;br/&amp;gt;        for ( i = sq - 8; i &amp;amp;gt;= 0; i -= 8 )&amp;lt;br/&amp;gt;            rookBits[sq] |= C64(1) &amp;amp;lt;&amp;amp;lt; i;&amp;lt;br/&amp;gt;        for ( i = sq + 1; i &amp;amp;lt; 64 &amp;amp;amp;&amp;amp;amp; i % 8 != 0; ++i )&amp;lt;br/&amp;gt;            rookBits[sq] |= C64(1) &amp;amp;lt;&amp;amp;lt; i;&amp;lt;br/&amp;gt;        for ( i = sq + 8; i &amp;amp;lt; 64; i += 8 )&amp;lt;br/&amp;gt;            rookBits[sq] |= C64(1) &amp;amp;lt;&amp;amp;lt; i;&amp;lt;br/&amp;gt;        if ( (sq &amp;amp;amp; 7) != 7 )&amp;lt;br/&amp;gt;            rookBits[sq] &amp;amp;amp;= C64(0x7f7f7f7f7f7f7f7f);&amp;lt;br/&amp;gt;        if ( (sq &amp;amp;amp; 7) != 0 )&amp;lt;br/&amp;gt;            rookBits[sq] &amp;amp;amp;= C64(0xfefefefefefefefe);&amp;lt;br/&amp;gt;        if ( (sq / 8) != 7 )&amp;lt;br/&amp;gt;            rookBits[sq] &amp;amp;amp;= C64(0x00ffffffffffffff);&amp;lt;br/&amp;gt;        if ( (sq / 8) != 0 )&amp;lt;br/&amp;gt;            rookBits[sq] &amp;amp;amp;= C64(0xffffffffffffff00);&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;Bitboard rookBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; initRookBits&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;sq &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        rookBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; i&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;--&lt;/span&gt;i &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            rookBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            rookBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;i &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            rookBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            rookBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            rookBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x7f7f7f7f7f7f7f7f&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            rookBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0xfefefefefefefefe&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq &lt;span class=&quot;sy2&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            rookBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x00ffffffffffffff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;sq &lt;span class=&quot;sy2&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            rookBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0xffffffffffffff00&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:10 --&gt;There are 36 squares with 10 bits like Rd4. Other squares need another amount of bits.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:11:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;const byte squareBitsR[64] =&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;  12, 11, 11, 11, 11, 11, 11, 12,&amp;lt;br/&amp;gt;  11, 10, 10, 10, 10, 10, 10, 11,&amp;lt;br/&amp;gt;  11, 10, 10, 10, 10, 10, 10, 11,&amp;lt;br/&amp;gt;  11, 10, 10, 10, 10, 10, 10, 11,&amp;lt;br/&amp;gt;  11, 10, 10, 10, 10, 10, 10, 11,&amp;lt;br/&amp;gt;  11, 10, 10, 10, 10, 10, 10, 11,&amp;lt;br/&amp;gt;  11, 10, 10, 10, 10, 10, 10, 11,&amp;lt;br/&amp;gt;  12, 11, 11, 11, 11, 11, 11, 12,&amp;lt;br/&amp;gt;};&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;const byte squareBitsR[64] =
{
  12, 11, 11, 11, 11, 11, 11, 12,
  11, 10, 10, 10, 10, 10, 10, 11,
  11, 10, 10, 10, 10, 10, 10, 11,
  11, 10, 10, 10, 10, 10, 10, 11,
  11, 10, 10, 10, 10, 10, 10, 11,
  11, 10, 10, 10, 10, 10, 10, 11,
  11, 10, 10, 10, 10, 10, 10, 11,
  12, 11, 11, 11, 11, 11, 11, 12,
};&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:11 --&gt;This is the layout of the first big table with index-bits for each square and all rows. The indices are in this order:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:12:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;00000cccccccccccc 4 times 12 bit&amp;lt;br/&amp;gt;00001cccccccccccc&amp;lt;br/&amp;gt;00010cccccccccccc&amp;lt;br/&amp;gt;00011cccccccccccc&amp;lt;br/&amp;gt;001000bbbbbbbbbbb 24 times 11 bit&amp;lt;br/&amp;gt;0.....bbbbbbbbbbb&amp;lt;br/&amp;gt;100111bbbbbbbbbbb&amp;lt;br/&amp;gt;1010000aaaaaaaaaa 36 times 10 bit&amp;lt;br/&amp;gt;.......aaaaaaaaaa&amp;lt;br/&amp;gt;1110011aaaaaaaaaa&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;00000cccccccccccc 4 times 12 bit
00001cccccccccccc
00010cccccccccccc
00011cccccccccccc
001000bbbbbbbbbbb 24 times 11 bit
0.....bbbbbbbbbbb
100111bbbbbbbbbbb
1010000aaaaaaaaaa 36 times 10 bit
.......aaaaaaaaaa
1110011aaaaaaaaaa&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:12 --&gt;For rooks we need a bigger second table. It has 102400 entries. This makes even the first table bigger because it can not use 2 byte short integer values. And the last dimension of the first table has to cover all 8 bits of a row. This is because rooks on file a or h have rays along the outside files.&lt;br /&gt;
&lt;br /&gt;
Here is the initializing function.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:13:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;int rookRows[64][8][256];&amp;lt;br/&amp;gt;void initRookRows()&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    int baseIndex = 0;&amp;lt;br/&amp;gt;    for ( int bits = 12; bits &amp;amp;gt;= 10; &amp;amp;#45;-bits )&amp;lt;br/&amp;gt;    {&amp;lt;br/&amp;gt;        for ( int sq = 0; sq &amp;amp;lt; 64; ++sq )&amp;lt;br/&amp;gt;        {&amp;lt;br/&amp;gt;            if ( squareBitsR[sq] != bits )&amp;lt;br/&amp;gt;                continue;&amp;lt;br/&amp;gt;            Bitboard bb = rookBits[sq];&amp;lt;br/&amp;gt;            int shift = 0;&amp;lt;br/&amp;gt;            for ( int row = 0; row &amp;amp;lt; 8; ++row )&amp;lt;br/&amp;gt;            {&amp;lt;br/&amp;gt;                int p = (bb &amp;amp;gt;&amp;amp;gt; (row * 8)) &amp;amp;amp; 0xff;&amp;lt;br/&amp;gt;                for ( int pattern = 0; pattern &amp;amp;lt; 256; ++pattern )&amp;lt;br/&amp;gt;                {&amp;lt;br/&amp;gt;                    int index = 0;&amp;lt;br/&amp;gt;                    int s = shift;&amp;lt;br/&amp;gt;                    for ( int i = 0; i &amp;amp;lt; 8; ++i )&amp;lt;br/&amp;gt;                    {&amp;lt;br/&amp;gt;                        if ( p &amp;amp;amp; (1 &amp;amp;lt;&amp;amp;lt; i) )&amp;lt;br/&amp;gt;                        {&amp;lt;br/&amp;gt;                            index |= ( (pattern &amp;amp;amp; (1 &amp;amp;lt;&amp;amp;lt; i)) ? (1 &amp;amp;lt;&amp;amp;lt; s) : 0 );&amp;lt;br/&amp;gt;                            s++;&amp;lt;br/&amp;gt;                            if ( pattern == 255 )&amp;lt;br/&amp;gt;                                shift++;&amp;lt;br/&amp;gt;                        }&amp;lt;br/&amp;gt;                    }&amp;lt;br/&amp;gt;                    rookRows[sq][row][pattern] = baseIndex + index;&amp;lt;br/&amp;gt;                    //logf &amp;amp;lt;&amp;amp;lt; &amp;amp;quot;rookRows &amp;amp;quot; &amp;amp;lt;&amp;amp;lt; sq &amp;amp;lt;&amp;amp;lt; &amp;amp;quot; &amp;amp;quot; &amp;amp;lt;&amp;amp;lt; row &amp;amp;lt;&amp;amp;lt; &amp;amp;quot; &amp;amp;quot; &amp;amp;lt;&amp;amp;lt; pattern &amp;amp;lt;&amp;amp;lt; &amp;amp;quot; : &amp;amp;quot;;&amp;lt;br/&amp;gt;                    //logf &amp;amp;lt;&amp;amp;lt; rookRows[sq][row][pattern] &amp;amp;lt;&amp;amp;lt; endl;&amp;lt;br/&amp;gt;                }&amp;lt;br/&amp;gt;            }&amp;lt;br/&amp;gt;            baseIndex += (1 &amp;amp;lt;&amp;amp;lt; bits);&amp;lt;br/&amp;gt;        }&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; rookRows&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;256&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; initRookRows&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; baseIndex &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bits &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bits &lt;span class=&quot;sy1&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;--&lt;/span&gt;bits &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;sq &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; squareBitsR&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bits &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;continue&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            Bitboard bb &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; rookBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; shift &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; row &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; row &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;row &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; p &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;row &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xff&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; pattern &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; pattern &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;256&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;pattern &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                    &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; index &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                    &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; s &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; shift&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;i &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; p &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                        &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                            index &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;pattern &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                            s&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                            &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; pattern &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;255&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                                shift&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
                    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
                    rookRows&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;row&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;pattern&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; baseIndex &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; index&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                    &lt;span class=&quot;co1&quot;&gt;//logf &amp;lt;&amp;lt; &amp;quot;rookRows &amp;quot; &amp;lt;&amp;lt; sq &amp;lt;&amp;lt; &amp;quot; &amp;quot; &amp;lt;&amp;lt; row &amp;lt;&amp;lt; &amp;quot; &amp;quot; &amp;lt;&amp;lt; pattern &amp;lt;&amp;lt; &amp;quot; : &amp;quot;;&lt;/span&gt;
                    &lt;span class=&quot;co1&quot;&gt;//logf &amp;lt;&amp;lt; rookRows[sq][row][pattern] &amp;lt;&amp;lt; endl;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
            baseIndex &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; bits&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:13 --&gt;A second table with 102400 entries can hold all rook attack bitboards. This table must also be initialized.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:14:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;Bitboard rookAttackTable[102400];&amp;lt;br/&amp;gt;void initRookAttacks()&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    int baseIndex = 0;&amp;lt;br/&amp;gt;    for ( int bits = 12; bits &amp;amp;gt;= 10; &amp;amp;#45;-bits )&amp;lt;br/&amp;gt;    {&amp;lt;br/&amp;gt;        for ( int sq = 0; sq &amp;amp;lt; 64; ++sq )&amp;lt;br/&amp;gt;        {&amp;lt;br/&amp;gt;            if ( squareBitsR[sq] != bits )&amp;lt;br/&amp;gt;                continue;&amp;lt;br/&amp;gt;            Bitboard bb = rookBits[sq];&amp;lt;br/&amp;gt;            for ( int index = 0; index &amp;amp;lt; (1 &amp;amp;lt;&amp;amp;lt; bits); ++ index )&amp;lt;br/&amp;gt;            {&amp;lt;br/&amp;gt;                Bitboard occ = 0;&amp;lt;br/&amp;gt;                int i = index;&amp;lt;br/&amp;gt;                for ( int rsq = 0; rsq &amp;amp;lt; 64; ++rsq )&amp;lt;br/&amp;gt;                {&amp;lt;br/&amp;gt;                    if ( bb.test_bit( rsq ) )&amp;lt;br/&amp;gt;                    {&amp;lt;br/&amp;gt;                        if ( i &amp;amp;amp; 1 )&amp;lt;br/&amp;gt;                            occ.set_bit( rsq );&amp;lt;br/&amp;gt;                        i &amp;amp;gt;&amp;amp;gt;= 1;&amp;lt;br/&amp;gt;                    }&amp;lt;br/&amp;gt;                }&amp;lt;br/&amp;gt;                Bitboard att = 0;&amp;lt;br/&amp;gt;                int j;&amp;lt;br/&amp;gt;                for ( j = sq + 1; j &amp;amp;lt; 64 &amp;amp;amp;&amp;amp;amp; (j &amp;amp;amp; 7) != 0; ++j )&amp;lt;br/&amp;gt;                {&amp;lt;br/&amp;gt;                    att.set_bit( j );&amp;lt;br/&amp;gt;                    if ( occ.test_bit( j ) )&amp;lt;br/&amp;gt;                        break;&amp;lt;br/&amp;gt;                }&amp;lt;br/&amp;gt;                for ( j = sq + 8; j &amp;amp;lt; 64; j += 8 )&amp;lt;br/&amp;gt;                {&amp;lt;br/&amp;gt;                    att.set_bit( j );&amp;lt;br/&amp;gt;                    if ( occ.test_bit( j ) )&amp;lt;br/&amp;gt;                        break;&amp;lt;br/&amp;gt;                }&amp;lt;br/&amp;gt;                for ( j = sq - 1; j &amp;amp;gt;= 0 &amp;amp;amp;&amp;amp;amp; (j &amp;amp;amp; 7) != 7; &amp;amp;#45;-j )&amp;lt;br/&amp;gt;                {&amp;lt;br/&amp;gt;                    att.set_bit( j );&amp;lt;br/&amp;gt;                    if ( occ.test_bit( j ) )&amp;lt;br/&amp;gt;                        break;&amp;lt;br/&amp;gt;                }&amp;lt;br/&amp;gt;                for ( j = sq - 8; j &amp;amp;gt;= 0; j -= 8 )&amp;lt;br/&amp;gt;                {&amp;lt;br/&amp;gt;                    att.set_bit( j );&amp;lt;br/&amp;gt;                    if ( occ.test_bit( j ) )&amp;lt;br/&amp;gt;                        break;&amp;lt;br/&amp;gt;                }&amp;lt;br/&amp;gt;                rookAttackTable[baseIndex + index] = att;&amp;lt;br/&amp;gt;            }&amp;lt;br/&amp;gt;            baseIndex += (1 &amp;amp;lt;&amp;amp;lt; bits);&amp;lt;br/&amp;gt;        }&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;Bitboard rookAttackTable&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;102400&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; initRookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; baseIndex &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bits &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bits &lt;span class=&quot;sy1&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;--&lt;/span&gt;bits &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;sq &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; squareBitsR&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bits &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;continue&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            Bitboard bb &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; rookBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; index &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; index &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; bits&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt; index &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                Bitboard occ &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; index&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; rsq &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; rsq &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;rsq &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; bb.&lt;span class=&quot;me1&quot;&gt;test_bit&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; rsq &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                            occ.&lt;span class=&quot;me1&quot;&gt;set_bit&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; rsq &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                        i &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
                Bitboard att &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; j&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; j &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;j &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;j &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                    att.&lt;span class=&quot;me1&quot;&gt;set_bit&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; occ.&lt;span class=&quot;me1&quot;&gt;test_bit&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; j &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; j &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                    att.&lt;span class=&quot;me1&quot;&gt;set_bit&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; occ.&lt;span class=&quot;me1&quot;&gt;test_bit&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; j &lt;span class=&quot;sy1&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;j &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;--&lt;/span&gt;j &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                    att.&lt;span class=&quot;me1&quot;&gt;set_bit&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; occ.&lt;span class=&quot;me1&quot;&gt;test_bit&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
                &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; sq &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; j &lt;span class=&quot;sy1&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; j &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                    att.&lt;span class=&quot;me1&quot;&gt;set_bit&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; occ.&lt;span class=&quot;me1&quot;&gt;test_bit&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; j &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                        &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
                rookAttackTable&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;baseIndex &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; index&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; att&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
            baseIndex &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; bits&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:14 --&gt;Ok, here comes the function to get the bishop attack bitboard for a square and occupied bitboard.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:15:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;Bitboard rookAttacks( int sq, Bitboard occ )&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    // The remaining blocking pieces in the +-rays&amp;lt;br/&amp;gt;    occ &amp;amp;amp;= rookBits[sq];&amp;lt;br/&amp;gt;    // Since every square has its set of row values the six row lookups&amp;lt;br/&amp;gt;    // simply map any blockers to specific bits that when ored together&amp;lt;br/&amp;gt;    // gives an offset in the bishop attack table.&amp;lt;br/&amp;gt;    int *rRows = &amp;amp;amp;rookRows[sq][0][0];&amp;lt;br/&amp;gt;    int index = (rRows +    0)[(occ &amp;amp;gt;&amp;amp;gt;  0) &amp;amp;amp; 0xff]  // row 1&amp;lt;br/&amp;gt;              | (rRows +  256)[(occ &amp;amp;gt;&amp;amp;gt;  8) &amp;amp;amp; 0xff]  // row 2&amp;lt;br/&amp;gt;              | (rRows +  512)[(occ &amp;amp;gt;&amp;amp;gt; 16) &amp;amp;amp; 0xff]  // row 3&amp;lt;br/&amp;gt;              | (rRows +  768)[(occ &amp;amp;gt;&amp;amp;gt; 24) &amp;amp;amp; 0xff]  // row 4&amp;lt;br/&amp;gt;              | (rRows + 1024)[(occ &amp;amp;gt;&amp;amp;gt; 32) &amp;amp;amp; 0xff]  // row 5&amp;lt;br/&amp;gt;              | (rRows + 1280)[(occ &amp;amp;gt;&amp;amp;gt; 40) &amp;amp;amp; 0xff]  // row 6&amp;lt;br/&amp;gt;              | (rRows + 1536)[(occ &amp;amp;gt;&amp;amp;gt; 48) &amp;amp;amp; 0xff]  // row 7&amp;lt;br/&amp;gt;              | (rRows + 1792)[(occ &amp;amp;gt;&amp;amp;gt; 56) &amp;amp;amp; 0xff]; // row 8&amp;lt;br/&amp;gt;    return rookAttackTable[index];&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;Bitboard rookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq, Bitboard occ &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// The remaining blocking pieces in the +-rays&lt;/span&gt;
    occ &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; rookBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// Since every square has its set of row values the six row lookups&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// simply map any blockers to specific bits that when ored together&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// gives an offset in the bishop attack table.&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;rRows &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;rookRows&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; index &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;rRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;    &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 1&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;rRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;256&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 2&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;rRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;512&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 3&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;rRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;768&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;24&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 4&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;rRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1024&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 5&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;rRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1280&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 6&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;rRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1536&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;48&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 7&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;rRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1792&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;56&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// row 8&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; rookAttackTable&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;index&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:15 --&gt;Perhaps you should look at this function first to understand the algorithm.&lt;br /&gt;
&lt;br /&gt;
After the creation of the lookup tables which is only done once the often used bishopAttacks() function is rather easy and performant. And it is branchless.&lt;br /&gt;
&lt;br /&gt;
Again there is the option to use unions.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:16:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;Bitboard rookAttacks( int sq, Bitboard occ )&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;    // The remaining blocking pieces in the +-rays&amp;lt;br/&amp;gt;    occ &amp;amp;amp;= rookBits[sq];&amp;lt;br/&amp;gt;    BBUnion occu;&amp;lt;br/&amp;gt;    occu.bb = occ;&amp;lt;br/&amp;gt;    // Since every square has its set of row values the six row lookups&amp;lt;br/&amp;gt;    // simply map any blockers to specific bits that when ored together&amp;lt;br/&amp;gt;    // gives an offset in the bishop attack table.&amp;lt;br/&amp;gt;    int *rRows = &amp;amp;amp;rookRows[sq][0][0];&amp;lt;br/&amp;gt;    int index = (rRows +    0)[occu.bbb.row1]  // row 1&amp;lt;br/&amp;gt;              | (rRows +  256)[occu.bbb.row2]  // row 2&amp;lt;br/&amp;gt;              | (rRows +  512)[occu.bbb.row3]  // row 3&amp;lt;br/&amp;gt;              | (rRows +  768)[occu.bbb.row4]  // row 4&amp;lt;br/&amp;gt;              | (rRows + 1024)[occu.bbb.row5]  // row 5&amp;lt;br/&amp;gt;              | (rRows + 1280)[occu.bbb.row6]  // row 6&amp;lt;br/&amp;gt;              | (rRows + 1536)[occu.bbb.row7]  // row 7&amp;lt;br/&amp;gt;              | (rRows + 1792)[occu.bbb.row8]; // row 8&amp;lt;br/&amp;gt;    return rookAttackTable[index];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;Bitboard rookAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq, Bitboard occ &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// The remaining blocking pieces in the +-rays&lt;/span&gt;
    occ &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; rookBits&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    BBUnion occu&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    occu.&lt;span class=&quot;me1&quot;&gt;bb&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; occ&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// Since every square has its set of row values the six row lookups&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// simply map any blockers to specific bits that when ored together&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;// gives an offset in the bishop attack table.&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;rRows &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;rookRows&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; index &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;rRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;    &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occu.&lt;span class=&quot;me1&quot;&gt;bbb&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;row1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 1&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;rRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;256&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occu.&lt;span class=&quot;me1&quot;&gt;bbb&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;row2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 2&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;rRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;512&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occu.&lt;span class=&quot;me1&quot;&gt;bbb&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;row3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 3&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;rRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;768&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occu.&lt;span class=&quot;me1&quot;&gt;bbb&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;row4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 4&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;rRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1024&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occu.&lt;span class=&quot;me1&quot;&gt;bbb&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;row5&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 5&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;rRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1280&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occu.&lt;span class=&quot;me1&quot;&gt;bbb&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;row6&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 6&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;rRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1536&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occu.&lt;span class=&quot;me1&quot;&gt;bbb&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;row7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// row 7&lt;/span&gt;
              &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;rRows &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1792&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;occu.&lt;span class=&quot;me1&quot;&gt;bbb&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;row8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// row 8&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; rookAttackTable&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;index&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:16 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:26:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Results&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:26 --&gt;Results&lt;/h1&gt;
 The results of the functions bishopAttacks() and rookAttacks() can be used in the same way as described in &lt;a class=&quot;wiki_link&quot; href=&quot;/Exploding%20Bitboards&quot;&gt;exploding bitboards&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:28:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:28 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:93:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;t=5587&quot; rel=&quot;nofollow&quot;&gt;New bitboard move generator&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Michael%20Sherwin&quot;&gt;Michael Sherwin&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, September 14, 2006&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:93 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:30:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:30 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:017:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Sherwin Bitboards&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Sherwin Bitboards&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Sherwin_Bitboards includeBody-Sherwin%20Bitboards includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Elephant&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Elephant&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 19, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Harald+L%C3%BC%C3%9Fen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Harald Lüßen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 20, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Michael+Sherwin&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Michael Sherwin&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 18, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/RomiChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;RomiChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 2, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sherwin+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sherwin Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 20, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:017 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>

  </channel>
</rss>