The Objective In casinos from Monte Carlo to Las Vegas, one of the most common gambling devices is the slot machine -- the "one-armed bandit." A typical slot machine has three wheels that spin around behind a narrow window. Each wheel is marked with the following symbols: CHERRY, LEMON, ORANGE, PLUM, BELL, and BAR. The window, however, allows you to see only one symbol on each wheel at a time. For example, the window might show the following configuration: ORANGE LEMON CHERRY If you put a silver dollar into a slot machine and pull the handle on its side, the wheels spin around and eventually come to rest in some new configuration. If the configuration matches one of a set of winning patterns printed on the front of the slot machine, you get back some money. If not, you're out a dollar. The following table shows a typical set of winning patterns, along with their associated payoffs: BAR BAR BAR pays $ 250 BELL BELL BELL/BAR pays $ 20 PLUM PLUM PLUM/BAR pays $ 14 ORANGE ORANGE ORANGE/BAR pays $ 10 CHERRY CHERRY CHERRY pays $ 7 CHERRY CHERRY - pays $ 5 CHERRY - - pays $ 2 The notation BELL/BAR means that either a BELL or a BAR can appear in that position, and the dash means that any symbol at all can appear. Thus, getting a CHERRY in the first position is automatically good for two dollars, no matter what appears on the other wheels. Note that there is never any payoff for the the LEMON symbol in the first column, even if you happen to line up three of them.
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request 3)You are required to use separate compilation for this project. The file that contains main() is to be called proj2.c. As discussed in class, the function definitions should be in at least one separate file. For this project, the functions written will fit into one of two categories, those that have only to do with a slot machine, and those that are more general utility functions. The functions that are very general utility functions should be defined in a file called util.c which will have an associated interface, the util.h file. The functions that have only to do with the slot machine should be defined in a file called slot.c, which will have an associated interface, the slot.h file. You may use the functions, SetRandomSeed() and GetRandomNumber() from Lecture 5 - An Example - Cards, cards.c, as two of your utility functions. GetValidInt() may also be useful and is found in the same lecture. You should first welcome the user and present him/her with a explanation of what it means to play the game as opposed to testing the game. After this initial greeting, a Main Menu should be displayed that allows him/her to choose to run the program in Test Mode or Play Mode or to QUIT. Your program must be capable of running in either mode. · For Test Mode: o The user should be prompted for the number of games the test should run (a positive integer which is 100,000 or less) o The user should be prompted for a positive integer seed for the pseudo-random number generator. (1 - 65000) o Seed the random number generator with that positive integer. o Simulate the playing of the number of games the user entered, storing the number of times each of the possible winning combinations occured in an array that is being used as a counter. You should NOT display the results of each individual roll o Print out the number of occurrences of each of the winning possibilities as well as the number of losses. o Return to the Main Menu
This MUST be done in C using the GCC compilier(Unix/Linux)