Forum: C++ Nov 27th, 2005 |
| Replies: 15 Views: 4,682 What I'm saying is that you shouldn't try to make someone feel bad for not knowing what you already learned. There once was a time where you were the same way. |
Forum: C++ Nov 27th, 2005 |
| Replies: 15 Views: 4,682 If you think about 5 minutes before you knew this trick this post wouldn't be very helpful. |
Forum: C++ Nov 23rd, 2005 |
| Replies: 5 Views: 2,467 |
Forum: C++ Nov 23rd, 2005 |
| Replies: 5 Views: 2,467 That makes much more sense. Thank you.
Bye the way, I edited and apparently added a couple of bugs with my first algorithm. Sorry. This version should work:
// If this doesn't work, then... |
Forum: C++ Nov 23rd, 2005 |
| Replies: 5 Views: 2,467 The teammates was just an illustration. I'm actually making a game that has eight different kind of spaces represented by an unsigned integer.
struct space {
unsigned int piece:3;
/* Three... |
Forum: C++ Nov 23rd, 2005 |
| Replies: 5 Views: 2,467 You created a bunch of random numbers, but say you don't want a bunch of random numbers exactly. Say you have ten members of a team and you want to give them a random position represented by 0 to 9.... |
Forum: C++ Nov 23rd, 2005 |
| Replies: 30 Views: 907,568 This will shuffle integers aound anyway you like. So if you had an array that represented a deck of cards called "deck[]", you would call the function like this:
shuffle(&deck, 52, 0, 0);
This... |