BPT Forum

BASIC Programming Tutorial Forum


It is currently Thu Sep 09, 2010 5:56 am

All times are UTC - 6 hours [ DST ]


Featured Links: Entrance to Medical Schools @ schoolmath.info free webproxy @ Caribbean Medical Schools


Post new topic Reply to topic  [ 2 posts ] 
Author Enter your Message here
 Post subject: blak5
PostPosted: Mon Jun 16, 2008 4:37 pm 
Offline
PROgram3r

Joined: Mon Jun 16, 2008 3:52 pm
Posts: 6
pPlayer->Push();
}
}

for(pPlayer=M_Player.begin();pPlayer!=m_Player.end();
==pPlayer)
pPlayer->Clear();
m_House.Clear();
}

ostream& operator<<(ostream& os,const Card& aCard);
ostream& operator<<(ostream& os, const GenericPlayer& aGenericPLayer);

int main()
{
cout<<"\t\tWelcome to blackjack\n\n";

int numPlayer=0;
while(numPlayers<1||numPlayers>7)
{

cout<<"how many players?(1-7:";
cin>>numPlayers;
}

vector<string>names;
string name;
for(int i=0;i<numPlayers;++i)
{
vout<<"enter a name:";
cin>>name;
names.push_back(name);
}
cout<<endl;

Game aGame(names);
char again = 'y';
while(again !='n'&&again!= 'N')

{
aGame.Play();
cout<<"\ndo you want to play again?\n";
cin again;
}
return 0;
}

ostream&operator<<(ostream& os, const Card& aCard)
{
const string RANKS[]= {"0", "A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"};
const string SUITS[]={"c", "d", "h", "s"};

if(aCard.m_IsFaceUp)
os<<RANKS[aCard.m_Rank]<<SUITS[aCard.m_Suit];
else
os<<"XX";

return os;

ostream& operator<<(ostream& os, const GenricPlayer& aGenericPlayer)
{
os<<aGenricPlayer.m_Name<<":\t";

vector<Card*>::const_iterator pCard;
if(!aGenericPlayer.m_Cards.begin();
pCard !=aGenericPlayer.m_Cards.end();++pCards)
osMM*(*pCard<<"\t";

if(aGenericPlayer.GetTotal()1!=0)
cout<<"("<<aGenricPlayer.GetTotal()<<")";
}
else
{
os<<"<empty>";
}

return os;
}


Top
 Profile E-mail  
 
 Post subject: Re: blak5
PostPosted: Fri Feb 06, 2009 10:41 pm 
Offline
Site Admin
User avatar

Joined: Mon Dec 24, 2007 1:14 pm
Posts: 18
Apparantly this is a BlackJack game.
It's spanned across multiple posts by Hale.
I think it's written in C. Has anyone tried it out?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Skin by Lucas Kane
Facebook Like Buttons by SVmods.
Hosted by Freeforum.ca, get your free forum now! TOS | Support Forums | Report a violation
Guaranteed Entrance to Medical Schools - eTripTips - Your Travel Source - Vietnamese Business Directory
Site Meter
MultiForums powered by echoPHP phpBB MultiForums