Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

a journal entry

a journal entry

mozie
Not your journal. · · 1 min read
1,061 0
Hmm, perhaps I was influenced by outside sources without their disgression. Whatever it was it made me take my shuffle method, and redesign it to work with operator* along side of the operator/. So now I can split the deck another time easily and clearly in the code.
void	Deck::Shuffle(){	unsigned int sz = numCards;	vector D;	vector E;	vector F;	srand((unsigned)time(NULL));	unsigned int ra = 5 + (rand() % 3);	for(unsigned int h = 0;h < ra; ++h)	{		*this = *this << (1 + (rand() % (sz/4)));		D = *this / 2;		E = D[0] / 2;		F = D[1] / 2;		D[1] = F[0] * F[1];		D[0] = E[0] * E[1];		*this = D[0] * D[1];	}}

I think it looks better, maybe it works better. I read on some other website about Blackjack Gold, they had this long list of features that made it more 'realistic gameplay'. So I guess I wanted to make my shuffle just a little more flexable than it was. That game also had a nice system where you could design your own stratagy method for playing, and let the computer run the hands. It would give you the obviously desired information of weither or not your stratagy paid off. I would like to do something like that if I keep this going, but I really dont know how to let that stuff be configured realtime. Either way, I am having fun.

Discussion

Loading comments...