g****y 发帖数: 323 | 1 【 以下文字转载自 Programming 讨论区 】
【 原文由 aaajoo 所发表 】
use two bits for each position. The highest 2 bits(or
lowest, as you wish) is the center. The other 16 bits for
the remaining positions. 01 is black, 10 is white, 00 is
blank.
record them clockwise.
so for your sample 121122312, the number should be
011001011010000110
for each arrangement, compute all the equivalent ones by
shifting the bits clockwise (don't touch the highest two
bits for the center). i.e, for 011001011010000110, we have
01101001011 |
|