Slot machine program in c

broken image
broken image
broken image

You must agree that there is nothing complex here and program works. Program should work until we have money on our balance. Otherwise we charge 50 cents for attempt.If all variables are twos, we add $20 to our balance.If all variables are ones, we add $10 to our balance.If all numbers are zeroes, we lose everything.Next step is to define what “win” and “lose” means: when all three variables x, y, z are equal, we’ll be enforcing following rules: This value will be defined by random number generator. Each reel can hold only one value (from 0 to 5) at a time. Variables x, y, z will represent the reels. To simplify our task we’ll be just using numbers from 0 to 5 instead of mentioned images - we can always come back to it and make improvements later. Traditionally, slot machines have fruit images, cherry, bell, and number “7”. We’ll have three reels (positions, or slots) and few images. Variable balance will represent the amount of money we have in the bank. We will put some money in the bank, pull the handle and see what happens. We’ll practice a bit and sum up everything we know so far, and implement simple one-armed bandit game. Debugging Example - Save the World with Ruby.

broken image

broken image