Milestone 4 Devin Gaines Devin Gaines Graham Gimbert Graham Gimbert Ikhan Mcclarty Ikhan Mcclarty James Cefaratti James Cefaratti Kwang Kim Kwang Kim Monarch.

Slides:



Advertisements
Similar presentations
JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
Advertisements

Detecting Bugs Using Assertions Ben Scribner. Defining the Problem  Bugs exist  Unexpected errors happen Hardware failures Loss of data Data may exist.
Slides 2c: Using Spreadsheets for Modeling - Excel Concepts (Updated 1/19/2005) There are several reasons for the popularity of spreadsheets: –Data are.
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
Final Specification KwangMonarchIkhanJamesGraham.
Functions Most useful programs are much larger than the programs that we have considered so far. To make large programs manageable, programmers modularize.
Ikhan McClarty Devin Gaines Graham Gimbert James Cefaratti Kwang Kim Monarch Shah Exploration of Design Alternatives.
Cosc 5/4730 Game Design. A short game design primer. A game or animation is built on an animation loop. – Instance variables of “objects” are updated.
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering 3 October 2007.
 Monday, 9/30/02, Slide #1 CS106 Introduction to CS1 Monday, 9/30/02  QUESTIONS (on HW02, etc.)??  Today: Libraries, program design  More on Functions!
AP Computer Science.  Not necessary but good programming practice in Java  When you override a super class method notation.
Guide To UNIX Using Linux Third Edition
Debugging Logic Errors CPS120 Introduction to Computer Science Lecture 6.
The Project AH Computing. Functional Requirements  What the product must do!  Examples attractive welcome screen all options available as clickable.
Platforms for Learning in Computer Science July 28, 2005.
Passing Other Objects Strings are called immutable which means that once a String object stores a value, it never changes –recall when we passed a message.
MrsBillinghurst. net A2 Computing A2 Computing Projects Game Animation in Pascal.
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
CC0002NI – Computer Programming Computer Programming Er. Saroj Sharan Regmi Week 7.
1 iSee Player Tutorial Using the Forest Biomass Accumulation Model as an Example ( Tutorial Developed by: (
HANGMAN Created By: Will Matthau & Christian Stumpf.
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.
.:::The EA FEAR Division Presents:. When you download FEAR you should be able to load it pretty quickly, so if it’s taking long consider the problems.
Moodle (Course Management Systems). Assignments 1 Assignments are a refreshingly simple method for collecting student work. They are a simple and flexible.
General Programming Introduction to Computing Science and Programming I.
© The McGraw-Hill Companies, 2006 Chapter 4 Implementing methods.
Queues Chapter 3. Objectives Introduce the queue abstract data type. – Queue methods – FIFO structures Discuss inheritance in object oriented programming.
1 Functions 1 Parameter, 1 Return-Value 1. The problem 2. Recall the layout 3. Create the definition 4. "Flow" of data 5. Testing 6. Projects 1 and 2.
Creating your first C++ program
Adding a New Option to the Framework. Introduction This is intended as a step by step guide to adding a new action to the menu or toolbar. The order of.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
File I/O ifstreams and ofstreams Sections 11.1 &
Pointers OVERVIEW.
Working with the VB IDE. Running a Program u Clicking the”start” tool begins the program u The “break” tool pauses a program in mid-execution u The “end”
Systems Life Cycle. Know the elements of the system that are created Understand the need for thorough testing Be able to describe the different tests.
By Melissa Dalis Professor Susan Rodger Duke University June 2011 Multiplication Table.
Records Engineering 1D04, Teaching Session 11. © Copyright 2006 David Das, Ryan Lortie, Alan Wassyng1 Records  So far we've seen a number of different.
Chapter 9-Text File I/O. Overview n Text File I/O and Streams n Writing to a file. n Reading from a file. n Parsing and tokenizing. n Random Access n.
1 Advanced Issues on Classes Part 3 Reference variables (Tapestry pp.581, Horton 176 – 178) Const-reference variables (Horton 176 – 178) object sharing:
Current Assignments Homework 2 is available and is due in three days (June 19th). Project 1 due in 6 days (June 23 rd ) Write a binomial root solver using.
Chapter 8 Iteration Dept of Computer Engineering Khon Kaen University.
Control Structures II Repetition (Loops). Why Is Repetition Needed? How can you solve the following problem: What is the sum of all the numbers from 1.
File Input and Output (I/O) Engineering 1D04, Teaching Session 7.
More on Logic Today we look at the for loop and then put all of this together to look at some more complex forms of logic that a program will need The.
File I/O 1 ifstreams and ofstreams Sections 11.1 & 11.2.
Review, Pseudocode, Flow Charting, and Storyboarding.
I Power Higher Computing Software Development Development Languages and Environments.
Grade Book Database Presentation Jeanne Winstead CINS 137.
The Software Development Process
Human Centric Computing (COMP106) Assignment 2 PROPOSAL 23.
Debugging Computer Networks Sep. 26, 2007 Seunghwan Hong.
Copyright Curt Hill Arrays in C/C++ What? Why? How?
C++ LANGUAGE TUTORIAL LESSON 1 –WRITING YOUR FIRST PROGRAM.
Ready, SET, go! By Melissa Dalis Professor Susan Rodger Duke University July 2011.
How to Test Methods Computer Science 3 Gerb Objective: Test methods properly.
CHAPTER 14 Classes, Objects, and Games XNA Game Studio 4.0.
Visual Basic for Application - Microsoft Access 2003 Finishing the application.
Copyright © 2000, Department of Systems and Computer Engineering, Carleton University 1 Introduction An array is a collection of identical boxes.
1 Colorado Space Grant Consortium Gateway To Space ASEN / ASTR 2500 Class #13 Gateway To Space ASEN / ASTR 2500 Class #13.
Searching CSE 103 Lecture 20 Wednesday, October 16, 2002 prepared by Doug Hogan.
Observing the Current System Benefits Can see how the system actually works in practice Can ask people to explain what they are doing – to gain a clear.
More on Logic Today we look at the for loop and then put all of this together to look at some more complex forms of logic that a program will need The.
Mr H Kandjimi 2016/01/03Mr Kandjimi1 Week 3 –Modularity in C++
Programming Logic and Design Fourth Edition, Comprehensive Chapter 10 Using Menus and Validating Input.
Testing i. explain the importance of system testing and installation planning;
Loop Design What goes into coding a loop. Considerations for Loop Design ● There are basically two kinds of loops: ● Those that form some accumulated.
Selection (also known as Branching) Jumail Bin Taliba by
Testing and Debugging.
Programming in JavaScript
Programming in JavaScript
Presentation transcript:

Milestone 4 Devin Gaines Devin Gaines Graham Gimbert Graham Gimbert Ikhan Mcclarty Ikhan Mcclarty James Cefaratti James Cefaratti Kwang Kim Kwang Kim Monarch Shah Monarch Shah

Graphics Ikhan Mcclarty Ikhan Mcclarty James Cefaratti James Cefaratti Monarch Shah Monarch Shah

Overview Of the major parts of the code able graphics, the button class is almost done. Of the major parts of the code able graphics, the button class is almost done. All of the graphics that we are going to use are already finished, barring unforseen problems. All of the graphics that we are going to use are already finished, barring unforseen problems. We will cover some of the more major parts to the buttons. We will cover some of the more major parts to the buttons.

Clicked bool Button::inButton() bool Button::inButton() { if( ( mouse_x >= getX() && mouse_x = getY() && mouse_y = getX() && mouse_x = getY() && mouse_y <= getBottom() ) ) { { return true; return true; } } else else { { return false; return false; } } } //This code stub is used to detect if the //mouse cursor is within the bounds of the //button. //This code stub is used to detect if the //mouse cursor is within the bounds of the //button.

Left Clicked bool Button::clicked() bool Button::clicked() { if( inButton() ) //This is the code to determine when a button is if( inButton() ) //This is the code to determine when a button is { //left clicked. Obviously this is going to be important { //left clicked. Obviously this is going to be important if( mouse_b & 1) //to the overall project, as buttons will guide when if( mouse_b & 1) //to the overall project, as buttons will guide when { //the game will advance. { //the game will advance. return true; return true; } } else else { { return false; return false; } } else else { { return false; return false; } } }

Draw Button void Button::drawButton(BITMAP *putSkin ) void Button::drawButton(BITMAP *putSkin ) { draw_sprite( screen, putSkin, getX(), getY() ); draw_sprite( screen, putSkin, getX(), getY() ); } //Draw button is also very important, as it //is what displays the button to the screen. //Draw button is also very important, as it //is what displays the button to the screen. //The actual function that gets called is //from the allegro graphical library. //The actual function that gets called is //from the allegro graphical library.

Correctness of Buttons Firstly, all of the get and set methods were tested with a console application to test that they were correct. Firstly, all of the get and set methods were tested with a console application to test that they were correct. Another major problem regarding correctness are filenames. Another major problem regarding correctness are filenames. If a filename is incorrect when trying to load, the program will crash. If a filename is incorrect when trying to load, the program will crash. Testing this was important. Testing this was important.

Correctness of Buttons The way we tested the correctness of the buttons was to set up a test program. The way we tested the correctness of the buttons was to set up a test program. In the test program, the button’s (x,y) position was always on the screen, as was the mouse’s (x,y) position. In the test program, the button’s (x,y) position was always on the screen, as was the mouse’s (x,y) position. By clicking all around and in the button while keeping track of all the clicks, we were able to determine that the buttons work properly By clicking all around and in the button while keeping track of all the clicks, we were able to determine that the buttons work properly

Correctness of Buttons With the Buttons and the file input working correctly, we were able to get the buttons to actually serve a purpose. With the Buttons and the file input working correctly, we were able to get the buttons to actually serve a purpose. We made it so that when a button is clicked, a file was written to. We made it so that when a button is clicked, a file was written to. After the test was finished, with text in the file, we knew that the buttons were fully functional. After the test was finished, with text in the file, we knew that the buttons were fully functional.

Integration The graphics are modular, to the point where integration will just be a matter of using the given classes The graphics are modular, to the point where integration will just be a matter of using the given classes There is nothing that has to be modified to work in the environment it was destined to. There is nothing that has to be modified to work in the environment it was destined to. The graphics front end will rely upon all of the other back end code being developed concurrently. The graphics front end will rely upon all of the other back end code being developed concurrently.

Integration As an overview, the graphics will need to know what the AI is doing, when chips are being passed around, and the cards available to the player. As an overview, the graphics will need to know what the AI is doing, when chips are being passed around, and the cards available to the player. When all of the above things are happening the GUI needs to change to accommodate what is happening in the backend. When all of the above things are happening the GUI needs to change to accommodate what is happening in the backend.

Integration The graphics engine will also need to have access to the save game and load game features The graphics engine will also need to have access to the save game and load game features As well as the ability to advance to the next stage in the game. As well as the ability to advance to the next stage in the game.

Success The graphics functions will work when the project is finished because they are modular. The graphics functions will work when the project is finished because they are modular. A button can act as a flag for almost anything. A button can act as a flag for almost anything. As long as allegro works as it should, the rest of the graphics should fall into place. As long as allegro works as it should, the rest of the graphics should fall into place.

Without Further Adieu Some buttons… Some buttons…

Shuffling Function Devin Thomas Gaines

Classes and Functions Classes Classes Deck Class Deck Class RandomNumber Class RandomNumber Class *Distribution Class (this will be optional) *Distribution Class (this will be optional) I wanted to make the code more functional and broke it down into modules for ease of integration.

Deck Class class Deck { public: // default conmstructor Deck(); // intializes the deck array and size of deck void initDeck( int deck[], int size ); //shuffles the deck using random number generator and swapping void shuffleDeck( int deck[], int size ); //deals hands given the number of players and cards per player //Max number of players is 10 (arbitrary value!) and max number of cards being dealt is 5 void dealHand( int deck[], int numberOfPlayers, int cardsPerHand); //sorts a deck void sortHand( int hand[], int size ); //prints a given hand or whole deck void printHand( int hand[], int size ); //prints individual cards void printCard( int card ); private: // sets size and array int deck[DECKSIZE]; };

RandomNumber Class class RandomNumber { public: // default conmstructor with defaults of 0&1 RandomNumber(int a=0, int b=1); // Mutator: // Sets high and low values void SetInterval(int a, int b); // Faclitators: // Display Random numbers... int DrawRandomNumber(); // Set seed using current time void SetTimerSeed(); private: // Inspectors: int GetLow(); int GetHigh(); // Data members int Low, High; };#endif

The Shuffle Program Here is a demo of how the shuffling program works. Here is a demo of how the shuffling program works. I basically made a main function that tests all my other functions using the printHand() and printCard() methods. I basically made a main function that tests all my other functions using the printHand() and printCard() methods. From here, I have these functions print out the original deck, the shuffled deck and then the sorted deck, which should resemble the original deck exactly. From here, I have these functions print out the original deck, the shuffled deck and then the sorted deck, which should resemble the original deck exactly. I also have the beginnings of a dealHand() function that will distribute the cards out among players. I also have the beginnings of a dealHand() function that will distribute the cards out among players.

Snapshots of Demo (Ex. 1)

Snapshots of Demo (Ex. 2)

Snapshots of Demo (Ex. 3)

Integration…how? The only class that will be communicating with the rest of the program is the Deck class. The only class that will be communicating with the rest of the program is the Deck class. There will need to be shuffleDoneFlag variable to let the Game Class know when shuffling has occurred and is complete. There will need to be shuffleDoneFlag variable to let the Game Class know when shuffling has occurred and is complete. Also, I will need to send my deck array to player algorithm and the best hand algorithm for further play and analysis. Also, I will need to send my deck array to player algorithm and the best hand algorithm for further play and analysis.

Current Issues Currently, I am working on the distribution of the random numbers in my program. Currently, I am working on the distribution of the random numbers in my program. At first, with the way that I seeded my random function, the distribution always came out to be the same. At first, with the way that I seeded my random function, the distribution always came out to be the same.

Reworking the Distribution I’m trying to vary distribution methods in order to make the program more random-like. I’m trying to vary distribution methods in order to make the program more random-like. So far I been working with uniform, normal and exponential distributions and shifting between those three types. So far I been working with uniform, normal and exponential distributions and shifting between those three types.

Any Possible Changes The only possible changes or additions that might happen is the formation of another class or function that will carry different distribution patterns for the shuffle program. The only possible changes or additions that might happen is the formation of another class or function that will carry different distribution patterns for the shuffle program.

AI Kwang Kim Kwang Kim

Methods bool Player::preFlop() { bool Player::preFlop() { int result = rankHand(firstCard, secondCard); switch (result) { case 1: case 1: raise(currBet); raise(currBet); break; break; case 2: case 2: callBet(currBet); callBet(currBet); break; break; case 3: case 3: fold(); fold(); break; break; default: default: cout << playerName << " pre-flop strategy" << endl; cout << playerName << " pre-flop strategy" << endl; break; break; } return true; return true; } //preflop uses the strength of the hand to //determine whether or not it is playable. //preflop uses the strength of the hand to //determine whether or not it is playable.

RankHand rankHand is used by the preflop strategy to determine what it should do. rankHand is used by the preflop strategy to determine what it should do. The method is too long to show here, but is just a function that uses a series of if statements to determine if the hand is “raise-able” “check- able” or “fold-able” The method is too long to show here, but is just a function that uses a series of if statements to determine if the hand is “raise-able” “check- able” or “fold-able”

Correctness The getter and setter functions that are in this class were tested through the console. The getter and setter functions that are in this class were tested through the console. By using options to set and get different values we were able to determine that they were working correctly. By using options to set and get different values we were able to determine that they were working correctly.

Correctness For the actual workhorse code, we used a different console application. For the actual workhorse code, we used a different console application. This separate console application was designed to take in two card values, and output if the player should fold, raise, or call. This separate console application was designed to take in two card values, and output if the player should fold, raise, or call. The result was that the subroutine rankHand was functioning properly The result was that the subroutine rankHand was functioning properly

Integration This module is what makes the game advance. This module is what makes the game advance. The player AI is responsible for making the decision to raise, call, or bet, and is essentially the thing that makes this game playable. The player AI is responsible for making the decision to raise, call, or bet, and is essentially the thing that makes this game playable.

Integration By making a Player class, we are able to modularize them, and add as many as we want to a table. By making a Player class, we are able to modularize them, and add as many as we want to a table. The only thing that comes out of integration is the automation of play. The only thing that comes out of integration is the automation of play. We are going to have to loop through all the active players and use the AI to make them decide what to do. We are going to have to loop through all the active players and use the AI to make them decide what to do.

This will work! The reason this will work is the same reason all the other pieces will work. The reason this will work is the same reason all the other pieces will work. It is all just many parts of a whole. It is all just many parts of a whole. In order to make that whole work, all of the pieces work symbiotically. In order to make that whole work, all of the pieces work symbiotically. With thorough testing and play we will succeed. With thorough testing and play we will succeed.

Best Hand Graham Gimbert Graham Gimbert

Minor Modifications The BestHand class has been slightly modified now to accommodate the recently agreed on naming convention The BestHand class has been slightly modified now to accommodate the recently agreed on naming convention BestHand no longer uses a list to keep track of the best hand, just a two dimensional 7x7 matrix of Cards. BestHand no longer uses a list to keep track of the best hand, just a two dimensional 7x7 matrix of Cards.

Methods Insert(Card temp) Insert(Card temp) {if (cardList[0] == NULL) cardList[0][0] = temp; else {for (int i = 0; i < 7; i++) {if (temp.rank >= cardList[i][0]) {for (int j = 7; j > i; j--) //Move cards ahead cardList[j][0] = cardList[j-1][0]; cardList[i][0] = temp;//Not shown, moving all downward cards }}} This is the basic idea of inserting the cards. This is the basic idea of inserting the cards.

Correctness The correctness of this was again tested with a console application. The correctness of this was again tested with a console application. Using the console application we are able to show that correct values are received… some of the time Using the console application we are able to show that correct values are received… some of the time The function is not quite finished yet. The function is not quite finished yet.

Correctness The testing application reads in 7 cards from user input, and runs the best hand algorithm. The testing application reads in 7 cards from user input, and runs the best hand algorithm. If the output matches the correct best hand, then we have a success. If the output matches the correct best hand, then we have a success.

Integration The place where the best hand algorithm belongs is in the Player class. The place where the best hand algorithm belongs is in the Player class. In order to determine what the player should do for a post flop strategy, the best hand algorithm is used. In order to determine what the player should do for a post flop strategy, the best hand algorithm is used. Since the best hand algorithm was encapsulated into a class, it makes it easy to add it anywhere it is needed. Since the best hand algorithm was encapsulated into a class, it makes it easy to add it anywhere it is needed.

Integration Once we have the finished best hand algorithm, we will able to finish up the player classes very quickly. Once we have the finished best hand algorithm, we will able to finish up the player classes very quickly. With the player classes done, and the shuffling done, we will be able to tie everything in together with the graphics and make the game functional. With the player classes done, and the shuffling done, we will be able to tie everything in together with the graphics and make the game functional.

Finished Integration We are confident, that with all of our functions finished, we will have a complete and functional product. We are confident, that with all of our functions finished, we will have a complete and functional product. There will be bugs, but that is to be expected. There will be bugs, but that is to be expected. The result of the integration will be a success, with hard work and determination. The result of the integration will be a success, with hard work and determination.