📄 group__mac.html
字号:
<td class="md" nowrap valign="top"> #define BOARD_RESTORE_HASH_CODE</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">board, <tr> <td></td> <td></td> <td class="md" nowrap>code </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><b>Value:</b><div class="fragment"><pre>board->hash_code[0] ^= code[0]; \ board->hash_code[1] ^= code[1];</pre></div>macro to restore the hash codes </td> </tr></table><a class="anchor" name="ga43" doxytag="solver.c::BOARD_RESTORE_PARITY" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define BOARD_RESTORE_PARITY</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">board, <tr> <td></td> <td></td> <td class="md" nowrap>x </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> (board->parity[<a class="el" href="group__mac.html#ga1">QUADRANT_ID</a>[x]] ^= 1) </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>macro to restore parity </td> </tr></table><a class="anchor" name="ga39" doxytag="solver.c::BOARD_RESTORE_PLAYER" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define BOARD_RESTORE_PLAYER</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">board </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> (board->player = p) </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>macro to restore player </td> </tr></table><a class="anchor" name="ga37" doxytag="solver.c::BOARD_RESTORE_SQUARE" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define BOARD_RESTORE_SQUARE</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">board, <tr> <td></td> <td></td> <td class="md" nowrap>move </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><b>Value:</b><div class="fragment"><pre><span class="keywordflow">switch</span>((move)->n) { \ <span class="keywordflow">case</span> 18: board->square[(move)->position[18]] = o; \ <span class="keywordflow">case</span> 17: board->square[(move)->position[17]] = o; \ <span class="keywordflow">case</span> 16: board->square[(move)->position[16]] = o; \ <span class="keywordflow">case</span> 15: board->square[(move)->position[15]] = o; \ <span class="keywordflow">case</span> 14: board->square[(move)->position[14]] = o; \ <span class="keywordflow">case</span> 13: board->square[(move)->position[13]] = o; \ <span class="keywordflow">case</span> 12: board->square[(move)->position[12]] = o; \ <span class="keywordflow">case</span> 11: board->square[(move)->position[11]] = o; \ <span class="keywordflow">case</span> 10: board->square[(move)->position[10]] = o; \ <span class="keywordflow">case</span> 9: board->square[(move)->position[ 9]] = o; \ <span class="keywordflow">case</span> 8: board->square[(move)->position[ 8]] = o; \ <span class="keywordflow">case</span> 7: board->square[(move)->position[ 7]] = o; \ <span class="keywordflow">case</span> 6: board->square[(move)->position[ 6]] = o; \ <span class="keywordflow">case</span> 5: board->square[(move)->position[ 5]] = o; \ <span class="keywordflow">case</span> 4: board->square[(move)->position[ 4]] = o; \ <span class="keywordflow">case</span> 3: board->square[(move)->position[ 3]] = o; \ <span class="keywordflow">case</span> 2: board->square[(move)->position[ 2]] = o; \ <span class="keywordflow">case</span> 1: board->square[(move)->position[ 1]] = o; \ <span class="keywordflow">case</span> 0: board->square[(move)->position[ 0]] = <a class="code" href="group__mac.html#gga58a132">EMPTY</a>; \}</pre></div>restore board </td> </tr></table><a class="anchor" name="ga22" doxytag="solver.c::BOARD_SIZE" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define BOARD_SIZE 91 </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>size of the board </td> </tr></table><a class="anchor" name="ga29" doxytag="solver.c::BOARD_UPDATE_ALL_NODES" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define BOARD_UPDATE_ALL_NODES</td> <td class="md" valign="top">( </td> </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> board->n_nodes++ </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>more general node counter </td> </tr></table><a class="anchor" name="ga40" doxytag="solver.c::BOARD_UPDATE_DISCS" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define BOARD_UPDATE_DISCS</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">board, <tr> <td></td> <td></td> <td class="md" nowrap>n_flips </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><b>Value:</b><div class="fragment"><pre>board->n_discs[(<span class="keywordtype">int</span>)p] += n_flips + 1; \ board->n_discs[(<span class="keywordtype">int</span>)o] -= n_flips; \ board->n_empties--;</pre></div>macro to update disc counter </td> </tr></table><a class="anchor" name="ga44" doxytag="solver.c::BOARD_UPDATE_EMPTIES" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define BOARD_UPDATE_EMPTIES</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">board, <tr> <td></td> <td></td> <td class="md" nowrap>empties, <tr> <td></td> <td></td> <td class="md" nowrap>x </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><b>Value:</b><div class="fragment"><pre>empties = board->position_to_empties[x]; \ empties->previous->next = empties->next; \ empties->next->previous = empties->previous;</pre></div>macro to update the list of empty squares </td> </tr></table><a class="anchor" name="ga48" doxytag="solver.c::BOARD_UPDATE_HASH_CODE" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define BOARD_UPDATE_HASH_CODE</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">board, <tr> <td></td> <td></td> <td class="md" nowrap>code </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><b>Value:</b><div class="fragment"><pre>board->hash_code[0] ^= code[0]; \ board->hash_code[1] ^= code[1];</pre></div>macro to update the hash codes </td> </tr></table><a class="anchor" name="ga26" doxytag="solver.c::BOARD_UPDATE_INTERNAL_NODES" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define BOARD_UPDATE_INTERNAL_NODES</td> <td class="md" valign="top">( </td> </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> board->n_nodes++; </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>node counter for internal nodes </td> </tr></table><a class="anchor" name="ga42" doxytag="solver.c::BOARD_UPDATE_PARITY" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define BOARD_UPDATE_PARITY</td> <td class="md" valign="top">( </td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -