Tulsa.NET User Group INTRO TO OBJECT ORIENTED PROGRAMMING.

Slides:



Advertisements
Similar presentations
Advanced Strategies for Craps and Poker Billy J. Duke Joel A. Johnson.
Advertisements

Discrete Probability Rosen 5.1.
Combinatorics & Probability Section 3.4. Which Counting Technique? If the problem involves more than one category, use the Fundamental Principle of Counting.
Combinations Examples
ECE 491 Final Project Multiplayer Card Game Author: Tian Ma Presentation 5/4/2004.
Probability Key. You are given a standard deck of 52 playing cards, which consists of 4 suits: diamonds, hearts, clubs, and spades. Each suit has 13 cards.
Mock Objects. Unit-testing and TDD are challenging They require some effort to: – Write a test for a small functionality – Refactor production code and.
4/16/2015 MATH 224 – Discrete Mathematics Counting Basic counting techniques are important in many aspects of computer science. For example, consider the.
Short Stack Strategy – How to play after the flop Strategy: No Limit.
Dealer Comm Hand Player makes Ante bet and optional Bonus bet. Five cards are dealt to each player from the shuffler. Five cards are dealt from the shuffler.
12 Pontoon1May Pontoon program CE : Fundamental Programming Techniques.
1 Counting Rules. 2 The probability of a specific event or outcome is a fraction. In the numerator we have the number of ways the specific event can occur.
Intro to Probability & Games
A R R A Y ! for Multiplication!!
VOCABULARY  Deck or pack  Suit  Hearts  Clubs  Diamonds  Spades  Dealer  Shuffle  Pick up  Rank  Draw  Set  Joker  Jack 
Find all the factors pairs of 20.
1 The game of poker You are given 5 cards (this is 5-card stud poker) The goal is to obtain the best hand you can The possible poker hands are (in increasing.
Blackjack: Myths vs. Reality Group K Andrew KerrAndrew Phillips Sven SkoogWoj Wrona.
The Parameterized Poker Squares EAAI NSG Challenge
CSS446 Spring 2014 Nan Wang.  To learn how to choose appropriate classes for a given problem  To understand the concept of cohesion  To minimize dependencies.
Game Rules Rules define game objects and define allowable actions by the players.
Poker Solutions.
Game Rules Rules define game objects and define allowable actions by the players.
Counting. Techniques for counting Rule 1 Suppose we carry out have a sets A 1, A 2, A 3, … and that any pair are mutually exclusive (i.e. A 1  A 2 =
3.8 Counting Techniques: Combinations. If you are dealt a hand in poker (5 cards), does it matter in which order the cards are dealt to you? A  K  J.
6.1 Probability exercises. Def Def: If S is a finite sample space of equally likely outcomes, and E is an event, that is, a subset of S, then the probability.
One person will stand behind the desk of another. I’ll ask you a question. The first of the two people standing together to say the correct answer coherently.
Poker. Basic card terminology Suits: Hearts, diamonds, clubs, spades Deuce, face cards.
Proportions Round One 2) x + 3 = 15 Answers 2.) x + 3 = 15 X=12 21.
Do Now 9/28/10 Take out your HW from last night. Take out your HW from last night. Textbook page 31-32, #3-11, all Textbook page 31-32, #3-11,
Do Now 10/3/11 Take out your HW from Wednesday. Take out your HW from Wednesday. Textbook page 54, #1-4 all, all, all, 56 Textbook page 54,
What is the Purpose of This Class
Main Program Repeat call InitialiseVar # a procedure to reset all variables call ShufflePack# a procedure to generate a random list of 52 cards call PlayerGo#
Basic Probability Section 7.1. Definitions Sample Space: The set of all possible outcomes in a given experiment or situation Often denoted by S Event:
英語研習營 Speakers: English Service Club, National Chiayi University 指導教授 :Dr. Chao-chih Liao Week 5 (March 28) A: Be sure to write alphabet on the right place.
Homework Homework due now. Reading: relations
 m C r =m!/r!(m-r)!  Property: m C r = m C (m-r)  Example: ◦ If you have 10 pens, all in different colors, and you want to bring two of them to class,
All In To put all the rest of your money into the pot.
Game Procedures Who does what, where, when, and how?
Penn Poker Fall Strategy Session Series
Billion Dollar Baby Game Created By: Timmy Drzewinski Edwin McCracken.
Rules for Mini Bridge Lesson 5 Place board correct orientation (NSEW) Count cards (face down) Sort hand Count points Dealer to announce point count Clockwise.
StructureStructure. Outline Introduction Structure Definitions Initializing Structures Accessing Members of Structures Using Structures with Functions.
By: John Cook 11/06/2009 PTTE John Cook 3/4/2016.
Combinations 0.4. Combinations: a selection of r objects from a group on n objects where the order is not important.
Knock Out!!!!! Your are in teams of four. The number on your desk corresponds to the number problem you are responsible for. When all four members of.
Probability and statistics - overview Introduction Basics of probability theory Events, probability, different types of probability Random variable, probability.
Texas Holdem A Poker Variant vs. Flop TurnRiver. How to Play Everyone is dealt 2 cards face down (Hole Cards) 5 Community Cards Best 5-Card Hand Wins.
Probability Intro. Coin toss u Toss two coins 10 times keeping track of the results (head/tails) u Now toss 3 coins 10 times u Make a chart of all the.
Arrangements and Selections (and how they may be counted)
Spring ‘10 Term Project Casino Game Overview
MAT 142 Lecture Video Series
Multiplication Rule Combinations Permutations
Who does what, where, when, and how?
Game Art and Design Unit 3 Lesson 4 Probability
Sequential Placement Optimization Games: Poker Squares, Word Squares, and Take It Easy! Todd W. Neller Abstract: In this talk, we teach how to play “Poker.
Cribbage A fun game of counting.
Section Combinations (with and without restrictions)
IMPROVERS’ LESSONS Welcome
The Birds of a Feather Research Challenge
The Parameterized Poker Squares EAAI NSG Challenge
Probability of casino games
Mathematics for Computer Science MIT 6.042J/18.062J
Probability Section 19 NOTE: We are skipping Section 18. 2/21/2019
Term Project: Poker Game
CLICK THE NUMBERS IN SEQUENCE
Do Now 9/28/11 Take out HW from last night. Copy HW in your planner.
Do Now 9/24/10 Take out HW from last night. Copy HW in your planner.
CLICK THE NUMBERS IN SEQUENCE
HOW TO PLAY POKER.
Presentation transcript:

Tulsa.NET User Group INTRO TO OBJECT ORIENTED PROGRAMMING

DisplayAboutMe(host); >Sean Whitesell President of Tulsa.NET User Group Sr. Developer at OpenLink

Special thanks to…

What is OOP? Object Oriented Programming Creation of Classes and Interfaces Polymorphism

But first, a challenge POKER HANDS Import file Each line is cards for both players Each line is a round Determine winner of each round using poker rules for comparing hands. Determine how many times player 1 wins Player 1Player 2 Round 12C AD JH TC 5S2S 4H JH 3D 2D Round 26H 7D 8H 9C TS8D 3S 5D 5C AH Round 34H AS JS QS QC8C 8H 3S TH 9D

Poker Challenge projecteuler.net/problem=54 Test project file on that page Judging by me supplying a new file to your code I’ll know how many times player 1 should win Judged by correct answer, speed, then code. Submit executable and source code.

Example from site Hand Player 1 Player 2 Winner 1 5H 5C 6S 7S KD Pair of Fives 2C 3S 8S 8D TD Pair of Eights Player 2 2 5D 8C 9S JS AC Highest card Ace 2C 5C 7D 8S QH Highest card Queen Player 1 3 2D 9C AS AH AC Three Aces 3D 6D 7D TD QD Flush with Diamonds Player 2 4 4D 6S 9H QH QC Pair of Queens Highest card Nine 3D 6D 7H QD QS Pair of Queens Highest card Seven Player 1 5 2H 2D 4C 4D 4S Full House With Three Fours 3C 3D 3S 9S 9D Full House with Three Threes Player 1

Rules for Comparing Hands High Card:Highest value card. One Pair:Two cards of the same value. Two Pairs:Two different pairs. Three of a Kind:Three cards of the same value. Straight:All cards are consecutive values. Flush:All cards of the same suit. Full House:Three of a kind and a pair. Four of a Kind:Four cards of the same value. Straight Flush:All cards are consecutive values of same suit. Royal Flush:Ten, Jack, Queen, King, Ace, in same suit.

O bject O riented P rogramming And you

Object PropertiesMethods

DogCat LionHorse Animal

Houses VillaApartments DuplexRanch

Contacts VendorsCustomers EmployeesIRS

House Building “Is A” Inheritance

House Room Composition “Has A” Room cannot exist without a house

House Occupant Aggregation “Has A / An” The two objects can exist independently.

Public void SolveChallenge() { var foo = File.OpenText(“C:\\temp\\poker.txt”; foreach ( var line in foo) { blah } compare each card…. is Royal Flush is Straight Flush is Four of a Kind is Straight is Three of a Kind … } Don't Do This!

Main Class Card PlayerHand Winner

Polymorphism allows objects to behave differently

Ship ( IShipMethod) IShipMethod USPS UPS FedEx

Pay( IPaymentMethod) IPaymentMethod Visa Mastercard PayPal