So if your like me and you played open beta expecting to play a certain class, only to discover that you pretty much liked every single class you played, then you may enjoy this application.
It pretty much picks a random number between 1 and 5, each number is assigned to a different class, and depending on which number it rolled, it spits out which class you should play, completely random! Sure you could just roll a dice, or use your brain to determine what you want to play, but I was bored and it's fun to see what it chooses for you.
Looking at your code, I'd suggest taking a look at the switch statement. IE, you could write:
cout << "You should create a: ";
switch (die)
{
case 1:
cout<<"Barbarian";
break;
case 2:
cout<<"Monk";
break;
case 3:
cout<<"Wizard";
break;
case 4:
cout<<"Demon Hunter";
break;
default:
cout<<"Witch Doctor";
}
cout << "!" << endl << endl;
Ignore the wierd tab spacing because the editor on these forums is really awful for any sort of formatting. :/
Also, while it doesn't matter here, if you ever get into any sort of scientific computing or monte carlo simulations, make sure you never, ever use the built-in random number generator as it's really, really bad.
Rollback Post to RevisionRollBack
...and if you disagree with me, you're probably <insert random ad hominem attack here>.
So if your like me and you played open beta expecting to play a certain class, only to discover that you pretty much liked every single class you played, then you may enjoy this application.
It pretty much picks a random number between 1 and 5, each number is assigned to a different class, and depending on which number it rolled, it spits out which class you should play, completely random! Sure you could just roll a dice, or use your brain to determine what you want to play, but I was bored and it's fun to see what it chooses for you.
link:
http://www.mediafire.com/?86u7gwog4ke0o67
screenshot:
I used C++ to create this, I am a beginner so my code probably isn't as intelligent or efficient as it could be. I will provide the source code below:
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
srand(time(0));
int randomNumber = rand();
int die = (randomNumber % 5) + 1;
cout << "WELCOME TO THE DIABLO 3 CHARACTER SELECTER!" << endl;
cout << "" << endl << endl;
if (die == 1)
cout << "You should create a: Barbarian!" << endl;
if (die == 2)
cout << "You should create a: Monk!" << endl;
if (die == 3)
cout << "You should create a: Wizard!" << endl;
if (die == 4)
cout << "You should create a: Demon Hunter!" << endl;
if (die == 5)
cout << "You should create a: Which Doctor!" << endl;
cout << "" << endl << endl;
system ("pause");
return 0;
}
------------------------------------------------------------------------------
If you have any tips or advice for me I'd appreciate it.
I completely understand that. I have posted the code above for anyone who would rather compile it themselves.
If you're feeling extra nerdy you could roll a 5-sided die:
On a side note, I'm flattered that people think I'm good enough at programming to create harmful things
Ignore the wierd tab spacing because the editor on these forums is really awful for any sort of formatting. :/
Also, while it doesn't matter here, if you ever get into any sort of scientific computing or monte carlo simulations, make sure you never, ever use the built-in random number generator as it's really, really bad.