Board Overlay
2^k Checkerboard, there is a flaw, with an L-shaped jigsaw puzzle to cover the board.
Apply each time you apply the defect around ... 23333
Reference
intdir[4][2] = {{0,0},{0,1},{1,0},{1,1}};///The checkerboard L shape corresponds to the difference between the missing latticeintgraph[10000][10000];voidSet_piece (intRintCintx) {///R,c represents the position to be applied, X indicates which type to smear, and the other means not to smear . for(inti =0; I <4; i++){ if(i = =x)Continue; Graph[r+dir[i][0]][c+dir[i][1]] = x+1; }}voidChessboard (intSxintSyintXintYintLen) { if(len = =1) return; ints = len/2; intDX = x >= SX + S;///Identify defect Locations intdy = y >= sy +s; for(inti =0; I <4; i++){ if(dir[i][0]! = DX | | dir[i][1] !=dy)Continue; Set_piece (SX+s-1, sy+s-1, i); for(intj =0; J <4; j + +){ intSSX = SX + dir[j][0] *s; intSsy = sy + dir[j][1] *s; if(i = =j) {chessboard (ssx,ssy,x,y,s); } Else{ intex = SX + S-1+ dir[j][0]; intEY = sy + S-1+ dir[j][1]; Chessboard (ssx,ssy,ex,ey,s); } } }}
Recursive and divided treatment