Example of how to get a random number in the range of six and return a value based upon it. Please Rate/Comment/Report Bugs

#include <iostream>
#include <cstdlib>

using namespace std;

void gamefunc();

int main(void)
{
    gamefunc();
    return 0;
}

void gamefunc()
{
   int dice = (rand()%6)+1;

   /*** Now we see what you rolled ***/
   if(dice == 1)
     {
         cout << "*********\n";
         cout << "*       *\n";
         cout << "*   *   *\n";
         cout << "*       *\n";
         cout << "*********\n";

     }

        if(dice == 2)
         {
         cout << "*********\n";
         cout << "* *     *\n";
         cout << "*       *\n";
         cout << "*     * *\n";
         cout << "*********\n";

         }

      if(dice == 3)
         {
         cout << "*********\n";
         cout << "* *     *\n";
         cout << "*   *   *\n";
         cout << "*     * *\n";
         cout << "*********\n";

         }
      if(dice == 4)
         {
         cout << "*********\n";
         cout << "* *   * *\n";
         cout << "*       *\n";
         cout << "* *   * *\n";
         cout << "*********\n";

         }

      if(dice == 5)
         {
         cout << "*********\n";
         cout << "* *   * *\n";
         cout << "*   *   *\n";
         cout << "* *   * *\n";
         cout << "*********\n";

         }
      if(dice == 6)
         {
          cout << "*********\n";
          cout << "* *   * *\n";
          cout << "* *   * *\n";
          cout << "* *   * *\n";
          cout << "*********\n";
         }
}

Simplify.

Use a case statement for handling each side of the die.
if you insist on if-then, then use if-elseif-else-

Shouldn't you return the value you rolled?

Or why go through all that pain. Use a table!

char *Dice[] =
{
     "*********\n" \
     "*       *\n" \
     "*   *   *\n" \
     "*       *\n"  \
     "*********\n",

    "*********\n" \
    "* *     *\n" \
    "*       *\n" \
    "*     * *\n" \
    "*********\n",

    "*********\n" \
    "* *     *\n" \
    "*   *   *\n" \
    "*     * *\n" \
    "*********\n",

   "*********\n" \
   "* *   * *\n" \
   "*       *\n" \
   "* *   * *\n" \
   "*********\n",

   "*********\n" \
   "* *   * *\n" \
   "*   *   *\n" \
   "* *   * *\n" \
   "*********\n",

   "*********\n" \
   "* *   * *\n" \
   "* *   * *\n" \
   "* *   * *\n" \
   "*********\n"
};

  n = rnd() % 6;

  cout << Dice[ n ];

Correct me if I'm wrong, but wouldn't this be pseudorandom and return the exact same series every time it's run? The way I was taught was to use a seed like this....

#include <ctime>

int seed = static_cast<int>(time(0));
srand(seed);

int randomNumber = minimum + rand() % (maximum - minimum + 1);