Logic Design Slot Machine Lab

You have to get to know which slots are faster

  1. Logic Design Slot Machine Lab Report
  2. Logic Design Slot Machine Labels
  3. Logic Design Slot Machine Label
  4. Logic Design Slot Machine Labeled

by Frank Scoblete

Logic Design Slot Machine Lab Report

I am sure that readers of this magazine are well aware of the fact that the higher the denomination of the machine, the better chance those machines are looser than the ones below them. This fact has a law attached to it: The Higher Denomination Machines are Looser Law it’s called.

You probably also know that the big progressive machines such as Megabucks, Wheel of Fortune, and Quartermania are much tighter than non-progressive stand-alone machines such as Wild Cherry and Red, White and Blue. The law behind this fact is called The Big Jackpot Machines Ain’t Looser Law.

All the readers of this magazine know these facts because just about every writer for this magazine explains these facts in many different ways, over and over, in order to make your slot play return more of your money to you. After all, the money is better in your pocket or purse than in those large casino vaults under the ground.

But no one knows about other types of loose machines. That’s right. Even in stand-alone machines some are looser than others. Yes, even Frank Legato, the Will Rogers of Strictly Slots doesn’t know about these loose machines; and Strictly Slots contributor and computer whiz John Robison, who lives in one of those GIANT slot machines, doesn’t know about these loose machines, and Jeff Compton, who is a slot machine, has no idea about them either. President Bush doesn’t even know about them and he knows about almost every other secret in the world.

  1. The Logic Master Detective is back for another round of logic puzzles, to keep you occupied for hours. Fun for the whole family. Screen, Fonts etc, are now bigger in this version.
  2. Of playing slot machines. Virtually, anyone who visits a casino is familiar with a slot machine and how it operates, even a novice. You insert a coin, pull the handle or press a button and wait a few seconds to see if you win. It’s basic simplicity accounts for much of the success of slot machines in today’s casinos.

My job for the past many years has involved writing the software that runs casino slot machines and their back end systems (player's club software and most recently server based gaming systems). I have experience not just with the software, but also with the on-site operations of multiple casinos - as I've had to go on-site to fix issues at times.

Only me.

Only I do.

Only I know which stand-alone machines are looser than less looser stand-alone machines.

Now you will know this too because I am a generous guy and I want to see you all have a better chance to take home the casino’s money—or, at the very least, take home some of the money you brought to the casino to play the slot machines. To do that I have to reveal this secret to you in this column otherwise you would have to wait until my next column.

But before I reveal this secret to you, let me explain something about the difference between you and the casinos. They are richer than you. Yes, even if you are rich compared to other human beings, you are not as rich as the casinos. If you look at their table games closely you will note that the floorperson is always trying to get those games to run faster in order to get more decisions in. The more decisions that a game has, the better it is for the casino because the house edge grinds away that way. Got it?

Okay, in simple words, fast games with a lot of decisions are good for the casino. Less fast games with fewer decisions are less good for the casinos. You might well notice, if you are really sharp, that good and less good are both still good for the casino. That’s the sorry truth of casino games. They are all good for the casino—just some are more good than others.

Using this knowledge of fast is good; we turn our attention to the slot machines, which is the game of your choice. Everything is reversed in the world of slots. That’s the trick! If a slot machine is very fast coming up with decisions, the casino doesn’t have to take as much money from each and every spin because you are going to have many more spins for the house edge to eat away at you.

So faster slot machines are looser.

However, if the slot machine is slow with decisions, the house has to increase their edge on these machines so that they still make the kind of money they desire from them—or rather from you, actually, since you are the one pumping your money into them.

So slower machines are tighter.

Okay, those are general principles but how do you tell which are fast machines and which are slow machines? This isn’t easy—you have to play them! (Oh, the agony!) Let us say you have a machine that hits certain pay lines and tiny little cute creatures come dancing and singing on the screen taking up a lot of time. Then you have another machine that doesn’t have tiny little cute creatures or even big ugly creatures or any other entertainment segment—the reels spin, you learn your fate, and you spin them again.

The machine that has an entertainment component is going to be tighter than the machine without the entertainment component. So you don’t play those machines.

But why should you play the other machine which is faster and therefore its looseness still loses you more money in the long run because of its speed? I am glad you asked that question.

Unlike table games where the dealer has something to say about the speed of the game, you can still play faster machines slower! Do you have that? Play the fast machines slow! Reduce the number of decisions on them and now you are playing a loose machine slowly and getting more pleasure out of it. At least I am guessing you’ll get more pleasure out of it, unless you are insane and enjoy losing faster on faster machines.

Now I do not have absolute proof that what I am saying about playing fast machines slowly is the way to go or that I am correct in my assumptions. In fact, I have no proof that what I am saying is correct…except that about 20 years ago my wife, the beautiful AP and I did a little experiment in Vegas. We played side-by-side machines—of different types—putting in the exact same amount of money the exact same way. We’d play the machines for an hour then see what kind of comps we had wracked up. We never had the same comps! I assumed that the machines that were looser were paying back less in comps and the machines that were tighter were paying back more in comps. Something had to be the reason why one machine would give back more in comps and the other machine would give back less in comps.

Using that little experiment as a guide I am thinking that my current theory is correct also. If it is, you will save money by playing fast machines slowly and if I am wrong, well, you aren’t going to lose any more money than you would have lost had you played the way you always do.

Go to it boys and girls!

Frank Scoblete is the #1 best-selling gaming author in America. He is executive director of the Golden Touch advantage-play seminars in craps and blackjack. His websites are www.goldentouchcraps.com, www.goldentouchblackjack.com and www.scoblete.com in association with CasinoCityTimes.com. His recent books are Break the One-Armed Bandits: How to Come Out Ahead When You Play the Slots!, The Golden Touch Dice Control Revolution! and The Golden Touch Blackjack Revolution! His new DVD is Golden Touch: Beat Craps by Controlling the Dice! which shows over 200 controlled dice throws – many in slow motion. For a free brochure or to order Frank’s products, call 1-800-944-0406.

CS 115 Program 2 Slot Machine Fall 2020

Due Dates:
Design and Test Cases: Friday, October 30, midnight
Source Phase I: Friday November 6, midnight
Graphics Source Phase II: Friday November 13, midnight

The graphics description is now posted for Phase II. 10/25/2020

Assignment total points = Design (20 points) + Answers for test cases (10 points) + Implementation Phase I (90 points) + Phase II (50 points) = 170 points

Submit all program materials (.py files) with the Canvas link.

A reminder that you are allowed ONE classmate as apartner. Make sure that there are NOT more people involved from the class. You ARE allowedand encouraged to work with any TA or Dr. Keen.If you have a partner, make sure you reference them and they reference you or there will be a penalty.

The educational goals of this program are to use the concepts of

  • design with pseudocode
  • if, while loop and function control structures
  • random numbers
  • accumulators
  • self-written functions and how to document them
  • string comparison
  • input validation
  • testing with valid and invalid inputs
  • documentation
  • use Boolean operators
  • use the graphics library (graphics version)

A short reading about how to document a function

Your program will simulate a slot machine, a 'one-armed bandit'. You willlet the player enter their wager, use pseudorandom numbersto 'spin the wheels' on the machine,and calculate the player's winnings.

The rules of the game:
The slot machine has 3 wheels with symbols of acherry, apple, banana, orange, melon, lemon, grape, a bell and a JACKPOT.There are 9 symbols on each wheel.A player wagers an amount of money (no more than they have!) (an integer).When the player 'pulls the handle', the wheels spin around,and then each one stops at one of the symbols.If some of the wheels come up with matching symbols, theplayer wins various amounts of money.

Lab

How the player wins:

  • If three JACKPOTS come up, the player wins 20 times the amountthey bet.
  • If three bells come up, they win 10 times the bet.
  • If any other symbol comes up three times, they win 3 times the bet.
  • If any symbol comes up just two times, they win twice the amountthey bet.
  • Otherwise they lose the amount they bet.

The game is ended in two ways: when the player says they don'twant to play any more, or when they lose all their money.The program should report the amount of money that the playerleaves with or that they are bankrupt.

Design

Here is an example of the interaction between the user andyour program on the screen. These do not show any graphics, just text.

Another Example Run (Note the input validations):

Another Example Run (user loses it all):

Design

There are two Phases to this program. The first phase usesjust text graphics as shown above.The second phase uses the graphics library.The graphics version is due a week after the text version.If you have thelogic worked out in the text version, the graphics version is MUCH easier.

Here is where a description of the graphics part is

Test cases and design do not need to consider the graphics part.

(20 points) Test Cases:

Complete this test plan for the program. These answers should be put in the file with the design at the bottom of the file and turned in at thefirst deadline.

We have to consider tests at different levels of detail.

  • Think about inputs from the user (lowest level detail).
  • Think about how to test the mechanisms of the game, the winning or losing.
  • Think about unit (function) testing (read the reading about functions).
These need different tables to organize. The results of tests will not be just outputs (numbers) but actions (“player loses”). Since the program uses random numbers, some of the actions are not directly controllable by the user. You can only control the program by inputs.
User enters invalid bet (low), pot is $50-5 'too small', user is prompted to enter a valid input, another input accepted
User enters invalid bet (high), pot is $5075 'too much', user is prompted to enter a valid input, another input accepted
User makes another spin
User does not want to play again____A.__(the complete row)_
User gives invalid input____B.__(the complete row)_
User leaves the game with total winnings of first spin
User ends game after 2 spinsy, n ___C.____
Game ends because of bankruptcy bet equal to pot, loses all___D.____
User only wants to play one spinn when asked 'Play again?'user told how much they have, leaves the program
User wants to play two spins (Pot bigger than 55) 25, y, 30, n when asked 'Play again?' ___E.___ NOTE: same as C

No need for testing getaspin().

output prompt 'John do you want to play again?', returns True
normal, input Y 'John','Y' output prompt 'John do you want to play again?', returns True
normal, input n'Mary', 'n' ___F.____
normal, input N'Mary', 'N' ___F.____
invalid, then valid input'Sam', inputs t, pie, same, y ___G.___
bet too high 200, 300 outputs prompt, gives error message 'too much', asks for another bet
bet too low 200, -1 ___H.___
outputs 'three of a kind', returns 500
Triple bell'bell','bell','bell', 50 ___I.__
Two of a kind 'apple','apple','cherry' ___J.___
Losing spin 'apple','bell','cherry' ___K.___

Logic Design Slot Machine Labels

(20 points) Design

Write the steps in pseudocode (NOT Python!) in comments in a Python file.Save this Python file as 'design2.py'.Submit this .py file through Canvas as usual.

Logic Design Slot Machine Label

The whole program has a prolog, at the top as usual, which discuss the whole PROGRAM(and the main function), just as we have always written.The 3 P's you write for the whole program count as being for the main function.

Each function definition, not just the main, must have a prolog.You write the three P's at the top of each function.The purpose of the FUNCTION, not the whole program,
the preconditions of the FUNCTION, which are the parameters (if any)and the input from the user (if any)
the postconditions of the FUNCTION, which are the outputs of the functionor actions or any return value.

As usual, give the types of these variables and their meaning. Don't say'two integer parameters', say 'two integers parameters, first one is height, second one iswidth', for example.

Logic Design Slot Machine Labeled

After the 3 P's of each function, you comment all the control structures you will use in the function to achieve the function's purpose.They are mostly very short functions, very few control structures.

(80 points) Implementation Phase I

There are some specifications that your program needs to meet.

  • Your code must be documented with the design. You must use meaningful variable names.
  • Your design comments must appear between the lines of code.
  • You must have a main function.
  • The output prompts and labels of your program MUST match theones given in the example runs.
  • Any library imports must be OUTSIDE the main function.
  • ALL variables must be defined and used INSIDE a function definition;global variables are not allowed!
  • Unnecessary typecasts should not be used.
  • Please use seed of 0 for starting your random numbers.
  • Make sure you eliminate any syntax and semantics errors. Use the test cases!
  • All guarantees of structured programming must be obeyed; that means NO breaks, continues or passes! Major penalties!
  • Each function has one return statement.
  • NOTE: you are not allowed to use recursion. This is any function calling itself. People do it becausethey do not know how to use a while loop. Your program has a while loop in the main function. There are more while loops in the other functions.

Your program must have and use the following functions:
PLEASE use the names given for the functions!

  • validate_yorn: has one parameter, a string which is the name of the player.The function asks the user (by name) if they want to play again. The function validatesthe user's input. They must enter either 'y', 'Y', 'n', or 'N' to be valid.All other inputs are rejected and more input is requested.The function returns True if the user entered y or Y, False if n or N.
  • validate_bet: receives a parameter, an integer which represents the pot.The function asks the user what they want to bet based on the size of the pot, and does input validation on that input.Numbers between 1 and the size of the pot, inclusive, are valid. Any other numbers arenot accepted. Numbers are either too high or too low, an appropriate error message is outputand more input is requested.The function returns the validated integer that is the bet.
  • getaspin: has no parameters.Returns a random string choice from the list ['cherry', 'apple', 'banana', 'orange', 'melon', 'lemon', 'grape', 'bell', 'JACKPOT']. Each choice is equally likely.
  • calculate_win: has 4 parameters, first 3 are strings which are the spin results, the fourth is the amount of the bet, an integer.The function uses the parameters to determine how much the user won (or lost). The rules described at the top of the assignment are used to determine whether the user winsor loses and how much they win or lose.No loops are needed, just logic. If the user lost the bet, the negative of the bet is returned.The amount won or lost is returned as an integer.