• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ROW函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ROW函数的典型用法代码示例。如果您正苦于以下问题:C++ ROW函数的具体用法?C++ ROW怎么用?C++ ROW使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ROW函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: switch

/* move_str returns a string with move m in coordinate notation */
char *move_str(move_bytes m)
{
	static char str[6];
	char c;

	if (m.bits & 32) {
		switch (m.promote) {
			case KNIGHT:
				c = 'n';
				break;
			case BISHOP:
				c = 'b';
				break;
			case ROOK:
				c = 'r';
				break;
			default:
				c = 'q';
				break;
		}
		sprintf(str, "%c%d%c%d%c",
				COL(m.from) + 'A',
				8 - ROW(m.from),
				COL(m.to) + 'A',
				8 - ROW(m.to),
				c);
	}
	else
		sprintf(str, "%c%d%c%d",
				COL(m.from) + 'A',
				8 - ROW(m.from),
				COL(m.to) + 'A',
				8 - ROW(m.to));
	return str;
}
开发者ID:BadrElh,项目名称:microwindows,代码行数:36,代码来源:main.c


示例2: matrix_make

inline
static void matrix_make(uint8_t code)
{
    if (!matrix_is_on(ROW(code), COL(code))) {
        matrix[ROW(code)] |= 1<<COL(code);
    }
}
开发者ID:Eleuin,项目名称:tmk_keyboard,代码行数:7,代码来源:matrix.c


示例3: block

static
void
block( int el )
{
    int i, idx = 0, row, col;

    rb->yield();

    /* Find first unknown square */
    for( i = 0 ; i < 9 && !IS_EMPTY( idx = idx_block( el, i ) ) ; ++i )
        ;
    if( i < 9 )
    {
        assert( IS_EMPTY( idx ) );
        row = ROW( idx );
        col = COLUMN( idx );
        for( ++i ; i < 9 ; ++i )
        {
            idx = idx_block( el, i );
            if( IS_EMPTY( idx ) )
            {
                if( ROW( idx ) != row )
                    row = -1;
                if( COLUMN( idx ) != col )
                    col = -1;
            }
        }
        if( 0 <= row )
            exblock( el, row, idx_row );
        if( 0 <= col )
            exblock( el, col, idx_column );
    }
}
开发者ID:BurntBrunch,项目名称:rockbox-fft,代码行数:33,代码来源:generator.c


示例4: InitMainMenu

//----------------------------------------------------------------------------------------------------
void InitMainMenu(void)
{
    InitOsdFrame();

	// Set 2bit sub menu select flag,color & Attrib
    OSDClear(5, 12, 2, 2, 0xFA, BYTE_ATTRIB);
    OSDClear(5, 12, 2, 2, 0x37, BYTE_COLOR);

	// Draw ----------- ·Ö¸ô --------------
    OSDLine(ROW(3), COL(1), LENGTH(23), 0x5c, BYTE_DISPLAY);
    
    // Set Menu Title color
	OSDLine(ROW(4), COL(0), LENGTH(31), 0x40, BYTE_COLOR);

    // Draw Main Window
    COsdFxDrawWindow(8,0,												//WORD usXStart,WORD usYStart,  
    				 _MAINMENU_WIDTH * 12 + 8,_MAINMENU_HEIGHT * 18,	//WORD usXEnd,WORD usYEnd,  
    				 tMainWindowStyle);									//BYTE *pStyle)

    // Draw Adjust Window
    COsdFxDrawWindow(28,		306,									//WORD usXStart,WORD usYStart,  
    				 288,		372,									//WORD usXEnd,WORD usYEnd,  
    				 tAdjustWindowStyle);								//BYTE *pStyle)
    				 
    ShowMode();
}
开发者ID:avtehnik,项目名称:RTD2662,代码行数:27,代码来源:Osd002Func.C


示例5: matrix_scan

uint8_t matrix_scan(void)
{
    uint16_t code;
    code = serial_recv2();
    if (code == -1) {
#ifdef PC98_LED_CONTROL
        // Before sending command  we have to make sure that there is no unprocessed key in queue
        // otherwise keys will be missed during sending command
        if (pc98_led) {
            pc98_led_set();
            pc98_led = 0;
        }
#endif
        return 0;
    }

    print_hex8(code); print(" ");

    if (code&0x80) {
        // break code
        if (matrix_is_on(ROW(code), COL(code))) {
            matrix[ROW(code)] &= ~(1<<COL(code));
        }
    } else {
        // make code
        if (!matrix_is_on(ROW(code), COL(code))) {
            matrix[ROW(code)] |=  (1<<COL(code));
        }
    }
    return code;
}
开发者ID:jongbinjung,项目名称:bean_keyboard,代码行数:31,代码来源:matrix.c


示例6: matrix_break

inline
static void matrix_break(uint8_t code)
{
    if (matrix_is_on(ROW(code), COL(code))) {
        matrix[ROW(code)] &= ~(1<<COL(code));
    }
}
开发者ID:Eleuin,项目名称:tmk_keyboard,代码行数:7,代码来源:matrix.c


示例7: vsync

void vsync(DISPMANX_UPDATE_HANDLE_T u, void* arg)
{

    int ret;
    DISPMANX_UPDATE_HANDLE_T    update;

    update = vc_dispmanx_update_start( 10 );
    assert( update );
    ret = vc_dispmanx_element_change_source( update, element, resource[next_resource]);
    assert( ret == 0 );
    ret = vc_dispmanx_update_submit_sync( update );
    assert( ret == 0 );

    if(next_resource != 2) {

        int real_next_resource = next_resource ^ 1;
        next_resource = 2; // use filler if next callback called before this one ends

        // fill image
        int n;
        for (n=0; n<HEIGHT; n+=2) {
            get_packet(ROW(n)+24); // +24 because clock never changes
            memcpy(ROW(n+1)+24, ROW(n)+24, 336); // double it up because the hardware scaler
                                                 // will introduce blurring between lines
        }

        // write to resource
        ret = vc_dispmanx_resource_write_data(  resource[real_next_resource], TYPE, PITCH, image, &image_rect );
        assert( ret == 0 );

        next_resource = real_next_resource; // queue up next real resource

    }
}
开发者ID:Tachiorz,项目名称:raspi-teletext,代码行数:34,代码来源:main.c


示例8: cheeky_refresh_row

/**
 * @brief
 *	Refresh rows row_number AND (row_number + 1) in the usb packet
 *	that we'll send to the led device. This function is also in charge
 *	to make the horizontal move and the negative display.
 * @param data Our private structure where all params are located.
 * @param row_number The first row this function is updating.
 * @param decale The number of LED, between 0 and 2, to shift.
 */
static void		cheeky_refresh_row(data_t*		data,
					__u8		row_number,
					__u8		decale)
{
	unsigned int		bitfield;
	char			char_to_print;
	__be32		first_row = 0;
	__be32		second_row = 0;
	__u8			i;
	__s8			hmove;

	data->display_packets[row_number].brighness = GET_BRIGHNESS(data->params);
	data->display_packets[row_number].row_number = row_number * 2;

	/* Updating the usb packet depending on the text buffer */
	for (i = 0; i < 8; ++i)	{
		up(&data->sem_buffer);
		char_to_print =
			data->buffer[(i + data->start_character) % data->length];
		down(&data->sem_buffer);

		bitfield = cheeky_get_bitfield(char_to_print);

		first_row |= ROW(row_number * 2, bitfield) << (3 * (i + 1));
		second_row |= ROW(row_number * 2 + 1, bitfield) << (3 * (i + 1));
	}

	/* If there is a horizontal move, just shift the bits :) */
	hmove = GET_HMOVE(data->params);
	if (hmove & LED_RIGHT_TO_LEFT) {
		first_row >>= decale;
		second_row >>= decale;
	}
开发者ID:casasnovas,项目名称:cheeky_display,代码行数:42,代码来源:cheeky_driver.c


示例9: matrix_scan

uint8_t matrix_scan(void)
{
    is_modified = false;

    uint16_t code;
    code = serial_recv2();
    if (code == -1) {
        return 0;
    }

    dprintf("%02X\n", code);
    if (code&0x80) {
        // break code
        if (matrix_is_on(ROW(code), COL(code))) {
            matrix[ROW(code)] &= ~(1<<COL(code));
            is_modified = true;
        }
    } else {
        // make code
        if (!matrix_is_on(ROW(code), COL(code))) {
            matrix[ROW(code)] |=  (1<<COL(code));
            is_modified = true;
        }
    }
    return code;
}
开发者ID:0mark,项目名称:tmk_keyboard,代码行数:26,代码来源:matrix.c


示例10: MFac6500MenuAdj

void MFac6500MenuAdj(BYTE ucMode)
{
    // ucMode : _NEXT or _Prev

       BYTE ucNewItem;
    if(ucMode==_INC)
    { 	
    	if(ucOsdState>_MI_FAC_6500_R-1 && ucOsdState<_MI_FAC_6500_B)
    		ucNewItem=ucOsdState+1;
    	else
    		ucNewItem=_MI_FAC_6500;
    }
    else
	{
	    if(ucOsdState>_MI_FAC_6500_R && ucOsdState<_MI_FAC_6500_B+1)
    		ucNewItem=ucOsdState-1;
    	else
    		ucNewItem=_MI_FAC_6500;
	}
    // 1. Clear Current Menu
	OSDLine(ROW(5),COL(16+(ucOsdState-_MI_FAC_6500_R)*6),LENGTH(6),_MENU_NORMAL_COLOR,BYTE_COLOR);


    // 2. Change ucOsdState
    ucOsdState = ucNewItem;

    // 3. Draw New Item
    if(ucOsdState>_MI_FAC_6500_R-1 && ucOsdState<_MI_FAC_6500_B+1)
    	OSDLine(ROW(5),COL(16+(ucOsdState-_MI_FAC_6500_R)*6),LENGTH(6),_MENU_SECECT_COLOR,BYTE_COLOR);
    else
    	SETCOLOR_FACMAINMENU_SELLINE(5,_MENU_SECECT_COLOR);

}
开发者ID:avtehnik,项目名称:RTD2662,代码行数:33,代码来源:OSD_FAC.c


示例11: EvalQueen

void EvalQueen(S8 sq, S8 side) {
    v.gamePhase += 4;
    int att = 0;
    int mob = 0;
 
    /****************************************************************
    *  A queen should not be developed too early                    *
    ****************************************************************/
 
    if (side == WHITE && ROW(sq) > ROW_2) {
        if (isPiece(WHITE, KNIGHT, B1)) v.PositionalThemes[WHITE] -= 2;
        if (isPiece(WHITE, BISHOP, C1)) v.PositionalThemes[WHITE] -= 2;
        if (isPiece(WHITE, BISHOP, F1)) v.PositionalThemes[WHITE] -= 2;
        if (isPiece(WHITE, KNIGHT, G1)) v.PositionalThemes[WHITE] -= 2;
    }
 
    if (side == BLACK && ROW(sq) < ROW_7) {
        if (isPiece(BLACK, KNIGHT, B8)) v.PositionalThemes[BLACK] -= 2;
        if (isPiece(BLACK, BISHOP, C8)) v.PositionalThemes[BLACK] -= 2;
        if (isPiece(BLACK, BISHOP, F8)) v.PositionalThemes[BLACK] -= 2;
        if (isPiece(BLACK, KNIGHT, G8)) v.PositionalThemes[BLACK] -= 2;
    }
 
    /****************************************************************
    *  Collect data about mobility and king attacks                 *
    ****************************************************************/
 
    for (char dir=0;dir<vectors[QUEEN];dir++) {
 
         for (char pos = sq;;) {
 
              pos = pos + vector[QUEEN][dir];
              if (! IS_SQ(pos)) break;
 
              if (b.pieces[pos] == PIECE_EMPTY) {
                 mob++;
                 if ( e.sqNearK[!side] [b.KingLoc[!side] ] [pos] ) ++att;
              }
              else if (b.color[pos] != side) {
                   mob++;
                   if ( e.sqNearK[!side] [b.KingLoc[!side] ] [pos] ) ++att;
                   break;
              }
              else {
                   break;
              }
 
         }
    }
 
    v.mgMob[side] += 1 * (mob-14);
    v.egMob[side] += 2 * (mob-14);
 
    if (att) {
       v.attCnt[side]++;
       v.attWeight[side] += 4*att;
    }
 
}
开发者ID:komministern,项目名称:chess,代码行数:59,代码来源:evaluation.c


示例12: print

void print(const char *str, int len, int row, int col) {
	if (valid_pos(row, col)) {
		int i;
		int pos = row * WIDTH + col;
		for (i = 0; i < len && valid_pos(ROW(pos), COL(pos)); i++, pos++)
			print_char(str[i], ROW(pos), COL(pos));
	}
}
开发者ID:tcerdaITBA,项目名称:Arqui,代码行数:8,代码来源:video_driver.c


示例13: EraseFromSOLToCursor

void EraseFromSOLToCursor() {
	int i;

	for (i = 0; i < COLUMN(TermInfo); i++) {
		SCREENCHAR(TermInfo, ROW(TermInfo), i) = ' ';
		FORMATCODE(TermInfo, ROW(TermInfo), i) = FORMATCODE(TermInfo, ROW(TermInfo), 0);
	}
}
开发者ID:AshuDassanRepo,项目名称:bcit-courses,代码行数:8,代码来源:display.c


示例14: NewLine

void NewLine() {
	if (DOUBLELINE(TermInfo)) {
		ROW(TermInfo) = ROW(TermInfo) + 2;
	}
	else {
		ROW(TermInfo)++;
	}
}
开发者ID:AshuDassanRepo,项目名称:bcit-courses,代码行数:8,代码来源:display.c


示例15:

char *ConstructCursorPositionReport() {
	char *s = ".[##;##R";
	s[2] = (COLUMN(TermInfo)/10) + 48;
	s[3] = (COLUMN(TermInfo)%10) + 48;
	s[5] = (ROW(TermInfo)/10) + 48;
	s[6] = (ROW(TermInfo)%10) + 48;
	return s;
}
开发者ID:AshuDassanRepo,项目名称:bcit-courses,代码行数:8,代码来源:vt100.c


示例16: draw_text

void Display::update_prearm(uint8_t r)
{
    if (AP_Notify::flags.pre_arm_check) {
        draw_text(COLUMN(0), ROW(r), "Prearm: passed    ");
    } else {
        draw_text(COLUMN(0), ROW(r), "Prearm: failed    ");
    }
}
开发者ID:goredhawk,项目名称:ardupilot,代码行数:8,代码来源:Display.cpp


示例17: EraseFromCursorToEOL

void EraseFromCursorToEOL() {
	int i;

	for (i = COLUMN(TermInfo); i < MAXCOLS; i++) {
		SCREENCHAR(TermInfo, ROW(TermInfo), i) = ' ';
		FORMATCODE(TermInfo, ROW(TermInfo), i) = CURRENTFORMAT(TermInfo);
	}
}
开发者ID:AshuDassanRepo,项目名称:bcit-courses,代码行数:8,代码来源:display.c


示例18: _get_account_coords

/*
 * _get_account_coords - fill in all the users that are coordinator for
 *  this account. Also fill in coordinators from parent accounts.
 */
static int
_get_account_coords(pgsql_conn_t *pg_conn, slurmdb_account_rec_t *acct)
{
	DEF_VARS;
	slurmdb_coord_rec_t *coord = NULL;

	if(!acct) {
		error("as/pg: _get_account_coords: account not given");
		return SLURM_ERROR;
	}

	if(!acct->coordinators)
		acct->coordinators = list_create(slurmdb_destroy_coord_rec);

	/* get direct coords */
	query = xstrdup_printf("SELECT user_name FROM %s "
			       "WHERE acct='%s' AND deleted=0",
			       acct_coord_table, acct->name);
	result = DEF_QUERY_RET;
	if(!result)
		return SLURM_ERROR;

	FOR_EACH_ROW {
		coord = xmalloc(sizeof(slurmdb_coord_rec_t));
		list_append(acct->coordinators, coord);
		coord->name = xstrdup(ROW(0));
		coord->direct = 1;
	} END_EACH_ROW;
	PQclear(result);

	/* get parent account coords */
	FOR_EACH_CLUSTER(NULL) {
		if (query)
			xstrcat(query, " UNION ");
		xstrfmtcat(query, "SELECT DISTINCT t0.user_name "
			   "FROM %s AS t0, %s.%s AS t1, %s.%s AS t2 "
			   "WHERE (t1.acct='%s' AND t1.user_name='' "
			   "  AND (t1.lft>t2.lft AND t1.rgt < t2.rgt)) "
			   "  AND t0.deleted=0 AND t0.acct=t2.acct "
			   "  AND t2.acct != '%s'",
			   acct_coord_table, cluster_name, assoc_table,
			   cluster_name, assoc_table, acct->name, acct->name);

	} END_EACH_CLUSTER;

	result = DEF_QUERY_RET;
	if(!result)
		return SLURM_ERROR;

	FOR_EACH_ROW {
		coord = xmalloc(sizeof(slurmdb_coord_rec_t));
		list_append(acct->coordinators, coord);
		coord->name = xstrdup(ROW(0));
		coord->direct = 0;
	} END_EACH_ROW;
	PQclear(result);
	return SLURM_SUCCESS;
}
开发者ID:VURM,项目名称:slurm,代码行数:62,代码来源:as_pg_acct.c


示例19: register_key

inline
static void register_key(uint8_t key)
{
    if (key&0x80) {
        matrix[ROW(key)] &= ~(1<<COL(key));
    } else {
        matrix[ROW(key)] |=  (1<<COL(key));
    }
}
开发者ID:Pyrolistical,项目名称:tmk_keyboard,代码行数:9,代码来源:matrix.c


示例20: BlackPawnMoves

inline int BlackPawnMoves(const BOARD *board, SQUARE orig, MOVE *poss_moves, int nmoves, char noncaptures)
{
    SQUARE dest = orig + ROW_DOWN;
    if(noncaptures && IN_BOARD(dest) && board->squares[dest] == EMPTY){
        if(ROW(dest) == FIRST_ROW){
            if(poss_moves) poss_moves[nmoves] = Move(B_QUEEN, dest, orig);
            nmoves++;
            if(poss_moves) poss_moves[nmoves] = Move(B_KNIGHT, dest, orig);
            nmoves++;
            if(poss_moves) poss_moves[nmoves] = Move(B_ROOK, dest, orig);
            nmoves++;
            if(poss_moves) poss_moves[nmoves] = Move(B_BISHOP, dest, orig);
            nmoves++;
        }else{
            if(poss_moves) poss_moves[nmoves] = Move(0, dest, orig);
            nmoves++;
            if(ROW(dest) == SIXTH_ROW){
                dest = dest + ROW_DOWN;
                if(IN_BOARD(dest)){
                    if(board->squares[dest] == EMPTY){
                        if(poss_moves) poss_moves[nmoves] = Move(0, dest, orig);
                        nmoves++;
                    }
                }
            }
        }
    }
    for(int i = 0; b_pawn_capture[i]; i++){
        dest = orig + b_pawn_capture[i];
        if(IN_BOARD(dest)){
            if(board->squares[dest] == EMPTY){
                if(dest == board->en_passant){
                    if(poss_moves) poss_moves[nmoves] = Move(0, dest, orig);
                    nmoves++;
                }
            }else if(GET_COLOR(board->squares[dest])){
                if(ROW(dest) == FIRST_ROW){
                    if(poss_moves) poss_moves[nmoves] = Move(B_QUEEN, dest, orig);   
                    nmoves++;
                    if(poss_moves) poss_moves[nmoves] = Move(B_KNIGHT, dest, orig);
                    nmoves++;
                    if(poss_moves) poss_moves[nmoves] = Move(B_ROOK, dest, orig);
                    nmoves++;
                    if(poss_moves) poss_moves[nmoves] = Move(B_BISHOP, dest, orig);
                    nmoves++;
                }else{
                    if(poss_moves) poss_moves[nmoves] = Move(0, dest, orig);
                    nmoves++;
                }
            }
        }
    }
    return nmoves;
}
开发者ID:phenri,项目名称:Claudia,代码行数:54,代码来源:movegen.c



注:本文中的ROW函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ROW_VALUES函数代码示例发布时间:2022-05-30
下一篇:
C++ ROUND_UP函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap