1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
//Justin Wright
//COSC 1430
//This program is a roulette simulation, designed to be used for online gambling.
#include <iostream>
#include <iomanip>
#include <Windows.h>
#include <string>
#include <ctime>
using namespace std;
//Function Prototypes
void welcome();
double getBalance();
void displayTable();
void rouletteTableFunction();
int main()
{
//Variable Declarations
int winningNumber = 0;
double balance = 0;
double bet = 0;
//Random Number Seed
srand(static_cast<int>(time(0)));
winningNumber = 0 + rand() % (36 - 0 + 1);
cout << fixed << setprecision(2);
welcome ();
system ("Pause");
system("CLS");
balance = getBalance();
system ("Pause");
system("CLS");
displayTable();
system ("pause");
return 0;
}
//Welcome Screen Function
void welcome()
{
cout << (" \n");
cout << ("******* ****** * * * ***** ******* ******* ***** \n");
Sleep(500);
cout << ("* * * * * * * * * * * \n");
Sleep(500);
cout << ("******* * * * * * * * * * \n");
Sleep(500);
cout << ("* * * * * * * ***** * * ***** \n");
Sleep(500);
cout << ("* * * * * * * * * * * \n");
Sleep(500);
cout << ("* * ****** ****** ****** ***** * * ***** ");
cout << (" ");
}
double getBalance()
{
double balance = 0.0;
cout << "Welcome to the table champ." << endl << "Please enter the amount of cash you wish to play with:$";
cin >> balance;
cout << endl << "Your balance is: $" << balance << endl;
return balance;
}
void displayTable()
{
string rouletteTable [2][18] =
{{"1", "3", "5", "7", "9", "12", "14", "16", "18", "19", "21", "23", "25", "27", "30", "32", "34", "36"},
{"2", "4", "6", "8", "10", "11", "13", "15", "17", "20", "22", "24", "26", "28", "29", "31", "33", "35"}};
int row = 0;
int column = 0;
while (column <= 1)
{
while (row <= 17)
{
cout << rouletteTable[row][column] << endl;
row +=1;
}//end while
column +=1;
row = 0;
}//end while
|