<mosaic.cnfolio.com>
PROGRAM
  1. /* Pseudo Code
  2. START
  3. Obtain values for Numbers and Bets
  4. IF Numbers or Bets are not in the specified range
  5.    THEN Display error messages
  6. ELSE
  7. Initialise the Random Number Generator/Roulette Wheel for values 0-37
  8. Statethat to input 00 the input value is 37
  9. IF Random Number is equal to 37
  10.   THEN
  11.       Display "The winning Number is 00"
  12.       ELSE Display "The 1st winning Number is Random Number"
  13. END IF
  14. Display message about the players 4 Numbers and the money they Bet
  15. IF RNum1 is equal to Number1
  16.    THEN Display "Congratulations, you have won X
  17. X is found by Multiplying the winning stake by 35
  18.    ELSE IF Display "Sorry you havent won this time"
  19. END IF
  20. IF RNum2 is equal to Number2
  21.    THEN Display "Congratulations, you have won X
  22. X is found by Multiplying the winning stake by 35
  23.    ELSE IF Display "Sorry you havent won this time"
  24. END IF
  25. IF RNum3 is equal to Number3
  26.    THEN Display "Congratulations, you have won X
  27. X is found by Multiplying the winning stake by 35
  28.    ELSE IF Display "Sorry you havent won this time"
  29. END IF
  30. IF RNum4 is equal to Number4
  31.    THEN Display "Congratulations, you have won X
  32. X is found by Multiplying the winning stake by 35
  33.    ELSE IF Display "Sorry you havent won this time"
  34. END IF
  35. Display overall winning calculated by various IF statemnts depending on which bets win
  36. END */
  37.  
  38. #include <stdio.h>
  39.  
  40. int main (void)
  41.  
  42. {
  43.  
  44. int Number1 ;
  45. int Bet1 ;
  46. int Number2 ;
  47. int Bet2 ;
  48. int Number3 ;
  49. int Bet3 ;
  50. int Number4 ;
  51. int Bet4 ;
  52. int c, n;
  53.  
  54. /* If you wish to bet on 00 please input 37 as your number */
  55.  
  56. scanf("%d %d %d %d %d %d %d %d" ,&Number1, &Bet1, &Number2, &Bet2, &Number3, &Bet3, &Number4, &Bet4);
  57.  
  58. if (Number1 < 0)
  59. printf("Please input 4 correct Numbers to bet on.");
  60.  
  61. else if (Number2 < 0)
  62. printf("Please input 4 correct Numbers to bet on.");
  63.  
  64. else if (Number3 < 0)
  65. printf("Please input 4 correct Numbers to bet on.");
  66.  
  67. else if (Number4 < 0)
  68. printf("Please input 4 correct Numbers to bet on.");
  69.  
  70. else if (Number1 > 37)
  71. printf("Please input 4 correct Numbers to bet on.");
  72.  
  73. else if (Number2 > 37)
  74. printf("Please input 4 correct Numbers to bet on.");
  75.  
  76. else if (Number3 > 37)
  77. printf("Please input 4 correct Numbers to bet on.");
  78.  
  79. else if (Number4 > 37)
  80. printf("Please input 4 correct Numbers to bet on.");
  81.  
  82. else if (Bet1 < 1)
  83. printf("Please stake a minimum of 1 on each of your Numbers.");
  84.  
  85. else if (Bet2 < 1)
  86. printf("Please stake a minimum of 1 on each of your Numbers.");
  87.  
  88. else if (Bet3 < 1)
  89. printf("Please stake a minimum of 1 on each of your Numbers.");
  90.  
  91. else if (Bet4 < 1)
  92. printf("Please stake a minimum of 1 on each of your Numbers.");
  93.  
  94.  
  95. else {
  96.  
  97. int RNum1;
  98. srand(time(NULL));
  99. RNum1 = rand();
  100. RNum1 = RNum1 % 38;
  101. if ( RNum1 == 37)
  102. printf(" The 1st winning number is 00.\n  ");
  103. else printf(" The 1st winning number is %d.\n", RNum1);
  104.  
  105.  
  106. if (Number1 == 37 && RNum1 == 37)
  107. printf("Your 1st number was 00 and you placed %d on it. Your profit for this bet is %d. Congratulations you have won!.  ", Bet1, Bet1*35);
  108. else if (Number1 == 37 && RNum1 != 37)
  109. printf("Your 1st number was 00 and you placed %d on it. Your loss for this bet is %d.  ", Bet1, Bet1) ;
  110. else if (RNum1 == Number1)
  111. printf("Your 1st number was %d and you placed %d on it. Your profit for this bet is %d. Congratulations you have won!.  ", Number1, Bet1, Bet1 * 35);
  112. else if (RNum1 != Number1)
  113. printf("Your 1st number was %d and you placed %d on it. Your loss for this bet is %d.  ", Number1, Bet1, Bet1) ;
  114.  
  115.  
  116. int RNum2;
  117. RNum2 = rand();
  118. RNum2 = RNum2 % 38;
  119. if ( RNum2 == 37)
  120. printf("\n The 2nd winning number is 00.\n  ");
  121. else printf("\n The 2nd winning number is %d.\n", RNum2);
  122.  
  123.  
  124. if (Number2 == 37 && RNum2 == 37)
  125. printf("Your 2nd number was 00 and you placed %d on it. Your profit for this bet is %d. Congratulations you have won!.  ", Bet2, Bet2*35);
  126. else if (Number2 == 37 && RNum2 != 37)
  127. printf("Your 2nd number was 00 and you placed %d on it. Your loss for this bet is %d.  ", Bet2, Bet2) ;
  128. else if (RNum2 == Number2)
  129. printf("Your 2nd number was %d and you placed %d on it. Your profit for this bet is %d. Congratulations you have won!. ", Number2, Bet2, Bet2 * 35);
  130. else if (RNum2 != Number2)
  131. printf("Your 2nd number was %d and you placed %d on it. Your loss for this bet is %d.  ", Number2, Bet2, Bet2) ;
  132.  
  133.  
  134.  
  135. int RNum3;
  136. RNum3 = rand();
  137. RNum3 = RNum3 % 38;
  138. if ( RNum3 == 37)
  139. printf(" \n The 3rd winning number is 00.\n  ");
  140. else printf(" \n The 3rd winning number is %d\n", RNum3);
  141.  
  142. if (Number3 == 37 && RNum3 == 37)
  143. printf("Your 3rd number was 00 and you placed %d on it. Your profit for this bet is %d. Congratulations you have won!.  ", Bet3, Bet3*35);
  144. else if (Number3 == 37 && RNum3 != 37)
  145. printf("Your 3rd number was 00 and you placed %d on it. Your loss for this bet is %d.  ", Bet3, Bet3) ;
  146. else if (RNum3 == Number3)
  147. printf("  Your 3rd number was %d and you placed %d on it. Your profit for this bet is %d. Congratulations you have won!. ", Number3, Bet3, Bet3 * 35);
  148. else if (RNum3 != Number3)
  149. printf("  Your 3rd number was %d and you placed %d on it. Your loss for this bet is %d.  ", Number3, Bet3, Bet3) ;
  150.  
  151.  
  152. int RNum4;
  153. RNum4 = rand();
  154. RNum4 = RNum4 % 38;
  155. if ( RNum4 == 37)
  156. printf(" \n The 4th winning number is 00.\n");
  157. else printf(" \n The 4th winning number is %d.\n", RNum4);
  158.  
  159. if (Number4 == 37 && RNum4 == 37)
  160. printf("Your 4th number was 00 and you placed %d on it. Your profit for this bet is %d. Congratulations you have won!.  ", Bet4, Bet4*35);
  161. else if (Number4 == 37 && RNum4 != 37)
  162. printf("Your 4th number was 00 and you placed %d on it. Your loss for this bet is %d.  ", Bet4, Bet4) ;
  163. else if (RNum4 == Number4)
  164. printf("  Your 4th number was %d and you placed %d on it. Your profit for this bet is %d. Congratulations you have won!. ", Number4, Bet4, Bet4 * 35);
  165. else if (RNum4 != Number4)
  166. printf("  Your 4th number was %d and you placed %d on it. Your loss for this bet is %d.  ", Number4, Bet4, Bet4) ;
  167.  
  168.  
  169. if (RNum1 != Number1 && RNum2 != Number2 && RNum3 != Number3 && RNum4 != Number4)
  170. printf(" \n Your overall profit/loss is %d.", 0-Bet1-Bet2-Bet3-Bet4);
  171.  
  172. else if (RNum1 == Number1 && RNum2 != Number2 && RNum3 != Number3 && RNum4 != Number4)
  173. printf(" \n Your overall profit/loss is %d.", (Bet1*35)-Bet2-Bet3-Bet4);
  174.  
  175. else if (RNum1 == Number1 && RNum2 == Number2 && RNum3 != Number3 && RNum4 != Number4)
  176. printf(" \n Your overall profit/loss is %d.", (Bet1*35)+(Bet2*35)-Bet3-Bet4);
  177.  
  178. else if (RNum1 == Number1 && RNum2 == Number2 && RNum3 == Number3 && RNum4 != Number4)
  179. printf(" \n Your overall profit/loss is %d.", (Bet1*35)+(Bet2*35)+(Bet3*35)-Bet4);
  180.  
  181. else if (RNum1 == Number1 && RNum2 == Number2 && RNum3 == Number3 && RNum4 == Number4)
  182. printf(" \n Your overall profit/loss is %d.", (Bet1*35)+(Bet2*35)+(Bet3*35)+(Bet4*35));
  183.  
  184. else if (RNum1 == Number1 && RNum2 == Number2 && RNum3 != Number3 && RNum4 == Number4)
  185. printf(" \n Your overall profit/loss is %d.", (Bet1*35)+(Bet2*35)-(Bet3)+(Bet4*35));
  186.  
  187. else if (RNum1 == Number1 && RNum2 != Number2 && RNum3 == Number3 && RNum4 != Number4)
  188. printf(" \n Your overall profit/loss is %d.", (Bet1*35)-(Bet2)+(Bet3*35)-(Bet4));
  189.  
  190. else if (RNum1 == Number1 && RNum2 != Number2 && RNum3 != Number3 && RNum4 == Number4)
  191. printf(" \n Your overall profit/loss is %d.", (Bet1*35)-(Bet2)-(Bet3)+(Bet4*35));
  192.  
  193. else if (RNum1 == Number1 && RNum2 != Number2 && RNum3 == Number3 && RNum4 == Number4)
  194. printf(" \n Your overall profit/loss is %d.", (Bet1*35)-(Bet2)+(Bet3*35)+(Bet4*35));
  195.  
  196. else if (RNum1 != Number1 && RNum2 == Number2 && RNum3 != Number3 && RNum4 != Number4)
  197. printf(" \n Your overall profit/loss is %d.", 0-(Bet1)+(Bet2*35)-(Bet3)-(Bet4));
  198.  
  199. else if (RNum1 != Number1 && RNum2 == Number2 && RNum3 == Number3 && RNum4 != Number4)
  200. printf(" \n Your overall profit/loss is %d.", 0-(Bet1)+(Bet2*35)+(Bet3*35)-(Bet4));
  201.  
  202. else if (RNum1 != Number1 && RNum2 == Number2 && RNum3 == Number3 && RNum4 == Number4)
  203. printf(" \n Your overall profit/loss is %d.", 0-(Bet1)+(Bet2*35)+(Bet3*35)+(Bet4*35));
  204.  
  205. else if (RNum1 != Number1 && RNum2 == Number2 && RNum3 != Number3 && RNum4 == Number4)
  206. printf(" \n Your overall profit/loss is %d.", 0-(Bet1)+(Bet2*35)-(Bet3)+(Bet4*35));
  207.  
  208. else if (RNum1 != Number1 && RNum2 != Number2 && RNum3 == Number3 && RNum4 != Number4)
  209. printf(" \n Your overall profit/loss is %d.", 0-(Bet1)-(Bet2)+(Bet3*35)-(Bet4));
  210.  
  211. else if (RNum1 != Number1 && RNum2 != Number2 && RNum3 == Number3 && RNum4 == Number4)
  212. printf(" \n Your overall profit/loss is %d.", 0-(Bet1)-(Bet2)+(Bet3*35)+(Bet4*35));
  213.  
  214. else if (RNum1 != Number1 && RNum2 != Number2 && RNum3 != Number3 && RNum4 == Number4)
  215. printf(" \n Your overall profit/loss is %d.", 0-(Bet1)-(Bet2)-(Bet3)+(Bet4*35));
  216.  
  217.  
  218.  }
  219. }