本文整理汇总了C++中CELL函数的典型用法代码示例。如果您正苦于以下问题:C++ CELL函数的具体用法?C++ CELL怎么用?C++ CELL使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CELL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: move_down
//To move the block by 0.1 units downward
void move_down()
{
int i,j;
check_game_over();
printf("moved down 1 step\n");
if(executed==1)
{
for ( i = 0; i < 4 ; ++i)
{
if(z[i]==0) return;
}
for ( i = 0; i < 4 ; ++i)
{
current_block=tetris_board->board[CELL(x[i], y[i],z[i])];
view_status[x[i]][y[i]][z[i]]=0;
z[i]--;
view_status[x[i]][y[i]][z[i]]=1;
// current_block=set_block(global_type_block, color_block,current_block);
tetris_board_place_block_at_boardvalue(tetris_board,current_block, CELL(x[i], y[i],z[i]),z[i]);
}
}
else
{
printf("executed =0\n");;
}
printf("moved 1 step\n");
}
示例2: tb_present
void tb_present(void)
{
unsigned int x,y;
struct tb_cell *back, *front;
/* invalidate cursor position */
lastx = LAST_COORD_INIT;
lasty = LAST_COORD_INIT;
if (buffer_size_change_request) {
update_size();
buffer_size_change_request = 0;
}
for (y = 0; y < front_buffer.height; ++y) {
for (x = 0; x < front_buffer.width; ++x) {
back = &CELL(&back_buffer, x, y);
front = &CELL(&front_buffer, x, y);
if (memcmp(back, front, sizeof(struct tb_cell)) == 0)
continue;
send_attr(back->fg, back->bg);
send_char(x, y, back->ch);
memcpy(front, back, sizeof(struct tb_cell));
}
}
if (!IS_CURSOR_HIDDEN(cursor_x, cursor_y))
write_cursor(cursor_x, cursor_y);
memstream_flush(&write_buffer);
}
示例3: move_block_down
void move_block_down()
{
executed=0;
int i;
bool check=true;
for ( i = 0; i < 4; ++i)
{
if(y[i]<1 || ((view_status[x[i]][y[i]-1][z[i]]==1)&&((y[i]-1)!=y[0])&&((y[i]-1)!=y[2])&&((y[i]-1)!=y[3])&&((y[i]-1)!=y[1])))
{
check=false;
}
}
if(check)
{
update_created_status(0);
for (i=0;i<4;i++)
{
view_status[x[i]][y[i]][z[i]]=0;
current_block_array[i]=tetris_board->board[CELL(x[i], y[i],z[i])];
}
for (i=0;i<4;i++)
{
y[i]--;
view_status[x[i]][y[i]][z[i]]=1;
tetris_board_place_block_at_boardvalue(tetris_board,current_block_array[i], CELL(x[i], y[i],z[i]),z[i]);
}
printf("moving up\n");
update_created_status(1);
}
executed=1;
}
示例4: main
int main() {
lxw_workbook *workbook = new_workbook("test_chart_bar02.xlsx");
lxw_worksheet *worksheet1 = workbook_add_worksheet(workbook, NULL);
lxw_worksheet *worksheet2 = workbook_add_worksheet(workbook, NULL);
lxw_chart *chart = workbook_add_chart(workbook, LXW_CHART_BAR);
/* For testing, copy the randomly generated axis ids in the target file. */
chart->axis_id_1 = 93218304;
chart->axis_id_2 = 93219840;
uint8_t data[5][3] = {
{1, 2, 3},
{2, 4, 6},
{3, 6, 9},
{4, 8, 12},
{5, 10, 15}
};
int row, col;
for (row = 0; row < 5; row++)
for (col = 0; col < 3; col++)
worksheet_write_number(worksheet2, row, col, data[row][col] , NULL);
worksheet_write_string(worksheet1, CELL("A1"), "Foo" , NULL);
chart_add_series(chart, "Sheet2!$A$1:$A$5", "Sheet2!$B$1:$B$5");
chart_add_series(chart, "Sheet2!$A$1:$A$5", "Sheet2!$C$1:$C$5");
worksheet_insert_chart(worksheet2, CELL("E9"), chart);
return workbook_close(workbook);
}
示例5: hex_cell_z_connected_p
int
hex_cell_z_connected_p (hex_t hex, uint i, uint j)
{
if (IN_BOARD_P(hex, i, j) && CELL(hex,i,j).player != 0)
return CELL(hex,i,j).z_connected;
else
return -1;
}
示例6: fill_in_square
// use group theory to fill in the rest of the square from the first row
void fill_in_square(latin_grid square) {
int row, col;
for (row = 1; row < square->size; row++) {
for (col = 0; col < square->size; col++) {
CELL(square, row, col) =
cyclic_multiply(row, CELL(square, 0, col), square->size);
}
}
}
示例7: choose_row
void choose_row(int row, latin_grid square2) {
// put the rowth row of square2 into the next row in temp_square2
int i;
for (i = 0; i < square2->size; i++) {
CELL(temp_square2, current_row, i) = CELL(square2, row, i);
}
current_row++;
rows_used |= 1 << row;
}
示例8: printf
void *get_opponent_best_move(void *param) {
printf(" ** Thinking...");
Chessboard *cboard = (Chessboard *) param;
void on_best_move_found (Move *m) {
int i;
for (i=0; i<64; i++) { cboard->cells_highlighted[i] = CELL_NONE; }
cboard->cells_highlighted[CELL(m->to_file, m->to_rank)] = 1;
cboard->cell_selected = CELL(m->from_file, m->from_rank);
}
示例9: get_cell_widths
void get_cell_widths(struct table *t)
{
int nl = t->p->link_num;
int i, j;
if (!d_opt->table_order)
for (j = 0; j < t->y; j++) for (i = 0; i < t->x; i++) g_c_w(CELL(t, i, j));
else
for (i = 0; i < t->x; i++) for (j = 0; j < t->y; j++) g_c_w(CELL(t, i, j));
t->link_num = nl;
}
示例10: main
int main() {
lxw_workbook *workbook = workbook_new("test_hyperlink07.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
worksheet_write_url_opt(worksheet, CELL("A1"), "external:\\\\VBOXSVR\\share\\foo.xlsx", NULL, "J:\\foo.xlsx", NULL);
worksheet_write_url( worksheet, CELL("A3"), "external:foo.xlsx" , NULL);
return workbook_close(workbook);
}
示例11: main
int main() {
lxw_workbook *workbook = workbook_new("test_image07.xlsx");
lxw_worksheet *worksheet1 = workbook_add_worksheet(workbook, NULL);
lxw_worksheet *worksheet2 = workbook_add_worksheet(workbook, NULL);
worksheet_insert_image(worksheet1, CELL("E9"), "images/red.png");
worksheet_insert_image(worksheet2, CELL("E9"), "images/yellow.png");
return workbook_close(workbook);
}
示例12: fix_block_at_z
void fix_block_at_z()
{
int i;
for ( i = 0; i < 4; ++i)
{
// current_z=board_status[x[i]][y[i]];
current_block=tetris_board->board[CELL(x[i], y[i],z[i])];
tetris_board_place_block_at_boardvalue(tetris_board,current_block, CELL(x[i], y[i],z[i]),z[i]);
printf("Block placed at x=%f,y=%f and z=%f\n",current_block->pos[0],current_block->pos[2],current_block->pos[1] );
}
}
示例13: initialize_board
void initialize_board(int* board) {
int x,y;
for (y = 0; y < ROWS; ++y) {
for (x = 0; x < COLUMNS; ++x) {
if (rand() % 4 == 0) {
board[CELL(x,y)] = 1;
} else {
board[CELL(x,y)] = 0;
}
}
}
}
示例14: while
int JDList::Duplicate() {
JDCell* c = (JDCell*)CELL(hnd)->clone();
int nhnd = (int)c;
while ((int)c->next != hnd) {
c->next = (JDCell*)c->next->clone();
c->next->prev = c;
c = c->next;
}
c->next = CELL(nhnd);
c->next->prev = c;
return nhnd;
}
示例15: main
int main() {
lxw_workbook *workbook = workbook_new("test_default_row01.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
worksheet_set_default_row(worksheet, 24, LXW_FALSE);
worksheet_write_string(worksheet, CELL("A1"), "Foo" , NULL);
worksheet_write_string(worksheet, CELL("A10"), "Bar" , NULL);
return workbook_close(workbook);
}