예제 #1
0
파일: main.cpp 프로젝트: aust/Bejeweled-Bot
int main()
{
	// Display a few instructions
	printf("Instructions:\nWhen ready, hit enter. You will have five seconds "
		"to place your mouse cursor in the upper left hand corner of the game board.\n"
		"\nTips: I would hit enter, then wait a few seconds and then click play. It might"
		" take a game or two to get your timing right.\n");
	system("pause");

	while (true)
	{
		CountDown(5);
		InitGame();

		// Play game for specified time_limit
		for (time_t start_time = time(0);
			start_time + time_limit - time(0) >= 0;)
		{
			GetGems();
			DisplayGrid();
			MakeMove();
			Sleep(throttle_time);
		}

		ClearGame();

		printf("Game over. . . Play again?\n");
		system("Pause");
	}
	
	return 0;
}
예제 #2
0
파일: maprules.cpp 프로젝트: Chuvi-w/CSSDK
void CGameCounter::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
	if (!CanFireForActivator(pActivator))
		return;

	switch (useType)
	{
	case USE_ON:
	case USE_TOGGLE:
		CountUp();
		break;

	case USE_OFF:
		CountDown();
		break;

	case USE_SET:
		SetCountValue((int)value);
		break;
	}

	if (HitLimit())
	{
		SUB_UseTargets(pActivator, USE_TOGGLE, 0);
		if (RemoveOnFire())
		{
			UTIL_Remove(this);
		}

		if (ResetOnFire())
		{
			ResetCount();
		}
	}
}
예제 #3
0
 void activity(){
     
     char arr[SIZE];
     int arr1[SIZE];
     char rarr1[SIZE];
     double arr2[SIZE];
     char rarr2[SIZE];
     
     for(int i=0;i<SIZE;i++){
         cout<<"Enter the character for index "<<i+1<<": ";
         cin>>arr[i];
     }
     
     for(int i=0;i<SIZE;i++){
         cout<<"Enter the number for index "<<i+1<<": ";
         cin>>arr1[i];
     }
     
     for(int i=0;i<SIZE;i++){
         cout<<"Enter the double number for index "<<i+1<<": ";
         cin>>arr2[i];
     }
     cout<<"===========Char Array================"<<endl;
     cout<<"The maximum character is "<<getMAX(arr)<<endl;
     cout<<"The minumum character is "<<getMIN(arr)<<endl;
     cout<<"===========Int Array================"<<endl;
     cout<<"The maximum number is "<<getMAX(arr1)<<endl;
     cout<<"The minumum number is "<<getMIN(arr1)<<endl;
     checkEven(arr1, rarr1);
     cout<<printArry(rarr1)<<endl;
     cout<<"===========Double Array================"<<endl;
     CountDown(arr2);
     cout<<endl;
     cout<<"The maximum number is "<<getMAX(arr2)<<endl;
     cout<<"The minumum number is "<<getMIN(arr2)<<endl;
     checkEven(arr2, rarr2);
     cout<<printArry(rarr2);
 }
void CMagneticBomb::update(float elapsed)
{
	CountDown();
}