Randomize sized maps
I know it was posted here before but I can''t seem to find it. How do you create a random sized map?
"I can't work like this! Where are my fuzzy dice?"
"I can't work like this! Where are my fuzzy dice?"
#include <map>using namespace std;void makeRandomMap (map<int, int>& random_map){ random_map.clear (); const int mapsize = rand (); for (int i=0; i<mapsize; i++) random_map.insert (map<int,int>::value_type (rand (), rand ()));}
There ya go, can't get more random than that.
Edited by - Stoffel on October 12, 2000 7:38:30 PM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement