Skip to main content
GameDev.net gamedev.net
🔒 Locked

Randomize sized maps

Started by dark chrono4 Oct 12, 2000 at 6:32 PM 0 replies 200+ views
Original Post
dark chrono4
dark chrono4
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?"
Stoffel
Stoffel
        
#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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.