Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

a journal entry

Sign in to follow this  


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;

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.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!