Exemplo n.º 1
0
int
main(void)
{
    srand((unsigned)time(0));

    int count = 20, i;
    printf("### Function Test ###\n");
    printf("=== Init Skip List ===\n");
    skiplist *sl = slCreate();
    for (i = 0; i < count; ++i) {
        slInsert(sl, i);
    }
    printf("=== Print Skip List ===\n");
    slPrint(sl);

    printf("=== Search Skip List ===\n");
    for (i = 0; i < count; ++i) {
        int value = rand() % (count + 10);
        slSearch(sl, value);
    }

    printf("=== Delete Skip List ===\n");
    for (i = 0; i < count + 10; i += 2) {
        printf("Delete[%d]: %s\n", i, slDelete(sl, i) ? "SUCCESS" : "NOT FOUND");
    }
    slPrint(sl);

    slFree(sl);
    sl = NULL;

    return 0;
}
Exemplo n.º 2
0
int main( void )
{
	Uint8 *pDest;
	Uint32 i;

	/* Zero the .bss section */
	for( pDest = ( Uint8 * )&_bstart; pDest < ( Uint8 * )&_bend; ++pDest )
	{
		( *pDest ) = 0;
	}

	for( pDest = ( Uint8 * )SystemWork, i = 0; i < SystemSize; ++i )
	{
		( *pDest ) = 0;
	}

	slInitSystem( TV_320x224, NULL, 1 );
	slPrint( "Red Ring Rico's", slLocate( 1, 2 ) );
	slPrint( "Mini Ludum Dare #52 Entry", slLocate( 1, 3 ) );

	while( -1 )
	{
		slSynch( );
	}

	return 0;
}