Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "sys.h"
00025 #include <iostream>
00026 #include <iomanip>
00027
00028 using std::cout;
00029 using std::endl;
00030
00031 struct Direction {
00032 int x;
00033 int y;
00034 };
00035
00036 Direction dirs[] = {
00037 { -1, -1 },
00038 { 0, -1 },
00039 { 1, -1 },
00040 { -1, 0 },
00041 { 1, 0 },
00042 { -1, 1 },
00043 { 0, 1 },
00044 { 1, 1 }
00045 };
00046
00047 int main()
00048 {
00049 int count = 0;
00050 for (int row = 0; row < 8; ++row)
00051 {
00052 for (int col = 0; col < 8; ++col)
00053 {
00054 for (int d = 0; d < 8; ++d)
00055 {
00056 int r = row;
00057 int c = col;
00058 uint64_t mask = 0;
00059 for(;;)
00060 {
00061 c += dirs[d].x;
00062 r += dirs[d].y;
00063 if (c < 0 || c > 7 || r < 0 || r > 7)
00064 break;
00065 mask |= CW_MASK_T_CONST(1) << ((r << 3) + c);
00066 }
00067 if ((count % 4) == 0)
00068 cout << " ";
00069 cout << "{CW_MASK_T_CONST(0x" << std::hex << std::setfill('0') << std::setw(16) << mask << ")}, ";
00070 if ((++count % 4) == 0)
00071 cout << '\n';
00072 }
00073 }
00074 }
00075 }