View Single Post
Old 05-11-2005, 12:54 PM   #2 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
ISO C++ never heard of <windows.h>. Furthermore, it is not clear how the a deck and a card are internally represented.

However, in general, if you are using a STL container, or C-style arrays, you may wish to implement something like this:
Code:
  void Deck::Shuffle() 
  {
    static bool seeded;
    if (!seeded)
    {
      srand(time(0));
      seeded = true;
    }
    std::random_shuffle(theDeck.begin(), theDeck.end());
  }
In general, there's a lot to improve on your code, but you have to remove the luxury stuff like the Windows API header and calls. Then we could take a better peek at to implement the code with more quality.
__________________
Valmont is offline   Reply With Quote