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 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
|
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <string>
using namespace std;
int main()
{
char inichoice, color, EoO, playagain;
char wheelcolor;
int spinnum = 0, num = 0;
do //cause it's gotta loop later if they wish for so
{
cout << "What type of bet you want yo?\n (S = Single number, R = Red, B = Black, E = Even, O = Odd) ";
cin >> inichoice;
//start of program where initial choice is made
srand(time(0));
spinnum = rand( ) % 37;
//DEBUG
//spinnum = 13;
//DEBUG
//defining the lucky number! #gamblingaddiction #whywegottadodisman #takemymoneyandkeepit
if ((spinnum >= 1 && spinnum <=10) || (spinnum >= 19 && spinnum <= 28))
{
if (spinnum % 2 == 0)
{
wheelcolor = 'B' | 'b';
EoO = 'E' | 'e';
}
else if (spinnum % 2 == 1)
{
wheelcolor = 'R' | 'r';
EoO = 'O' | 'o';
}
}
// this if statement helps determine the color and the nature (even or odd) of the number
if (spinnum == 0)
wheelcolor = 'G';
// 0 is the exception in roulette and that's defined here
if ((spinnum >= 11 && spinnum<=18) || (spinnum >= 29 && spinnum <= 36))
{
if (spinnum % 2 == 0)
{
wheelcolor = 'R' | 'r';
EoO = 'E'| 'e';
}
else if (spinnum % 2 == 1)
{
wheelcolor = 'B' | 'b';
EoO = 'O' | 'o';
}
}
//this is the last of the statements used to define color and nature
//needed so many because roulette is weird and the colors switch around
//DEBUG
cout << endl << spinnum << " " << wheelcolor << endl;
//DEBUG
if (inichoice == 'R' || inichoice == 'r')
{
if (inichoice == wheelcolor)
{
cout << "The wheel is spinning...and landed on " << wheelcolor << "." << endl;
cout << "We have a winner in the house!";
}
else
{
cout << "The wheel is spinning...and landed on " << wheelcolor << "." << endl;
cout << "You tried your best, loser.";
}
}
else if (inichoice == 'B' || inichoice == 'b')
{
if (inichoice == wheelcolor)
{
cout << "The wheel is spinning...and landed on " << wheelcolor << "." << endl;
cout << "Well would you gosh diddly darn look at this! You won!";
}
else
{
cout << "The wheel is spinning...and landed on " << wheelcolor << "." << endl;
cout << "Haha, you suck at this!";
}
}
//This if statement is the block of code that runs if the player picks a color
else if (inichoice == 'S' || inichoice == 's')
{
cout << "Enter a number between 0 and 36: ";
cin >> num;
if (spinnum == num)
{
cout << "The wheel is spinning...and landed on " << spinnum << endl;
cout << "Winner winner chicken dinner!";
}
else
{
cout << "The wheel is spinning.. and landed on " << spinnum << endl;
cout << "You are the champi--LOSER, my friieenndd~";
}
}
//This block of code plays when the player enters a single number
else if (inichoice == 'E' || inichoice == 'e')
{
if (spinnum % 2 == 0)
{
cout << "The wheel is spinning...and landed on " << spinnum << endl;
cout << "Lucky ducky! You win!";
}
else
{
cout << "The wheel is spinning...and landed on " << spinnum << endl;
cout << "Haha. Wow. You lost...Stop wasting your time here!";
}
}
//This block of code plays when they bet on even numbers
else if (inichoice == 'O' || inichoice == 'o')
{
if (spinnum % 2 == 1)
{
cout << "The wheel is spnning...and landed on " << spinnum << endl;
cout << "Congratulations, you won! Wow! I knew you had it in you!" << endl;
}
else
{
cout << "Spin, spin, spin the wheel along... " << spinnum << endl;
cout << "How you managed to lose is beyond me, but I bet this is why you can't have nice things..." << endl;
}
}
//this block of code plays when they bet on odd numbers
// all this crazy stuff above is for each different type of bet and what happens after the user places it
else
cout << "This isn't valid. Stop making this longer than it has to be :(";
//here's the statement that makes the user regret living when they enter something wrong
cout << "\n\nWanna play again? (Y for yes) ";
cin >> playagain;
cout << endl;
}
while (playagain == 'y' || playagain == 'Y');
//these lines above restart the loop if the play wants to go again
cout << "\nFINALLY, leave me alone already!";
return 0;
}
|