View Single Post
Old 05-18-2004, 01:10 PM   #80 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
Quote:
Originally posted by dirs
Hi Valmont!
I have submitted my assignment today! Thanks a lot for the help.
Would try to do more and more C++ programming! Do u know about good tutorials on internet on c++?
Did you download the latest code?
The one with this in it:
Code:
bool BlackJack::CalcDealerDecision()
{
	int good = 0;	
	int space = (21 - theDealer.m_nPoints);

	if(space > 0)
	{
		for(unsigned i=0; i < m_Deck.getDeck().size(); ++i)
		{
			int cardvalue = static_cast<int>(m_Deck[i].getValue());
			if(cardvalue > 10 )
			{
				if(cardvalue < 14)
					cardvalue = 10;
				else
					cardvalue = 1;
			}
			if((cardvalue % 14) <= (space) )
				good++;
		}
		cout<<(good / static_cast<float>(m_Deck.getDeck().size())) * 100<<"%"<<endl;
		if(good / static_cast<float>(m_Deck.getDeck().size()) > 0.5)
			return true;
	}
	return false; 
}
__________________
Valmont is offline   Reply With Quote