ZM Random map generator [Source Code]

Hey guys,

during the last years, people were so bored to choose, which zm map they should play.

So I decided to code myself a random map generator in c++. You can run this code snippet in the "Mobile C" App from the appstore for instance.


Obviously, you can use it for everything and not just zm maps. Like trying it out makes u better understand the black market since it really shatters your head sometimes, though it is basically just Sir Random, who let u win or lose. ;)

Have fun:) :*


#include <iostream>
#include <stdio.h> /* printf, scanf, puts, NULL */
#include <stdlib.h> /* srand, rand */
#include <time.h> /* time */

using namespace std;

int main()
{
int randomMap;

/* initialize random seed: */
srand (time(NULL));

/* generate random number: */
randomMap = rand() % 15 + 0;
cout << randomMap;

/* Array */
std::string maps[16] = { "Unearth",
"Biohazard",
"Venice",
"Valkyrie",
"Crater",
"Dinner Theater",
"EMD Lab",
"Devastated City",
"Final Arena",
"Crater Dawn",
"Elemental Temple",
"Shattered Station",
"Shipyard",
"Battleship",
"Deadly Tower",
"Fatal Canyon"
};

cout << "\n"+ maps[randomMap];


}

Comments