Blackjack Programming Project

Slides:



Advertisements
Similar presentations
By: Jonathan Quenzer. To have a computer learn how to play Blackjack through reinforcement learning Computer starts off with no memory. After each hand.
Advertisements

Phase 2 -- Logic Implementation & Simulation Switching & Logic Design Project.
Topics in Python Blackjack & TKinter
© Glenn Rowe AC Lab 2 A simple card game (twenty- one)
It’s All in the Cards Adding and Subtracting Integers
Computer Science Project: BLACKJACK BY TEAM A. Overview of the Project Part A: Ramanathan Swaminathan, Zaith Peralta Ramos Game control, scoring and user.
MATLAB PROJECT DO YOU WANT TO PLAY A GAME?. DESIGN CRITERIA For this project, you are required to implement any card game using MATLAB  All selections.
Lecture 10. Simplified roulette European roulette has numbers 0,1,…36. xD0s
Joker a Card Game Programming Language Jeffrey Eng Jonathan Tse Howard Chu Timothy SooHoo.
Dice, Cards and Darts Probabilities in Games Finding the Right Representation.
An application of the Probability Theory
12 Pontoon1May Pontoon program CE : Fundamental Programming Techniques.
Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.
Computer Science 313 – Advanced Programming Topics.
Design Example. Requirements Make a program that simulates the game of blackjack For now, we ignore money/betting…. just simulate game play But… this.
COMP 14 Introduction to Programming Mr. Joshua Stough March 30, 2005 Monday/Wednesday 11:00-12:15 Peabody Hall 218.
CS 106 Introduction to Computer Science I 11 / 08 / 2006 Instructor: Michael Eckmann.
Chapter 5 Black Jack. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 5-2 Chapter Objectives Provide a case study example from problem statement.
Mau Mau (mow- mow) A card game
 Pearson Education, Inc. All rights reserved Arrays.
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 
Sequencing Miss Regan. Blood Hound  Does anyone know what the Bloodhound project is?  Video 1 Video 1  Video 2 Video 2  Link to website Link to website.
Guide to Programming with Python Chapter Nine Working with/Creating Modules.
April 2009 BEATING BLACKJACK CARD COUNTING FEASIBILITY ANALYSIS THROUGH SIMULATION.
CIS Computer Programming Logic
Poker UML and ADT design plan.
CS161 Topic #15 1 Today in CS161 Lecture #15 Practicing! Writing Programs to Practice Write a game program (1 player) of Mad Math Reuse the functions to.
Flow Charts.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 6 Value- Returning Functions and Modules.
Lecture Set 5 Control Structures Part D - Repetition with Loops.
JokerStars: Online Poker William Sanville CSE 4904 Milestone II.
Learning to Play KardKuro Goals: Have Fun while Practicing Addition and Subtraction. Improve Social Learning Opportunities with Classmates. Become familiar.
Chapter 7 Arrays. A 12-element array Declaring and Creating Arrays Arrays are objects that occupy memory Created dynamically with keyword new int c[]
Blackjack Betting and Playing Strategies: A Statistical Comparison By Jared Luffman MSIM /3/2007.
LECTURE 14: USE CASE BASICS CSC 212 – Data Structures.
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#
By Melissa Dalis Professor Susan Rodger Duke University June 2011 Multiplication Table.
©2009, Tom McKendree Biplanes ©2009, Tom McKendree.
Computer Science 101 Circuit Design - Examples. Sum of Products Algorithm Identify each row of the output that has a 1. Identify each row of the output.
Structured Programming: Debugging and Practice by the end of this class you should be able to: debug a program using echo printing debug a program using.
A Casino Simulator Program Using Advanced C++ Concepts Thomas H. Hand July 25 th, 2005 Software/Hardware Integration.
UFCEKS-20-2Multimedia Authoring Times Table Quiz.
MA471 Fall 2003 Lecture 2. On With The Games Today we are going to watch each group play a couple of rounds of cards. We will go through the game slowly.
GamblingGambling What are the odds? Jessica Judd.
Chapter 7 Problem Solving with Loops
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
Random Numbers Random numbers are extremely useful: especially for games, and also for calculating experimental probabilities. Formula for generating random.
Week 8 : User-Defined Objects (Simple Blackjack Game)
UFCFY5-30-1Multimedia Studio Scripting for Interactive Media Times Table Quiz This will contribute towards your online portfolio for this module.
Lamar Hines, David Yates, and Rich Hauck December 8, 2004 Blackjack-in-the-Box.
World of Wokcraft The very best in Single pan cooking themed fantasy gaming!
AP Java Elevens Lab.
Lecture 11.
Chapter 5 Black Jack.
Probability of casino games
Print slides for students reference
A R R A Y ! for Multiplication!!
One-Dimensional Array Introduction Lesson xx
Module 5 Lesson 3 Extreme Scratch Cards
Truth tables: Ways to organize results of Boolean expressions.
Let’s Practice Play 2 Missing Digits !
Processing Computer Components.
Truth tables: Ways to organize results of Boolean expressions.
1st/2nd Grade Math Games Family Math Night.
Truth tables: Ways to organize results of Boolean expressions.
Task 2 Implementation help
Vocab-Rummy A card game with: Could be used for:
A R R A Y ! for Multiplication!!
Presentation transcript:

Blackjack Programming Project Computer Science WS2010 FH Aachen

Computer Science WS2010 FH Aachen Group No. 3 Team A: Aniket Bapat Kamel Ajami Team B: Rojas Eduardo Ngo Quang Ha Team C: Thomas Bücker Vahid Ahsani Team D: Tonatiuh Saldaña Laura Paulina Cabello Computer Science WS2010 FH Aachen

Computer Science WS2010 FH Aachen Overview 1. Used Components and Tools 2. First Concept by using «Use Case Diagram» 3. Main Program Functions 4. Flow Charts of Game Activities 5. Function Description 6. Doxygen Slides 7. User Manual Computer Science WS2010 FH Aachen

Computer Science WS2010 FH Aachen 1. USED COMPONENTS AND TOOLS Computer Science WS2010 FH Aachen

ACUAS Easy Programming Code Doxygen Used Components and Tools Atmega 16 µController 4 Row LCD Display Joystick AVR Studio C-Code ACUAS Easy Programming Code Doxygen

Computer Science WS2010 FH Aachen 2. USE CASE DIAGRAM Computer Science WS2010 FH Aachen

Use Case Diagram

Computer Science WS2010 FH Aachen 3. MAIN PROGRAM PARTS Computer Science WS2010 FH Aachen

The program is organized into modules Main Program Parts The program is organized into modules BlackJack Main Result Display Dealer`s Hand Shuffle Player`s Hand

Computer Science WS2010 FH Aachen 4. FLOW CHARTS OF THE GAME ACTIVITIES Computer Science WS2010 FH Aachen

Main Activity Diagram

Start New Game Activity Diagram

Player`s Hand Activity Diagram

Dealer`s Hand Activity Diagram

Get Card Activity Diagram

Finnish Match Activity Diagram

Computer Science WS2010 FH Aachen 5. FUNCTION DESCRIPTION Computer Science WS2010 FH Aachen

Function Description System Main Function The main function will carry out the execution of the project files. The different functions will be integrated in conformity with the BlackJack Game rules. The main function: 1. Initializing and starting new game. 2. Fetching and displaying the PlayerHand, the cards that the player has, their values and suits and their sum. 3. Fetching the displaying the DealerHand, the cards that the dealer has, their values and suits and their sum. 4. Comparing each the Player and the Dealer cards and displaying the winner followed by the overall score.

Function Description Shuffle Function It performs the shuffling process for the card deck. The shuffling process is displayed during which the following takes place: 1. An array of numbers p=[1,2,3,...51,52] is generated. 2. Mixing the cards r times (r=Randomize()+16) using ACUAS instruction RANDOM(0,51) at least 16 times. 3. A control subroutine checks whether already dealt cards are not generated again. 4. A progress bar is displayed to simulate the shuffling progress.

Function Description Player Hand Function It processes, executes and displays the Player's play. The PlayerHand function carries out the following: - resets the Player points as long as loop=True - passes the Player a card - stores the dealt cards in Player's hand array - calculates the Player's hand points - displays the Player's play and result - checks if the Player busts - checks the number of cards condition - checks the BlackJack condition - stays in the loop if the Player wants another card Hit=1 or exits if the Player stands - increases the game array by 1 to accommodate for one more card in case of Hit=1

Function Description Take Card Function This function is executed when Player or Dealer needs to take a new card. The TakeCard() function represents the dealing process. It proceeds as following: 1. The pack is shuffled. 2. A card is dealt and deducted from the cards' deck. 3. After taking a card, we put the card on the table. It will be stored in g[i]: the array of cards on the table.

Ask Hit or Stand Function Function Description Ask Hit or Stand Function It asks for the Player`s decision to Hit or Stand through the Joystick and passes the information to the Function PlayerHand. This functions waits for the Player's decision: - ON_JOYSTICK_DOWN -> Hit=1; Player wants another card. - ON_JOYSTICK_UP -> Stand=1; Player turn is finished. Dealer's turn is started.

CountPlayerPoints Function Function Description CountPlayerPoints Function It calculates the points of the Player's hand. This function will calculate how much in points the Player's hand is. It does that by the following steps: 1. Each card in the pack has been indexed. The card index is represented by the variable uint8_t CardID. 2. From the card index the integer value Number=((CardID-1)/4)+1 is calculated from which the CardValue is deduced. 3. PlayerPoints is calculated Pp+=CardValueAccording to the value of Pp, the ace value is determined. PAce11=0 => Ace equals 1 PAce11=1 => Ace equals 11

Function Description DealerHand Function It processes, executes and displays the Dealer's play It takes Player BlackJack flag as input and does the following: resets the Dealer points as long as Dp<17: - passes the Dealer a card - stores the dealt cards in Dealer's hand array - calculates the Dealer's hand points - displays the Dealer's play and result - checks the BlackJack condition - checks the number of cards condition - increases the game array by 1 to accommodate for one more card.

CountDealerPoints Function Function Description CountDealerPoints Function It calculates the points of the Delaer's hand. This function will calculate how much points the Dealer has. It does that by the following steps: - Each card in the pack has been indexed. The card index is represented by the variable uint8_t CardID. - From the card index the integer value Number=((CardID-1)/4)+1 is calculated from which the CardValue is deduced. - DealerPoints is calculated Dp+=CardValue According to the value of Dp, the ace value is determined. DAce11=0 => Ace equals 1 DAce11=1 => Ace equals 11

CardsDisplay Function Function Description CardsDisplay Function It displays the hand's cards,their value, suit and sum. This function is called by both DealerHand() and PlayHand() function to display their cards on the LCD. It starts by displaying the current actor, Player or Dealer, then it displays the hand's cards, their value, suit and sum.

FinnishMatch Function Function Description FinnishMatch Function It displays the winner and the score and prompts a screen asking the Player for a Rematch! and after every game the Player and Dealer cards are thrown on the table and set aside.

Computer Science WS2010 FH Aachen 6. DOXYGEN SLIDES Computer Science WS2010 FH Aachen

Computer Science WS2010 FH Aachen 7. USER MANUAL Computer Science WS2010 FH Aachen

Computer Science WS2010 FH Aachen AND NOW, LET`S PLAY!!! Computer Science WS2010 FH Aachen