Jump to content
  • Advertisement
Sign in to follow this  
Bluseed

FullHouse Poker Snippet!!

This topic is 4436 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

C&C maybe, im just wondering if this is looking good, am i doing anything right, it feels like it, Is there something i could improve on?? I would really like to know, i just finished this snippet, took about 2 hours, sheesh.... so plz let me know. Im coding the essentials right now, and later on hope to implement it into DX!
 
void CheckFullHouse()
{
	
	printf("\n");

	int HCounter = 1;

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

		if (Hand == Hand[i - 1] ) 

		{ 
			HalfFullHousebln = true;		
			printf("HCounter %d\n",HCounter);
			++HCounter;
		}
		else
		{
			if (Hand != Hand[i + 1])
			{
				HalfFullHousebln = false;
				HCounter = 1;
				printf("Not True\n\n");
				break;				
			}
		
		}

	}	
			printf("HCounter %d\n\n", HCounter);
		        printf("HalfTrue\n\n");

			if (HCounter == 2)
			{
				int H2Counter = 3;
				printf("H2Counter %d\n", H2Counter);

				for (i = 3; i < 5; ++i)
				{
					if (Hand == Hand[i - 1] ) 
					{
						FullHousebln = true;		
						++H2Counter;
					     printf("H2Counterd\n",H2Counter);						
					}
					else
					{
						HalfFullHousebln = false;
					}
				}
			
			if (HCounter == 2 && H2Counter == 5)
			{
				printf("\n");
				printf("	Full House!\n");		
			}

		}
		else
		{
			int H2Counter = 4;
			printf("H2Counter %d \n", H2Counter);

			for (i = 4; i < 5; ++i)
				{
					if (Hand == Hand[i - 1] ) 
					{
						FullHousebln = true;		
						++H2Counter;

					printf("H2Counter %d\n\n",H2Counter);
						
					}
					else
					{
						HalfFullHousebln = false;
					}
				}

			if (HCounter == 3 && H2Counter == 5)
			{
				printf("	Full House!\n");				
			}
		}

	

ResetBool();
}

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!