1-04-15から1日間の記事一覧

Tetris AllRGB

// Block shapes // block type *7, rotation*4, x-posision*4 int nrot[7]; // number of rotated shapes int bs_wid[7][4]; // width int bs_ofs[7][4][4]; int bs_hei[7][4][4]; int bs_min[7][4]; //min y at x int bs_pos[7][4][4]; void init_bs_aux(i…

RingBuffer Code

RingBuf.h #ifndef RINGBUFH #define RINGBUFH // Ring Buffer manager class RingBuf { public: RingBuf(int size); void Loop1(); bool Loop2(); void Loop3(); int LoopIdx(); #define RBFOR(x) for((x)->Loop1();(x)->Loop2();(x)->Loop3()) // example:…