Presentation is loading. Please wait.

Presentation is loading. Please wait.

Checkers A Matlab Project by Spenser Davison, Edward Dyakiw, Justin Pezzi, and Scott Wu.

Similar presentations


Presentation on theme: "Checkers A Matlab Project by Spenser Davison, Edward Dyakiw, Justin Pezzi, and Scott Wu."— Presentation transcript:

1 Checkers A Matlab Project by Spenser Davison, Edward Dyakiw, Justin Pezzi, and Scott Wu

2 Checkers - Defined Alternating turns, move your piece Jump over opponents piece if there is space Reaching the end of the board grants kings  Kings can move in any direction Remove all of your opponents pieces to win

3 Checkers – Problems It isn’t as simple as that when coding. One must design everything from the ground up. Assume the player doesn’t know how to play. Translating the rules was our toughest challenge.

4 Checkers – Tasks Draw the board  Fill in spaces  Place checkers Construct a logical sequence of events  For each player Checking for human errors  Based on rules we defined

5 Checkers - Solutions Drawing board  Plotted horizontal and vertical lines  Filled in black in appropriate boxes  Made a checker Drew a circle Filled it either black or red Each having a unique handle

6 Checkers - Solutions Sequence of events  Draw the checkerboard  Give instructions  Prompt a player to move Check if that move is legal  Checks if king or not Change the invisible board based on new information  Visually make the checker move/jump  Check for a winner  Ask to play again? Repeat or End program

7 Checkers - Solutions Checking for human errors  Moving out of bounds  Moving horizontally  Moving vertically  Moving on top of another piece  Selecting incorrect piece  Moving in wrong diagonal direction  Moving too many spaces at one time  Not moving at all

8 Artificial Intelligence Objective: Create a computer player for single player games. Major Tasks:  Locate all available pieces.  Identify free pieces for use.  Execute required moves (jumps).  Assign scores for different moves.  Select best move and execute.  Prevent invalid moves.

9 Artificial Intelligence Solutions:  Cycle through board and append an array with location of AI’s pieces.  Cycle through array of locations and eliminate all pieces without available moves.  Cycle through all pieces and executes any possible jumps from piece.  Cycle through remaining pieces and assign separate scores for left and right.  Cycle through list of scores and execute move with largest score. Receive Board Variable Find All Pieces Find Pieces with Moves Check Moves for a Jump Assign Scores Return Best Move

10 Checkers Program Basic Flowchart Display Instruction s 2 1 Is there a winner? No Yes Print Winner Play Again? Who’s turn is it? Computer Player How many Players? Who goes First? Get Move Get AI Move YesNo Setup Board Valid Move? No Yes Reset Board Terminate Program


Download ppt "Checkers A Matlab Project by Spenser Davison, Edward Dyakiw, Justin Pezzi, and Scott Wu."

Similar presentations


Ads by Google