<mosaic.cnfolio.com>
PROGRAM
1. /*
2. start
3. SET the number of bets to 0
4. WHILE betting is still available and the number of bets is less than 4
5.   GET number and betting amount
6.   IF the number betted on is between 0 and 36 AND
7.    the betting amount is a positive whole number
8.     THEN
9.        Start the game and spin the wheel using the american style roulette table so pockets from 0-36 and 00
10.        Display the bet number
11.        Display the bet amount
12.        Display the winning number
13.        IF betted number equals to the winning number
14.     THEN
15.        Add betted amount value to the wallet
16.        Add betted amount value by 35 to the wallet
17.        Display the betted amount by 35 as the winning payout
18.     ELSE
19.        Subtract the betted amount from the wallet
20.        Display the payout as 0
21.   END IF
22.        Display the wallet value
23.        Increase number of bets by 1
24.     ELSE
25.        Display an error message about  incorrect inputs
26.   END IF
27. END WHILE
28. IF number of bets is less than 4
29.     THEN
30.        Display  en error message about lack of input bets
31.   END IF
32.   Display the final wallet amount
33. END
34.
35.
36. */
37.
38.
39.
40. #include <stdio.h>
41. #include <stdlib.h>
42. #include <time.h>
43.
44. int main(void)
45.
46. {
47.
48. /*Storing values under related names*/
49. int cash1;
50. int cash2;
51. int cash3;
52. int cash4;
53.
54. int bet1;
55. int bet2;
56. int bet3;
57. int bet4;
58.
59. int v1;
60. int winningnumber;
61.
62. /*initialzes random seeds*/
63. srand (time(NULL)) ;
64.
65. /*generates the winning number from between 0-38*/
66. winningnumber = rand() % 37+1;
67.
68.
69.
70. {
71. /*this is where i scan in my numbers for the numbers being bet on and  amoung of cash being bet*/
72. scanf("%d %d %d %d %d %d %d %d", &cash1, &bet1, &cash2, &bet2, &cash3, &bet3, &cash4, &bet4);
73.
74.
75. /*this IF statement is for if not enough values are entered so the player will be notified, it also contrains the conditions needed to play*/
76. if
77.
78.   ((38<bet1)||(38<bet2)||(38<bet3)||(38<bet4)||(0>bet1)||(0>bet2)||(0>bet3)||(0>bet4))
79.       printf ("invalid bet \n\nPlease pick a number between 0 and 36 or 00\n\n");
80.
81.
82.   /*This statment is for if the player is a winner, it displays there winning amount, winning numbers. it will multiply the amounf of money betted by 38*/
83.   else if
84.      ((winningnumber==bet1)||(winningnumber==bet2)||(winningnumber==bet3)||(winningnumber==bet4))
85.         printf ("The total amount of your bets are  £ %d \nBet number %d matches \nTotal amount bet has doubled \nYou win £ %d\n\nwinning number is %d\n", cash1+cash2+cash3+cash4, winningnumber, (cash1+cash2+cash3+cash4)*38, winningnumber);
86.
87.         /*this statement os for if the player isnt a winner, they will be notified about how much they lost*/
88.         else if ((winningnumber!=bet1)||(winningnumber!=bet2)||(winningnumber!=bet3)||(winningnumber!=bet4))
89.           printf ("The total amount of your bets are £ %d \nNo numbers match, you lost £ %d\n\nwinning number is %d\n", cash1+cash2+cash3+cash4 ,cash1+cash2+cash3+cash4, winningnumber  );
90.
91. } /*this is display the numbers the player has been betting on so they can have a a look*/
92.  printf("Your bet numbers are as below \nFirst  %d\nSecond %d\nThird  %d\nFourth %d\n", bet1, bet2, bet3, bet4, winningnumber);
93.
94. v1 = rand() % 100;
95.
96.
97. }