Roulette: Inheritance Case Study



Similar documents
Patterns in. Lecture 2 GoF Design Patterns Creational. Sharif University of Technology. Department of Computer Engineering

Russell Hunter Publishing Inc

Greg Fletcher. Sharpshooter Roulette. Video Guide. Russell Hunter Publishing, Inc.

Automatic Bet Tracker!

Expected Value. 24 February Expected Value 24 February /19

You can place bets on the Roulette table until the dealer announces, No more bets.

CASINO GAMING AMENDMENT RULE (No. 1) 2002

The New Mexico Lottery

How to Beat Online Roulette!

Probability and Expected Value

CSCI 253. Object Oriented Programming (OOP) Overview. George Blankenship 1. Object Oriented Design: Java Review OOP George Blankenship.

Chapter 16: law of averages

3.2 Roulette and Markov Chains

MrMajik s Money Management Strategy Copyright MrMajik.com 2003 All rights reserved.

An Unconvered Roulette Secret designed to expose any Casino and make YOU MONEY spin after spin! Even in the LONG Run...

Making $200 a Day is Easy!

How to Play. Player vs. Dealer

Presents ITALIAN QUALITY & DESIGN. New AR Side Bet

Martin J. Silverthorne. Triple Win. Roulette. A Powerful New Way to Win $4,000 a Day Playing Roulette! Silverthorne Publications, Inc.

Steal From the Casino! Roulette Sniper

REWARD System For Even Money Bet in Roulette By Izak Matatya

(SEE IF YOU KNOW THE TRUTH ABOUT GAMBLING)

VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0

Java Application Developer Certificate Program Competencies

The game of roulette is played by throwing a small ball onto a rotating wheel with thirty seven numbered sectors.

ECE 316 Probability Theory and Random Processes

ROULETTE. APEX gaming technology

Learn How to Use The Roulette Layout To Calculate Winning Payoffs For All Straight-up Winning Bets

GAMBLING DISC. Script ROULETTE TUTORIAL

PLACE BETS (E) win each time a number is thrown and lose if the dice ODDS AND LAYS HARDWAYS (F) BUY & LAY BETS (G&H)

AP COMPUTER SCIENCE A 2007 SCORING GUIDELINES

X: Probability:

How to Play Roulette Online

TABLE OF CONTENTS. ROULETTE FREE System # ROULETTE FREE System #

The Best Online Roulette Games

Section 7C: The Law of Large Numbers

Betting systems: how not to lose your money gambling

Fire Bet Rules of Play

Object oriented design process

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

Assessment Requirements for SITHGAM012 Conduct Roulette games

Treating Interfaces as Components

Singletons. The Singleton Design Pattern using Rhapsody in,c

Elementary Statistics and Inference. Elementary Statistics and Inference. 16 The Law of Averages (cont.) 22S:025 or 7P:025.

The Very Best Way We Know to Play the Pick 3

AMS 5 CHANCE VARIABILITY


11 November

Object Oriented Design

THE WINNING ROULETTE SYSTEM by

KNOWLEDGE IS POWER The BEST first-timers guide to betting on and winning at the races you ll EVER encounter

Advanced Data Structures

calculating probabilities

Thursday, November 13: 6.1 Discrete Random Variables

History OOP languages Year Language 1967 Simula Smalltalk

CMSC 132: Object-Oriented Programming II. Design Patterns I. Department of Computer Science University of Maryland, College Park

Engineering Process Software Qualities Software Architectural Design

Loss rebates. December 27, 2004

COME OUT POINT The number (4, 5, 6, 8, 9 or 10) thrown by the shooter on the Come Out roll.

Object-Oriented Design. CSE 5236: Mobile Application Development Course Coordinator: Dr. Rajiv Ramnath Instructor: Adam C.

The Very Best Way We Know to Play the Trifecta

Orange High School. Year 7, Mathematics Assignment 2

How-To-Make-Money-Easily. Congratulations!!

CS-XXX: Graduate Programming Languages. Lecture 25 Multiple Inheritance and Interfaces. Dan Grossman 2012

Björn Bäckström, Lars Olsén and Simon Renström Copyright 2011 ClaroBet AB. Updated: May. 12, 11 You may not distribute or copy any of the text or use

We { can see that if U = 2, 3, 7, 11, or 12 then the round is decided on the first cast, U = V, and W if U = 7, 11 X = L if U = 2, 3, 12.

SPANISH Player blackjack always beats a dealer blackjack and is paid 3 to 2.

Glossary of Object Oriented Terms

Statistics. Head First. A Brain-Friendly Guide. Dawn Griffiths

The overall size of these chance errors is measured by their RMS HALF THE NUMBER OF TOSSES NUMBER OF HEADS MINUS NUMBER OF TOSSES

Live Dealer Electronic Table Games

MA 1125 Lecture 14 - Expected Values. Friday, February 28, Objectives: Introduce expected values.

Introduction to the Rebate on Loss Analyzer Contact:

"TWO DOLLARS TO SHOW ON NUMBER

6.042/18.062J Mathematics for Computer Science. Expected Value I

If, under a given assumption, the of a particular observed is extremely. , we conclude that the is probably not

This Method will show you exactly how you can profit from this specific online casino and beat them at their own game.

Design Patterns. Design patterns are known solutions for common problems. Design patterns give us a system of names and ideas for common problems.

WEKA Handelsges.m.b.H. web: TRIPLE CROWN ROULETTE USER S MANUAL

1. What are Data Structures? Introduction to Data Structures. 2. What will we Study? CITS2200 Data Structures and Algorithms

Designing and Writing a Program DESIGNING, CODING, AND DOCUMENTING. The Design-Code-Debug Cycle. Divide and Conquer! Documentation is Code

Term Project: Roulette

January 2012, Number 64 ALL-WAYS TM NEWSLETTER

The Great Cash Generator

HONORS STATISTICS. Mrs. Garrett Block 2 & 3

Introduction to Programming Block Tutorial C/C++

Note: To increase your bet by another amount, select another chip from the bottom right of the game panel.

Target Roulette Andrew Devereau

,240-20,480-40,960-81,920

Elementary Statistics and Inference. Elementary Statistics and Inference. 17 Expected Value and Standard Error. 22S:025 or 7P:025.

Embedded Software development Process and Tools: Lesson-1

Blackjack...5. Craps...8. Roulette Mini/Midi-Baccarat Pai Gow Poker Pai Gow Let It Ride Three Card Poker...

We rst consider the game from the player's point of view: Suppose you have picked a number and placed your bet. The probability of winning is

How To Play Classic Slots

Would You Like To Earn $1000 s With The Click Of A Button?

Double Deck Blackjack

Transcription:

Roulette: Inheritance Case Study Roulette involves a player, a wheel, and bets ½ Real game has several players, we ll use one ½ Real game has lots of kinds of bets, we ll use three but make it simple to add more Instead of brainstorming classes, we ll take as given: ½ Wheel ½ Bet ½ Bankroll ½ Roulette (game) ½ What s missing? ½ What are responsibilities, collaborations? Duke CPS 108 8.1

What are scenarios? User/player given choice of bet ½ Bet choice made ½ Wager made ½ Wheel spins ½ Payoff given ½ Play again? What happens when player bets? ½ What s recorded? ½ How is winning determined? ½ What about multiple players, multiple bets? Duke CPS 108 8.2

What is a bet? Difference between wager and bet ½ Bet contains wager amount ½ Different bets have different payoffs What happens after the wheel rolls and payoff occurs? if (mybet == redblack) else if (mybet == oddeven) ½ Problems with this? ½ Open closed principle? ½ Canonical OO tenet: avoid chains of if/else (when you can) Duke CPS 108 8.3

Roulette Class Diagram Has-a relationship ½ Bet has a wheel, how/why? ½ BetFactory has bets ½ What bets? ½ Game has a bankroll ½ Does this make sense? Uses-a relationship ½ Parameters ½ Return values ½ Local variables Has-a relationship ½ Inheritance, use-as-a ½ Substitutable for-a Duke CPS 108 8.4

Inheritance guidelines in C++ Inherit from Abstract Base Classes (ABC) ½ one pure virtual function needed (=0) ½ must have virtual destructor implemented ½ can have pure virtual destructor implemented, but not normally needed Avoid protected data, but sometimes this isn t possible ½ data is private, subclasses have it, can t access it ½ keep protected data to a minimum Single inheritance, assume most functions are virtual ½ multiple inheritance ok when using ABC, problem with data in super classes ½ virtual: some overhead, but open/closed principle intact Duke CPS 108 8.5

Designing hyperwag Keep classes small and cohesive ½ as simple as possible, but no simpler ½ member functions should also be small Design for change ½ specifications, requirements, design ½ example: other formats for table design? Design first, code second, but revisit design Know the language, but don t let the language rule the design Get the classes right, concentrate on what not how Duke CPS 108 8.6

One view of hyperwag Duke CPS 108 8.7

Patterns: Abstract Factory Abstract Factory/Factory aka kit ½ system should be independent of how products created ½ system should be configured with one of multiple products (or families of products, e.g., Win95, Motif) ½ you want to provide a class library of products and reveal interfaces but not implementations Consequences ½ factory encapsulates responsibility and process of creating objects, clients only see abstract interface. Real names hidden in factory ½ supporting new products can be difficult depending on the situation (but see Prototype pattern) Often want only one factory accessible in a program Duke CPS 108 8.8

Patterns: Singleton Singleton ½ enforce exactly one instance of a class, accessible in a welldefined manner ½ possible to extend via inheritance Consequences ½ controlled access to single instance, e.g., Foo * foo = Foo::getInstance(); ½ no global variables ½ no need to rely solely on class/static functions Implementation ½ private constructor ½ getinstance (or other class/static functions, see hyperwag) Duke CPS 108 8.9

Patterns: Prototype Use a prototypical instance to clone new objects ½ classes used in a program can be specified/loaded at runtime ½ avoid hierarchy of factories that parallels hierarcy of classes Abstract Prototype class implements clone() ½ how to copy? deep vs. shallow ½ how to initialize clones in subclasses Managing Prototypes ½ use a factory or a prototype manager with registered prototypes ½ cloning can be tough (e.g., circular references) Duke CPS 108 8.10