Advertisement
Guest User

Roulette Project

a guest
Apr 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.60 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <math.h>
  4. #include <vector>
  5. using namespace std;
  6.  
  7. class Wheel {
  8. public:
  9. int getNumber() {
  10. return numResult;
  11. }
  12. string getColor() {
  13. return colorResult;
  14. }
  15. void setNumber(int N) {
  16. numResult = N;
  17. }
  18. void setColor(string C) {
  19. colorResult;
  20. }
  21. Wheel ();
  22. Wheel (int, string);
  23. private:
  24. int numResult;
  25. string colorResult;
  26. };
  27.  
  28. Wheel::Wheel () {
  29. numResult = 0;
  30. colorResult = "green";
  31. }
  32.  
  33. Wheel::Wheel (int N, string C) {
  34. numResult = N;
  35. colorResult = C;
  36. }
  37.  
  38. class Bet {
  39. public:
  40. /*
  41. friend istream& operator>>(istream &input, Bet &b ) {
  42. input >> b.x;
  43. return input;
  44. }
  45. friend ostream& operator<<(ostream &output, const Bet &b ) {
  46. output << "$" << b.x;
  47. return output;
  48. }
  49. */
  50. int getP() {
  51. return price;
  52. }
  53. vector<int> getNums() {
  54. return nums;
  55. }
  56. int getType() {
  57. return betType;
  58. }
  59. string getTable() {
  60. return tableType;
  61. }
  62. int getSpecific() {
  63. return betSpecific;
  64. }
  65. void setB(int P) {
  66. price = P;
  67. }
  68. void setNums(vector<int> Ns) {
  69. nums = Ns;
  70. }
  71. void setType(int T) {
  72. betType = T;
  73. }
  74. void setTable(string Ta) {
  75. tableType = Ta;
  76. }
  77. void setSpecific(int S) {
  78. betSpecific = S;
  79. }
  80. Bet ();
  81. Bet (int, vector<int>, int, string, int);
  82. private:
  83. int price;
  84. vector<int> nums;
  85. int betType;
  86. string tableType;
  87. int betSpecific;
  88. };
  89.  
  90. Bet::Bet () {
  91. price = 0;
  92. nums = {0};
  93. betType = 0;
  94. tableType = "American";
  95. betSpecific = 0;
  96. }
  97.  
  98. Bet::Bet (int P, vector<int> Ns, int T, string Ta, int S) {
  99. price = P;
  100. nums = Ns;
  101. betType = T;
  102. tableType = Ta;
  103. betSpecific = S;
  104. }
  105.  
  106. void tableChoice(Bet b1) {
  107. int choice;
  108. int cont = 0;
  109. do {
  110. cout << "What type of table do you want to play on today? \n 1. European \n 2. American" << endl;
  111. cin >> choice;
  112. if (choice == 1) {
  113. b1.setTable("European");
  114. cont = 1;
  115. } else if (choice == 2) {
  116. b1.setTable("American");
  117. cont = 1;
  118. } else {
  119. cout << "This is not an option. Please make another." << endl;
  120. cont = 0;
  121. }
  122. } while (cont = 0);
  123. }
  124.  
  125. void betPayout(Bet b1) {
  126. int payout;
  127. int cont = 0;
  128. do {
  129. if (b1.getTable() == "American") {
  130. cout << "What type of bet do you want to make? \n 1. Straight Up (Any single number including 0, 00, and 1-36) \n\t Payout: 35 to 1" << endl;
  131. } else {
  132. cout << "What type of bet do you want to make? \n 1. Straight Up (Any single number including 0, and 1-36) \n\t Payout: 35 to 1" << endl;
  133. }
  134. cout << " 2. Row (Between 0 and 00, Only for American tables) \n\t Payout: 17 to 1 \n 3. Split (Bewteen any two numbers, vertical or horizontal) \n\t Payout: 17 to 1" << endl;
  135. cout << " 4. Street (One whole row of numbers, i.e. 1,2,3) \n\t Payout: 11 to 1" << endl;
  136. cout << " 5. Corner (Between four numbers, i.e. 1,2,4,5) \n\t Payout: 8 to 1" << endl;
  137. cout << " 6. Top Line or Basket (Includes 0, 00, 1, 2, and 3) \n\t Payout: 6 to 1" << endl;
  138. cout << " 7. Six Line (Between two rows of numbers, i.e. 1,2,3 and 4,5,6)\n\t Payout: 5 to 1" << endl;
  139. cout << " 8. 1st Column (1, 4, 7, ...., 34) \n\t Payout: 2 to 1 \n 9. 2nd Column (2, 5, 8, ...., 35) \n\t Payout: 2 to 1 \n 10. 3rd Column (3, 6, 9, ...., 36) \n\t Payout: 2 to 1" << endl;
  140. cout << " 11. 1st Dozen (1 through 12) \n\t Payout: 2 to 1 \n 12. 2nd Dozen (13 through 24) \n\t Payout: 2 to 1 \n 13. 3rd Dozen (25 through 36) \n\t Payout: 2 to 1" << endl;
  141. cout << " 14. Odd (1, 3, 5, ...., 35) \n\t Payout: 1 to 1 \n 15. Even (2, 4, 6, ...., 36) \n\t Payout: 1 to 1 \n 16. Red (1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36) \n\t Payout: 1 to 1" << endl;
  142. cout << " 17. Black (2, 4, 6, 8, 10, 11, 13, 15, 17, 20, 22, 24, 26, 28, 29, 31, 33, 35) \n\t Payout: 1 to 1 \n 18. 1 to 18 \n\t Payout: 1 to 1 \n 19. 19 to 36 \n\t Payout: 1 to 1" << endl;
  143. cin >> payout;
  144. if (payout == 1) {
  145. b1.setType(1);
  146. b1.setSpecific(payout);
  147. cont = 1;
  148. } else if (payout == 2) {
  149. if (b1.getTable() == "American") {
  150. b1.setType(2);
  151. b1.setSpecific(payout);
  152. cont = 1;
  153. } else {
  154. cout << "The selection you made was not valid since you are playing on a European table. Please make another selection." << endl;
  155. cont = 0;
  156. }
  157. } else if (payout == 3) {
  158. b1.setType(3);
  159. b1.setSpecific(payout);
  160. cont = 1;
  161. } else if (payout == 4) {
  162. b1.setType(4);
  163. b1.setSpecific(payout);
  164. cont = 1;
  165. } else if (payout == 5) {
  166. b1.setType(5);
  167. b1.setSpecific(payout);
  168. cont = 1;
  169. } else if (payout == 6) {
  170. b1.setType(6);
  171. b1.setSpecific(payout);
  172. cont = 1;
  173. } else if (payout == 7) {
  174. b1.setType(7);
  175. b1.setSpecific(payout);
  176. cont = 1;
  177. } else if ((payout == 8) || (payout == 9) || (payout == 10) || (payout == 11) || (payout == 12) || (payout == 13)) {
  178. b1.setType(8);
  179. b1.setSpecific(payout);
  180. cont = 1;
  181. } else if ((payout == 14) || (payout == 15) || (payout == 16) || (payout == 17) || (payout == 18) || (payout == 19)) {
  182. b1.setType(9);
  183. b1.setSpecific(payout);
  184. cont = 1;
  185. } else {
  186. cout << "The selection you made was not valid. Please make another selection." << endl;
  187. cont = 0;
  188. }
  189. } while (cont == 0);
  190. }
  191.  
  192. void getNumbersAndPrice(Bet b1) {
  193. vector<int> numbers;
  194. int amount;
  195. int currentNum;
  196. int currentNum2;
  197. int currentNum3;
  198. int currentNum4;
  199. string colorChoice;
  200. int cont;
  201. if (b1.getSpecific() == 1) {
  202. cout << "Chose the number you want to bet on.";
  203. cin >> currentNum;
  204. numbers.push_back(currentNum);
  205. } else if (b1.getSpecific() == 2) {
  206. numbers = {0, 00};
  207. } else if (b1.getSpecific() == 3) {
  208. cout << "Chose the first number you want to bet on.";
  209. cin >> currentNum;
  210. numbers.push_back(currentNum);
  211. cont = 0;
  212. do {
  213. cout << "Now chose the second number you want to bet on. Remember, it has to be either horizontally connected or vertically connected to your first number.";
  214. cin >> currentNum2;
  215. if ((currentNum2 == currentNum + 1) || (currentNum2 == currentNum + 3) || (currentNum2 == currentNum - 1) || (currentNum2 == currentNum - 3)) {
  216. numbers.push_back(currentNum2);
  217. }
  218. } while (cont = 0);
  219. } else if (b1.getSpecific() == 4) {
  220. cout << "Which row would you like to bet on? (1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34)";
  221. cin >> currentNum;
  222. cont = 0;
  223. do {
  224. if ((currentNum == 1) || (currentNum == 4) || (currentNum == 7) || (currentNum == 10) || (currentNum == 13) || (currentNum == 16) || (currentNum == 19) || (currentNum == 22) || (currentNum == 25) || (currentNum == 28) || (currentNum == 31) || (currentNum == 34)) {
  225. numbers.push_back(currentNum);
  226. numbers.push_back(currentNum + 1);
  227. numbers.push_back(currentNum + 2);
  228. cont = 1;
  229. } else {
  230. cout << "The number you selected is not the start of a row. Please make another selection.";
  231. }
  232. } while (cont == 0);
  233. } else if (b1.getSpecific() == 5) {
  234. cont = 0;
  235. do {
  236. cout << "Select the four numbers that are going to be part of your bet. Remember that these numbers all have to share a corner.";
  237. cin >> currentNum;
  238. cin >> currentNum2;
  239. cin >> currentNum3;
  240. cin >> currentNum4;
  241.  
  242. } while (cont = 0);
  243. } else if (b1.getSpecific() == 6) {
  244. numbers = {0, 00, 1, 2, 3}
  245. } else if (b1.getSpecific() == 7) {
  246. cont = 0;
  247. do {
  248. cout << "Chose two rows you want to place your bet between. (1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34)";
  249. cin >> currentNum;
  250. cin >> currentNum2;
  251.  
  252. } while (cont = 0);
  253. } else if (b1.getSpecific() == 8) {
  254. numbers = {1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34};
  255. } else if (b1.getSpecific() == 9) {
  256. numbers = {2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35};
  257. } else if (b1.getSpecific() == 10) {
  258. numbers = {3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36};
  259. } else if (b1.getSpecific() == 11) {
  260. numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
  261. } else if (b1.getSpecific() == 12) {
  262. numbers = {13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24};
  263. } else if (b1.getSpecific() == 13) {
  264. numbers = {25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36};
  265. } else if (b1.getSpecific() == 14) {
  266. numbers = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35};
  267. } else if (b1.getSpecific() == 15) {
  268. numbers = {2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36};
  269. } else if (b1.getSpecific() == 16) {
  270. numbers = {1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36};
  271. } else if (b1.getSpecific() == 17) {
  272. numbers = {2, 4, 6, 8, 10, 11, 13, 15, 17, 20, 22, 24, 26, 28, 29, 31, 33, 35};
  273. } else if (b1.getSpecific() == 18) {
  274. numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18};
  275. } else {
  276. numbers = {19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36};
  277. }
  278. }
  279.  
  280. bool continueOrnot(string answer) {
  281. if(answer == "Y") {
  282. cout<<"ggg";
  283. //flavortext
  284. }
  285. else if(answer == "y") {
  286. cout<<"ggg";
  287. //flavortext
  288. }
  289. else if(answer == "Yes") {
  290. cout<<"ggg";
  291. //flavortext
  292. }
  293. else if(answer == "yes") {
  294. cout<<"ggg";
  295. //flavortext
  296. }
  297. else if(answer == "N") {
  298. cout<<"ggg";
  299. //flavortext
  300. }
  301. else if(answer == "n") {
  302. cout<<"ggg";
  303. //flavortext
  304. }
  305. else if(answer == "No") {
  306. cout<<"ggg";
  307. //flavortext
  308. }
  309. else if(answer == "no") {
  310. cout<<"ggg";
  311. //flavortext
  312. } else {
  313. cout<<"Sorry I didnt quite catch that, how about you try again";
  314. }
  315. }
  316.  
  317. int main() {
  318. /*
  319. double startingMoney;
  320. double finalMoney;
  321. string ans;
  322. int numBet;
  323. Bet B1;
  324. Bet B2;
  325. Bet B3;
  326. Bet B4;
  327. Bet B5;
  328. cout<< "How much money you got today kid?"<< endl;
  329. cin >> startingMoney;
  330. finalMoney = startingMoney;
  331. while(finalMoney>= 0) {
  332. cout<< "How many times do you want to bet this round?"<< endl;
  333. cin>> numBet;
  334. numBet = numBet - 1;
  335. switch(numBet) {
  336. case 0:
  337. cout<< "Place your bet kid"<< endl;
  338. cin>>B1;
  339. cout<< "one bet"<<endl;
  340. break;
  341.  
  342. case 1:
  343. cout<< "Place your first bet kid"<<endl;
  344. cin>>B1;
  345. cout<< "And now your secone one"<< endl;
  346. cin>>B2;
  347. cout<< "two bets"<<endl;
  348. break;
  349.  
  350. case 2:
  351. cout<< "Place your first bet kid"<<endl;
  352. cin>>B1;
  353. cout<< "And now your secone one"<< endl;
  354. cin>>B2;
  355. cout<<"Place your third one kid I dont have all day"<<endl;
  356. cin>>B3;
  357. cout<< "three bets"<<endl;
  358. break;
  359.  
  360. case 3:
  361. cout<< "Place your first bet kid"<<endl;
  362. cin>>B1;
  363. cout<< "And now your secone one"<< endl;
  364. cin>>B2;
  365. cout<<"Place your third one kid I dont have all day"<<endl;
  366. cin>>B3;
  367. cout<< "Come on kid give me your fourth one already"<< endl;
  368. cin>>B4;
  369. cout<< "four bets"<<endl;
  370. break;
  371.  
  372. case 4:
  373. cout<< "Place your first bet kid"<<endl;
  374. cin>>B1;
  375. cout<< "And now your secone one"<< endl;
  376. cin>>B2;
  377. cout<<"Place your third one kid I dont have all day"<<endl;
  378. cin>>B3;
  379. cout<< "Come on kid give me your fourth one already"<< endl;
  380. cin>>B4;
  381. cout<< "And finally your fifth one?"<< endl;
  382. cin>>B5;
  383. cout<< "five bets"<<endl;
  384. break;
  385. default:
  386. cin>>B1;
  387. cout<< "Too slow bud you only have time for one bet this round"<< endl;
  388.  
  389. }
  390. }
  391. cout<< "Guess youre done for now, see you again later."<< endl<< "Or would you like to have, how should I put this? An interesting little journey?"<< endl;
  392. cin>> ans;
  393. if(continueOrnot(ans)) {
  394. //another function call for the mob boss idea
  395. } else {
  396. cout<<"Well then, you better get out of here before you have one."<< endl;
  397. }
  398. */
  399. return 0;
  400. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement