<mosaic.cnfolio.com>
PROGRAM
  1. //American Roulette
  2.  
  3. //
  4. // START
  5. //  Player introduce to the dealer and greets him/her welcome to roulette.
  6. //  Dealer will ask to place your bets.
  7. //  The player 1 will have first bet in four times.
  8. //  IF player money spend $... is positive whole number
  9. //  THEN
  10. //  DISPLAY  Wallet value
  11. //  END IF
  12. //  Dealer spins the roulette from 0 to (37:(double zero "00" )).
  13. //  IF bet number is between 0 and 36 add bet value as a positive whole number
  14. //  THEN
  15. //  Calulate results
  16. //  Display result bet number from player 1 predicted or chosen a number.
  17. //  Display user bet amount from player 1 the money has been spend.
  18. //  Display winning number from the roulette wheel where the ball has landed on. 
  19. //  IF bet number equals to winning number
  20. //  Add bet value to the wallet value for win.
  21. //  Add bet value multiplied by 35  to wallet value.
  22. //  Display bet value multiplied by 35 to wallet value.
  23. //  ELSE
  24. //  IF bet number is not equal to winning number
  25. //  Subtract value to the wallet value for loss.
  26. //  Display Zero as payout value.
  27. //  END IF
  28. //  Display Wallet value
  29. //  While number of bets is less than 4.
  30. //  THEN
  31. //  Display error msg about lack of input bets.
  32. //  END IF
  33. //  Display final wallet for player 1.
  34. //
  35. //END
  36. ///
  37.  
  38.  
  39.  
  40. #include <time.h>
  41. #include <string.h>
  42. #include <stdio.h>
  43. #include <math.h>
  44.  
  45. void main()
  46. {
  47. {printf("  Hello player 1.  Welcome to American roulette!!!\n  ");
  48.  
  49. printf("Please select your bet and the money you will spend on the chips?\n");
  50. }
  51.  
  52. int userBAmount; // player bets with the amount of dollars in cash converted into chips
  53. if (userBAmount>=0){
  54. scanf("%d",&userBAmount);
  55. printf( " Player 1 has bet $ %d dollars on the chips added to the wallet value.\n",userBAmount);
  56. }
  57.  
  58. {
  59. int BetNum;
  60.  
  61. printf("Please place the single bet number?\n"); // straight(inside bet)
  62. if(BetNum<36);
  63. {
  64. scanf("%d",&BetNum);/// player 1 picks any single number that is predicted from the chosen bets .
  65. printf("%d.\n",BetNum);
  66. }
  67.  
  68. int number;
  69. srand( time (0));
  70. number = rand () %37; /// Spin the wheel to give you the number between  0-36 and plus the 37 is double zero///
  71. printf( "The ball landed on %ld.\n", number )/// Display  the ball landed on the American roulette wheel.
  72.  
  73.  
  74. int userBAmount; // Player 1 Bet money amount.
  75. int payout;
  76. int Wallet;// subtotal of player 1 profit
  77.  
  78. if(BetNum == 36) // bet number equal to 36.
  79. {
  80. scanf ("%d",&userBAmount);
  81. scanf ("%d",&BetNum);
  82. Wallet = (userBAmount + BetNum)*35; //* E.g. (36 + $300)= 336 * 35 = 11760
  83. printf("$%d.\n",Wallet);
  84. }
  85. else
  86. if (BetNum != 36) // bet number not equal to
  87. {
  88. payout = (userBAmount-BetNum);// E.g. 30-300= -$270
  89. printf("%d.\n",payout);
  90. }
  91. else
  92. return(0);
  93. printf("Payout value 0.",payout);
  94. }
  95. }