unsigned short blocks[7] =

{

    0xA808, 0x840A, 0x8888, 0xC808, 0xA088, 0x8848, 0xA880,

};


unsigned short block_masks[] =

{

    0x0001, 0x0002, 0x0004, 0x0010,

    0x4000, 0x0008, 0x0080, 0x0020,

    0x2000, 0x8000, 0x0800, 0x0040,

    0x1000, 0x0400, 0x0200, 0x0100,

};


unsigned short rotate_cw(unsigned short block)

{

    return (block << 4) & 0xFFF0 | (block >> 12) & 0x000F;

}


unsigned short rotate_ccw(unsigned short block)

{

    return (block >> 4) & 0x0FFF | (block << 12) & 0xF000;

}


void draw_block(int left, int top, unsigned short block, int color)

{

    for(int y = 0; y < 4; ++y)

        for(int x = 0; x < 4; ++x)

            if(block_masks[x + y * 4] & block)

                put_tile(left + x, top + y, color);

}



늙으면 더 ㅡ, .ㅡ;