⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainwnd.cpp

📁 简单的纸牌游戏,请初学者
💻 CPP
📖 第 1 页 / 共 2 页
字号:

}

void LoadGraphics(HINSTANCE hInst)
{
	CardBack  = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BITMAP1));
    CardBlack = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BITMAP3));
    Card1 = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BITMAP4));
    Card2 = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BITMAP5));
	Card3 = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BITMAP6));
	Card4 = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BITMAP7));
	Card5 = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BITMAP2));
	Guess = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BITMAP9));

}



// Card Functions

void SetCard(HWND hwnd, HBITMAP hbitmap)
{
SendMessage(hwnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hbitmap);
}


void ShuffleDeck()
{
    
	cardindex = 0;

	// Reset Card Deck
	for(int i = 0; i < 24; i++)
	{
		DECK[i] = rand()%4;

	}

}

void ShuffleDeck2()
{

	cardindex = 0;
    // Deck Count Index
	int m1 = 0;
	int m2 = 0;
	int m3 = 0;
	int m4 = 0;
    int m5 = 0;

	int deckindex = 0;

	// Randomize the Deck, but allow only 5 of Each Number 

	while(deckindex < 24)
	{

		int curRand = rand()%4;

		switch(curRand)
		{
		case 0:
	
			if(m1 < 4)
			{
				DECK[deckindex] = curRand;
				deckindex++;
				m1++;
			}

			break;
        case 1:
		
			if(m2 < 4)
			{
				DECK[deckindex] = curRand;
				deckindex++;
				m2++;
			}


			break;
		case 2:
			if(m3 < 4)
			{
				DECK[deckindex] = curRand;
				deckindex++;
				m3++;
			}

			break;
		case 3:
			if(m4 < 4)
			{
				DECK[deckindex] = curRand;
				deckindex++;
				m4++;
			}

			break;
		case 4:
			if(m5 < 4)
			{
				DECK[deckindex] = curRand;
				deckindex++;
				m5++;
			}

			break;
		}
	
	}


}


void NextCard()
{
   	cardindex++;
    int curCard;
	curCard = DECK[cardindex];
	ShowCard(curCard);

}

void ShowCard(int card)
{
	switch(card)
	{
    case 0:
	    SetCard(CardShownStatic,Card1);
		break;
	case 1:
		SetCard(CardShownStatic,Card2);
		break;
	case 2:
		SetCard(CardShownStatic,Card3);
		break;
	case 3:
		SetCard(CardShownStatic,Card4);
		break;
	case 4:
		SetCard(CardShownStatic,Card5);
		break;
	}
}


/*

  ******************** FOURTNE ANSWERS / RELATED FUNCTIONS ******************************

*/
// Card Fourtne Randomized Answers
void FourtneResponse(char* fourtne, int CorrectGuess, int RndTime)
{

	// Make New Variable From This Randomized 

	int RndFort = 0;
	RndFort = RndTime;
	int Guess = GetGuess(CorrectGuess); // Return Level of Guesses
		// Each One 3, Possible Sizes for Guess, it is Returned
    int erate = eRate();// Entery Rate of Previous Game
	int sanity = ifinsane();

	// 0 NORMAL
	// 1 INTUITIVE
	// 2 POWERFUL

	switch(RndFort)
	{

	case 0:

		switch(Guess)
		{
        case 0:
			strcpy(fourtne, "You have much variety, and come before most.");
			break;
		case 1:
	     	strcpy(fourtne, "Eternal Situations, Possibly Hold you Down");
			break;
		case 2:
	    	strcpy(fourtne, "You attract what you put out, whats returned to you is a success.");
	 		break;
	 }
	break;
	
	case 1:
	
		switch(Guess)
		{
		
			case 0:
			   strcpy(fourtne, "Lifes not sometimes how you want it to be");
				break;
			case 1:
				strcpy(fourtne, "you wonder alot about stuff, possibly in different states of mind");
                break;
			case 2:
			strcpy(fourtne, "wonderful things fill your life, your luck is amazing.");
				break;
		}
		break;
	 case 2:
	   switch(Guess)
	   {

	   case 0:
		   strcpy(fourtne, "Your patience at times, becomes low");
		   break;
	   case 1:
		   strcpy(fourtne, "trust in yourself, it is what creates you");
		   break;
	   case 2:
		   strcpy(fourtne, "movement upward has implemented great wealth in your life");
		   break;

	   }
		break;
	   case 3:
		   switch(Guess)
		   {
		   case 0:
			
			   strcpy(fourtne, "your mind sometimes, seems out of control");
			   break;
		   case 1:
			   strcpy(fourtne, "by reciving this message, you have had some luck!");
			   break;
		   case 2:
			   strcpy(fourtne, "the one mind, now flows freely within you");
			   break;
			}
		   
		   break;

		   case 4:
			   switch(Guess)
			   {
			   case 0:
				   strcpy(fourtne, "your personality, and ego are what bind you");
				   break;
			   case 1:
				   strcpy(fourtne, "the stripping of the layers of the mind, allow you to recivie this message");
				   break;
			   case 2:
				   strcpy(fourtne, "you are filled with love, you have had the luck, to be a beautiful angel of the divine mind");
				   break;
			   }
			   break;

			case 5:
			
				switch(Guess)
				{
				case 0:
				    strcpy(fourtne, "your concious, has not yet grown, you must clear yourself to reach higher");
                    break;
				case 1:
					strcpy(fourtne, "your starting to open , up to more powerful sides of life");
					break;
				case 2:
					strcpy(fourtne, "Your continued efforts, have brought you great harmony");
					break;
				}
				
				break;
				case 6:
					
					switch(Guess)
					{
					case 0:
					       
						strcpy(fourtne, "you are so perfect, you even allow yourself to believe your not, because all you are is what you think");
						break;
					case 1:
						strcpy(fourtne, "you must learn to break through, these bariers, to reach the highest levels of thought");
						break;
					case 2:
						strcpy(fourtne, "you are the master within. purify your channel to move upward");
						break;
					}
					case 7:
						switch(Guess)
						{
						case 0:
						strcpy(fourtne, "emotional upset, is exisiting within your life");
							break;
						case 1:
							strcpy(fourtne, "your mind is begining to expand. continue you in your important work!");
							break;
						case 2:
							strcpy(fourtne, "your answer, is based off your inner knowing, which guides you");
							break;
						}
						
						
						break;

						case 8:
						
						switch(Guess)
						{
						case 0:
						strcpy(fourtne, "you must remember, everything is this way becasue your made it like that");
							break;
						case 1:
							strcpy(fourtne, "allow yourself to open, to higher truths and knowing!");
							break;
						case 2:
							strcpy(fourtne, "meditation is the key, you must continue in your important work!");
							break;
						}
						
							break;

						case 9:

						switch(Guess)
						{
						case 0:
						strcpy(fourtne," you must free yourself from the burdens of negitivity");
							break;
						case 1:
							strcpy(fourtne, "your mind, now hears the sounds");
							break;
						case 2:
							strcpy(fourtne, "highly determitable responses have been issued, your level has issued you this one, be thankful and move on");
							break;
						}
						
							break;

						case 10:
						
						switch(Guess)
						{
						case 0:
						strcpy(fourtne, "emotional upset, is still exisiting within your life");
							break;
						case 1:
							strcpy(fourtne, "you are becoming one");
							break;
						case 2:
							strcpy(fourtne, "all i have to say is I am, what i believe, I am . Love ");
							break;
						}
						
							break;

	}

	
	
}
int randbytime(int size)
{

	int Rt;
 
  TMotherRandomGenerator RG;    // define random number generator

  RG.RandomInit(time(0));       // use time as random seed

  RG.SetInterval(0, size);        // set interval for integer output

  Rt = RG.iRandom();

 return Rt;
}

int GetGuess(int CorrectGuess)
{


	int GuessType = 0;

	 if((CorrectGuess > 0) && (CorrectGuess < 4))
		{
		
		GuessType = 0;
			
		}
        
		if((CorrectGuess >= 4) && (CorrectGuess < 7))
		{

		GuessType =	0;

		}
        
		
		if((CorrectGuess >= 7) && (CorrectGuess < 14))
		{

		GuessType =	1;
			
		}
		if((CorrectGuess >= 14) && (CorrectGuess < 19))
		{
			GuessType = 1;

		}

		if((CorrectGuess >= 19))
		{
         	GuessType = 2;

		}

		return GuessType;
}

int eRate()
{

	// Algorithim to Return How In Length Measurment Of How Long it Took
	// 0 Being fast
	// 1 Being Medium
	// 2 Being Slow

	// Rate Based off Full * Individual Divided into 3 Sections, BASED OFF TOTAL TIME

	int Full = 0;

	for(int i = 0; i < 24; i++)
	{

		Full = Full + EnterySum[i];
	}

    int Indiv = 0;
    int Low = 0;
	int Med = 0;
	int High = 0;

	 
	for(int l = 0; l < 24; l++)
	{

		if(EnterySum[i] > Low)
		{

			Indiv = Indiv + 1;

		}
		if(EnterySum[i] > Med)
		{

			Indiv = Indiv + 5;
		}

		if(EnterySum[i] > High)
		{

			Indiv = Indiv + 10;
		}
	}

	int Final = 0;
	Final = Full * Indiv / 2;

	// Based Return Value as 0 , 1 , 2
	int Complete = 0;

	return Complete;
}

int ifinsane()
{

	int sanity = 0;

	if(Count5 == 0)
	{
    	sanity = 0; // Remember
	}
	if(Count5 > 2)
	{
		sanity = 1; // Catch On
	}

	if(Count5 > 4)
	{
		sanity = 2; // Stupid
	}
	return sanity;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -